Bug 1253977 part 1 - Update focus state on combobox frame destruction/construction properly. r=tn

This commit is contained in:
Mats Palmgren 2016-03-08 23:03:26 +01:00
parent 0524303c83
commit dec5bab458

View File

@ -958,6 +958,10 @@ nsComboboxControlFrame::SetDropDown(nsIFrame* aDropDownFrame)
{
mDropdownFrame = aDropDownFrame;
mListControlFrame = do_QueryFrame(mDropdownFrame);
if (!sFocused && nsContentUtils::IsFocusedContent(GetContent())) {
sFocused = this;
nsListControlFrame::ComboboxFocusSet();
}
}
nsIFrame*
@ -1387,6 +1391,10 @@ nsComboboxControlFrame::CreateFrameFor(nsIContent* aContent)
void
nsComboboxControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
if (sFocused == this) {
sFocused = nullptr;
}
// Revoke any pending RedisplayTextEvent
mRedisplayTextEvent.Revoke();