зеркало из https://github.com/mozilla/pjs.git
Fix crash when clicking empty space in <select>. Bug 161499, r=jkeiser, sr=jst
This commit is contained in:
Родитель
217cf61257
Коммит
93743d7733
|
@ -658,10 +658,13 @@ void nsListControlFrame::PaintFocus(nsIRenderingContext& aRC, nsFramePaintLayer
|
|||
}
|
||||
|
||||
PRBool lastItemIsSelected = PR_FALSE;
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
if (NS_SUCCEEDED(selectNSElement->Item(focusedIndex, getter_AddRefs(node)))) {
|
||||
nsCOMPtr<nsIDOMHTMLOptionElement> domOpt(do_QueryInterface(node));
|
||||
domOpt->GetSelected(&lastItemIsSelected);
|
||||
if (focusedIndex != kNothingSelected) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
if (NS_SUCCEEDED(selectNSElement->Item(focusedIndex, getter_AddRefs(node)))) {
|
||||
nsCOMPtr<nsIDOMHTMLOptionElement> domOpt(do_QueryInterface(node));
|
||||
NS_ASSERTION(domOpt, "Something has gone seriously awry. This should be an option element!");
|
||||
domOpt->GetSelected(&lastItemIsSelected);
|
||||
}
|
||||
}
|
||||
|
||||
// set up back stop colors and then ask L&F service for the real colors
|
||||
|
|
|
@ -658,10 +658,13 @@ void nsListControlFrame::PaintFocus(nsIRenderingContext& aRC, nsFramePaintLayer
|
|||
}
|
||||
|
||||
PRBool lastItemIsSelected = PR_FALSE;
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
if (NS_SUCCEEDED(selectNSElement->Item(focusedIndex, getter_AddRefs(node)))) {
|
||||
nsCOMPtr<nsIDOMHTMLOptionElement> domOpt(do_QueryInterface(node));
|
||||
domOpt->GetSelected(&lastItemIsSelected);
|
||||
if (focusedIndex != kNothingSelected) {
|
||||
nsCOMPtr<nsIDOMNode> node;
|
||||
if (NS_SUCCEEDED(selectNSElement->Item(focusedIndex, getter_AddRefs(node)))) {
|
||||
nsCOMPtr<nsIDOMHTMLOptionElement> domOpt(do_QueryInterface(node));
|
||||
NS_ASSERTION(domOpt, "Something has gone seriously awry. This should be an option element!");
|
||||
domOpt->GetSelected(&lastItemIsSelected);
|
||||
}
|
||||
}
|
||||
|
||||
// set up back stop colors and then ask L&F service for the real colors
|
||||
|
|
Загрузка…
Ссылка в новой задаче