diff --git a/gfx/layers/apz/src/FocusTarget.cpp b/gfx/layers/apz/src/FocusTarget.cpp index 665750a68483..f9fd7ced0ba3 100644 --- a/gfx/layers/apz/src/FocusTarget.cpp +++ b/gfx/layers/apz/src/FocusTarget.cpp @@ -6,6 +6,7 @@ #include "mozilla/layers/FocusTarget.h" +#include "mozilla/dom/BrowserBridgeChild.h" // for BrowserBridgeChild #include "mozilla/dom/EventTarget.h" // for EventTarget #include "mozilla/dom/TabParent.h" // for TabParent #include "mozilla/EventDispatcher.h" // for EventDispatcher @@ -179,6 +180,17 @@ FocusTarget::FocusTarget(nsIPresShell* aRootPresShell, return; } + // Check if the key event target is a remote browser + if (BrowserBridgeChild* bbc = BrowserBridgeChild::GetFrom(keyEventTarget)) { + FT_LOG("Creating oopif reflayer target with seq=%" PRIu64 + ", kl=%d, lt=%" PRIu64 "\n", + aFocusSequenceNumber, mFocusHasKeyEventListeners, + bbc->GetLayersId()); + + mData = AsVariant(bbc->GetLayersId()); + return; + } + // The content to scroll is either the focused element or the focus node of // the selection. It's difficult to determine if an element is an interactive // element requiring async keyboard scrolling to be disabled. So we only