diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 10fa61fb2e7b..eefbee76a4b3 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -7252,13 +7252,11 @@ nsGlobalWindow::FocusOuter(ErrorResult& aError) } return; } - if (nsCOMPtr child = do_GetInterface(mDocShell)) { - child->SendRequestFocus(canFocus); - return; - } + if (canFocus) { // if there is no parent, this must be a toplevel window, so raise the - // window if canFocus is true + // window if canFocus is true. If this is a child process, the raise + // window request will get forwarded to the parent by the puppet widget. aError = fm->SetActiveWindow(this); } } diff --git a/layout/forms/test/mochitest.ini b/layout/forms/test/mochitest.ini index 7b0558b3e74c..24feb0ef6324 100644 --- a/layout/forms/test/mochitest.ini +++ b/layout/forms/test/mochitest.ini @@ -32,7 +32,7 @@ skip-if = (toolkit == 'gonk' && debug) #debug-only failure [test_bug562447.html] [test_bug563642.html] [test_bug564115.html] -skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || toolkit == 'android' || e10s #TIMED_OUT # b2g-debug(times out on window.open and focus event) b2g-desktop(times out on window.open and focus event) +skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || toolkit == 'android' #TIMED_OUT # b2g-debug(times out on window.open and focus event) b2g-desktop(times out on window.open and focus event) [test_bug571352.html] skip-if = (os == 'mac' && os_version == '10.10') || buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # OS X 10.10 - bug 947690, b2g(shift-click multi-select not working?) b2g-debug(shift-click multi-select not working?) b2g-desktop(shift-click multi-select not working?) [test_bug572406.html] diff --git a/widget/PuppetWidget.cpp b/widget/PuppetWidget.cpp index 3236b2a74a6a..221d10de3334 100644 --- a/widget/PuppetWidget.cpp +++ b/widget/PuppetWidget.cpp @@ -257,8 +257,10 @@ PuppetWidget::ConfigureChildren(const nsTArray& aConfigurations) NS_IMETHODIMP PuppetWidget::SetFocus(bool aRaise) { - // XXX/cjones: someone who knows about event handling needs to - // decide how this should work. + if (aRaise && mTabChild) { + mTabChild->SendRequestFocus(true); + } + return NS_OK; }