Bug 1117586, [e10s] select dropdowns cannot be opened with the keyboard, r=roc

This commit is contained in:
Neil Deakin 2015-03-30 08:53:44 -04:00
parent 7f0cac73a3
commit ed3482df8a

View File

@ -1760,6 +1760,17 @@ nsListControlFrame::GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent,
return NS_ERROR_FAILURE;
}
static void
FireShowDropDownEvent(nsIContent* aContent)
{
if (XRE_GetProcessType() == GeckoProcessType_Content &&
Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
nsContentUtils::DispatchChromeEvent(aContent->OwnerDoc(), aContent,
NS_LITERAL_STRING("mozshowdropdown"), true,
false);
}
}
nsresult
nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
{
@ -1807,13 +1818,7 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
} else {
// NOTE: the combo box is responsible for dropping it down
if (mComboboxFrame) {
if (XRE_GetProcessType() == GeckoProcessType_Content &&
Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
nsContentUtils::DispatchChromeEvent(mContent->OwnerDoc(), mContent,
NS_LITERAL_STRING("mozshowdropdown"), true,
false);
return NS_OK;
}
FireShowDropDownEvent(mContent);
if (!IgnoreMouseEventForSelection(aMouseEvent)) {
return NS_OK;
@ -2054,6 +2059,7 @@ nsListControlFrame::DropDownToggleKey(nsIDOMEvent* aKeyEvent)
if (IsInDropDownMode() && !nsComboboxControlFrame::ToolkitHasNativePopup()) {
aKeyEvent->PreventDefault();
if (!mComboboxFrame->IsDroppedDown()) {
FireShowDropDownEvent(mContent);
mComboboxFrame->ShowDropDown(true);
} else {
nsWeakFrame weakFrame(this);