Bug 231830, crash on style.display = 'none' for select element when event onchange occurs [@ nsStyleContext::GetRuleNode ][@ nsIFrame::Invalidate ], r+sr=bz

git-svn-id: svn://10.0.0.236/trunk@207128 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
Olli.Pettay%helsinki.fi
2006-08-11 12:09:30 +00:00
parent 669acc5bbe
commit f45fdfb0d8
3 changed files with 20 additions and 4 deletions

View File

@@ -1933,7 +1933,7 @@ nsListControlFrame::ToggleOptionSelectedFromFrame(PRInt32 aIndex)
// Dispatch event and such
void
PRBool
nsListControlFrame::UpdateSelection()
{
if (mIsAllFramesHere) {
@@ -1943,9 +1943,12 @@ nsListControlFrame::UpdateSelection()
}
// if it's a listbox, fire on change
else if (mIsAllContentHere) {
nsWeakFrame weakFrame(this);
FireOnChange();
return weakFrame.IsAlive();
}
}
return PR_TRUE;
}
void
@@ -3054,7 +3057,10 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent)
nsCaseInsensitiveStringComparator())) {
PRBool wasChanged = PerformSelection(index, isShift, isControl);
if (wasChanged) {
UpdateSelection(); // dispatch event, update combobox, etc.
// dispatch event, update combobox, etc.
if (!UpdateSelection()) {
return NS_OK;
}
}
break;
}
@@ -3088,7 +3094,10 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent)
wasChanged = PerformSelection(newIndex, isShift, isControl);
}
if (wasChanged) {
UpdateSelection(); // dispatch event, update combobox, etc.
// dispatch event, update combobox, etc.
if (!UpdateSelection()) {
return NS_OK;
}
}
#ifdef ACCESSIBILITY
if (charcode != ' ') {