зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1562821 - Propagate nsIWebProgress events to the <xul:browser> in responsive design mode r=Ehsan
The work from bug 1510569 that has ported the majority of the `nsIWebProgress` event handlers from `WebProgressChild`/`RemoteWebProgress` to `BrowserChild`/`BrowserParent` was not properly propogating the events in the responsive design mode case. The `BrowserParent` assumed that its frame element was an `nsIBrowser`, but in RDM it is an `<iframe mozbrowser>` which does not implement `nsIBrowser`. In the RDM case we now walk up the document in the `BrowserParent` tree to find the `<xul:browser>` and call the event handlers on that instead. Differential Revision: https://phabricator.services.mozilla.com/D38916 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
efab80cbeb
Коммит
2ce8272804
|
@ -2582,8 +2582,23 @@ bool BrowserParent::GetWebProgressListener(
|
||||||
MOZ_ASSERT(aOutManager);
|
MOZ_ASSERT(aOutManager);
|
||||||
MOZ_ASSERT(aOutListener);
|
MOZ_ASSERT(aOutListener);
|
||||||
|
|
||||||
nsCOMPtr<nsIBrowser> browser =
|
nsCOMPtr<nsIBrowser> browser;
|
||||||
mFrameElement ? mFrameElement->AsBrowser() : nullptr;
|
RefPtr<Element> currentElement = mFrameElement;
|
||||||
|
|
||||||
|
// In Responsive Design Mode, mFrameElement will be the <iframe mozbrowser>,
|
||||||
|
// but we want the <xul:browser> that it is embedded in.
|
||||||
|
while (currentElement) {
|
||||||
|
browser = currentElement->AsBrowser();
|
||||||
|
if (browser) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
BrowsingContext* browsingContext =
|
||||||
|
currentElement->OwnerDoc()->GetBrowsingContext();
|
||||||
|
currentElement =
|
||||||
|
browsingContext ? browsingContext->GetEmbedderElement() : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (!browser) {
|
if (!browser) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче