Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D59630
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "mozilla/dom/HTMLIFrameElement.h"
|
||||
#include "mozilla/dom/XULFrameElement.h"
|
||||
#include "mozilla/dom/BrowserBridgeChild.h"
|
||||
#include "mozilla/dom/WindowProxyHolder.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
@@ -291,10 +292,16 @@ nsresult nsGenericHTMLFrameElement::AfterSetAttr(
|
||||
if (aNameSpaceID == kNameSpaceID_None) {
|
||||
if (aName == nsGkAtoms::scrolling) {
|
||||
if (mFrameLoader) {
|
||||
// FIXME(bug 1588791): This should work for fission iframes.
|
||||
ScrollbarPreference pref = MapScrollingAttribute(aValue);
|
||||
if (nsIDocShell* docshell = mFrameLoader->GetExistingDocShell()) {
|
||||
nsDocShell::Cast(docshell)->SetScrollbarPreference(
|
||||
MapScrollingAttribute(aValue));
|
||||
nsDocShell::Cast(docshell)->SetScrollbarPreference(pref);
|
||||
} else if (auto* child = mFrameLoader->GetBrowserBridgeChild()) {
|
||||
// NOTE(emilio): We intentionally don't deal with the
|
||||
// GetBrowserParent() case, and only deal with the fission iframe
|
||||
// case. We could make it work, but it's a bit of boilerplate for
|
||||
// something that we don't use, and we'd need to think how it
|
||||
// interacts with the scrollbar window flags...
|
||||
child->SendScrollbarPreferenceChanged(pref);
|
||||
}
|
||||
}
|
||||
} else if (aName == nsGkAtoms::mozbrowser) {
|
||||
|
||||
Reference in New Issue
Block a user