Bug 1509044 - FrameLoader.clipSubdocument is unused. r=jwatt,smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 21 Nov 2018 20:06:15 +0000
changeset 504055 57931350897009b7853fa5f00d45ed660dfdf2eb
parent 504054 d683ee5ff0887a5eaa509ff4f9d32e631302bdd3
child 504056 cfc37d61722ccf847c4c9ba18cec76ed47564f11
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, smaug
bugs1509044
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1509044 - FrameLoader.clipSubdocument is unused. r=jwatt,smaug Plus it generally doesn't work for e10s, etc. etc. Differential Revision: https://phabricator.services.mozilla.com/D12547
dom/base/nsFrameLoader.cpp
dom/base/nsFrameLoader.h
dom/webidl/FrameLoader.webidl
layout/base/tests/chrome/chrome.ini
layout/base/tests/chrome/no_clip_iframe_subdoc.html
layout/base/tests/chrome/no_clip_iframe_window.xul
layout/base/tests/chrome/test_no_clip_iframe.xul
layout/generic/ViewportFrame.cpp
layout/generic/ViewportFrame.h
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGfxScrollFrame.h
layout/generic/nsIScrollableFrame.h
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsSubDocumentFrame.h
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -174,17 +174,16 @@ nsFrameLoader::nsFrameLoader(Element* aO
   , mNeedsAsyncDestroy(false)
   , mInSwap(false)
   , mInShow(false)
   , mHideCalled(false)
   , mNetworkCreated(aNetworkCreated)
   , mLoadingOriginalSrc(false)
   , mRemoteBrowserShown(false)
   , mRemoteFrame(false)
-  , mClipSubdocument(true)
   , mClampScrollPosition(true)
   , mObservingOwnerContent(false)
 {
   mRemoteFrame = ShouldUseRemoteProcess();
   MOZ_ASSERT(!mRemoteFrame || !aOpener,
              "Cannot pass aOpener for a remote frame!");
 }
 
@@ -2418,40 +2417,16 @@ nsFrameLoader::LazyHeight() const
   if (frame) {
     lazyHeight = frame->PresContext()->DevPixelsToIntCSSPixels(lazyHeight);
   }
 
   return lazyHeight;
 }
 
 void
-nsFrameLoader::SetClipSubdocument(bool aClip)
-{
-  mClipSubdocument = aClip;
-  nsIFrame* frame = GetPrimaryFrameOfOwningContent();
-  if (frame) {
-    frame->InvalidateFrame();
-    frame->PresShell()->
-      FrameNeedsReflow(frame, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
-    nsSubDocumentFrame* subdocFrame = do_QueryFrame(frame);
-    if (subdocFrame) {
-      nsIFrame* subdocRootFrame = subdocFrame->GetSubdocumentRootFrame();
-      if (subdocRootFrame) {
-        nsIFrame* subdocRootScrollFrame = subdocRootFrame->PresShell()->
-          GetRootScrollFrame();
-        if (subdocRootScrollFrame) {
-          frame->PresShell()->
-            FrameNeedsReflow(frame, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
-        }
-      }
-    }
-  }
-}
-
-void
 nsFrameLoader::SetClampScrollPosition(bool aClamp)
 {
   mClampScrollPosition = aClamp;
 
   // When turning clamping on, make sure the current position is clamped.
   if (aClamp) {
     nsIFrame* frame = GetPrimaryFrameOfOwningContent();
     nsSubDocumentFrame* subdocFrame = do_QueryFrame(frame);
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -194,19 +194,16 @@ public:
 
   uint32_t LazyHeight() const;
 
   uint64_t ChildID() const { return mChildID; }
 
   bool ClampScrollPosition() const { return mClampScrollPosition; }
   void SetClampScrollPosition(bool aClamp);
 
-  bool ClipSubdocument() const { return mClipSubdocument; }
-  void SetClipSubdocument(bool aClip);
-
   bool DepthTooGreat() const { return mDepthTooGreat; }
 
   bool IsDead() const { return mDestroyCalled; }
 
   /**
    * Is this a frame loader for a bona fide <iframe mozbrowser>?
    * <xul:browser> is not a mozbrowser, so this is false for that case.
    */
@@ -296,17 +293,16 @@ public:
    * returned.  (In-process <browser> behaves similarly, and this
    * behavior seems desirable.)
    */
   RenderFrame* GetCurrentRenderFrame() const;
 
   mozilla::dom::ChromeMessageSender* GetFrameMessageManager() { return mMessageManager; }
 
   mozilla::dom::Element* GetOwnerContent() { return mOwnerContent; }
-  bool ShouldClipSubdocument() { return mClipSubdocument; }
 
   bool ShouldClampScrollPosition() { return mClampScrollPosition; }
 
   mozilla::dom::ParentSHistory* GetParentSHistory() { return mParentSHistory; }
 
   /**
    * Tell this FrameLoader to use a particular remote browser.
    *
@@ -492,17 +488,16 @@ private:
   bool mNetworkCreated : 1;
 
   // True if a pending load corresponds to the original src (or srcdoc)
   // attribute of the frame element.
   bool mLoadingOriginalSrc : 1;
 
   bool mRemoteBrowserShown : 1;
   bool mRemoteFrame : 1;
-  bool mClipSubdocument : 1;
   bool mClampScrollPosition : 1;
   bool mObservingOwnerContent : 1;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsFrameLoader, NS_FRAMELOADER_IID)
 
 inline nsISupports*
 ToSupports(nsFrameLoader* aFrameLoader)
--- a/dom/webidl/FrameLoader.webidl
+++ b/dom/webidl/FrameLoader.webidl
@@ -128,23 +128,16 @@ interface FrameLoader {
   Promise<ImageBitmap> drawSnapshot(double x,
                                     double y,
                                     double w,
                                     double h,
                                     double scale,
                                     DOMString backgroundColor);
 
   /**
-   * If false, then the subdocument is not clipped to its CSS viewport, and the
-   * subdocument's viewport scrollbar(s) are not rendered.
-   * Defaults to true.
-   */
-  attribute boolean clipSubdocument;
-
-  /**
    * The element which owns this frame loader.
    *
    * For example, if this is a frame loader for an <iframe>, this attribute
    * returns the iframe element.
    */
   [Pure]
   readonly attribute Element? ownerElement;
 
--- a/layout/base/tests/chrome/chrome.ini
+++ b/layout/base/tests/chrome/chrome.ini
@@ -3,18 +3,16 @@ skip-if = os == 'android'
 support-files =
   animated.gif
   blue-32x32.png
   bug551434_childframe.html
   chrome_content_integration_window.xul
   default_background_window.xul
   dialog_with_positioning_window.xul
   file_bug458898.html
-  no_clip_iframe_subdoc.html
-  no_clip_iframe_window.xul
   printpreview_bug396024_helper.xul
   printpreview_bug482976_helper.xul
   printpreview_helper.xul
   printpreview_font_api.html
   printpreview_font_api_ref.html
   file_bug1018265.xul
 
 [test_bug396367-1.html]
@@ -41,17 +39,16 @@ support-files =
   chrome_over_plugin_window.xul
   chrome_over_plugin_window_frame.html
 [test_default_background.xul]
 [test_dialog_with_positioning.html]
 tags = openwindow
 [test_fixed_bg_scrolling_repaints.html]
 [test_leaf_layers_partition_browser_window.xul]
 skip-if = true # Bug 992311
-[test_no_clip_iframe.xul]
 [test_prerendered_transforms.html]
 [test_printpreview.xul]
 skip-if = (os == "linux" && bits == 32) || (verify && (os == 'win')) # Disabled on Linux32 for bug 1278957
 [test_printpreview_bug396024.xul]
 skip-if = (verify && (os == 'win'))
 [test_printpreview_bug482976.xul]
 skip-if = (verify && (os == 'win'))
 [test_scrolling_repaints.html]
deleted file mode 100644
--- a/layout/base/tests/chrome/no_clip_iframe_subdoc.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body style="margin:0; background:lime;">
-<div id="d" style="position:relative; top:-50px; width:150px; height:250px; background:yellow;"></div>
-<div id="p" style="margin-top:-50px; width:150px; height:50px;"></div>
-</body>
-</html>
deleted file mode 100644
--- a/layout/base/tests/chrome/no_clip_iframe_window.xul
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="runTests()">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
-  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"></script>
-
-  <div id="container" xmlns="http://www.w3.org/1999/xhtml" style="height:400px; overflow:auto; background:gray">
-    <div style="height:0">
-      <iframe type="content" id="f" src="no_clip_iframe_subdoc.html"
-       style="margin-top:50px; border:1px solid black; width:100px; height:100px;"/>
-    </div>
-    <div id="ref" style="background:gray;">
-      <div style="border:1px solid black; margin-top:50px; width:100px; height:100px;">
-        <div id="ref-d" style="background:lime; height:250px; width:150px;">
-          <div style="position:relative; top:-50px; width:150px; height:100%; background:yellow;"/>
-        </div>
-      </div>
-    </div>
-  </div>
-  <vbox flex="1"/>
-
-  <script type="application/javascript">
-  <![CDATA[
-    var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
-    for (var name of imports) {
-      window[name] = window.opener.wrappedJSObject[name];
-    }
-
-    SimpleTest.waitForExplicitFinish();
-
-    var frame = document.getElementById("f");
-    var fl = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
-    is(fl.clipSubdocument, true, "clipSubdocument should default to true");
-    fl.clipSubdocument = false;
-    is(fl.clipSubdocument, false, "clipSubdocument should have been set to false");
-
-    function runTests() {
-      var ref = document.getElementById("ref");
-      frame.contentWindow.scrollTo(0,0);
-
-      ref.style.visibility = "hidden";
-      var testCanvas = snapshotWindow(window);
-      ref.style.visibility = "";
-      var refCanvas = snapshotWindow(window);
-      var comparison = compareSnapshots(testCanvas, refCanvas, true);
-      ok(comparison[0], "Basic overflow drawing; got " + comparison[1] + ", expected " + comparison[2]);
-
-      document.getElementById("container").style.height = "200px";
-      ref.style.visibility = "hidden";
-      testCanvas = snapshotWindow(window);
-      ref.style.visibility = "";
-      refCanvas = snapshotWindow(window);
-      comparison = compareSnapshots(testCanvas, refCanvas, true);
-      ok(comparison[0], "Drawing with vertical scrollbar to show overflow area computation; got " +
-                        comparison[1] + ", expected " + comparison[2]);
-
-      frame.contentDocument.getElementById("d").style.height = "350px";
-      document.getElementById("ref-d").style.height = "350px";
-      ref.style.visibility = "hidden";
-      testCanvas = snapshotWindow(window);
-      ref.style.visibility = "";
-      refCanvas = snapshotWindow(window);
-      comparison = compareSnapshots(testCanvas, refCanvas, true);
-      ok(comparison[0], "testing dynamic overflow area change affecting scrollbar; got " +
-                        comparison[1] + ", expected " + comparison[2]);
-
-      // Now do invalidation tests
-      ref.style.visibility = "hidden";
-      document.getElementById("container").style.height = "400px";
-      waitForAllPaintsFlushed(function() {
-        frame.contentWindow.scrollTo(0,80);
-        waitForAllPaintsFlushed(function(x1, y1, x2, y2) {
-          ok(x1 <= 1 && x2 >= 151 && y1 <= 0 && y2 >= 400,
-             "Entire scrolled region is painted: " + x1 + "," + y1 + "," + x2 + "," + y2);
-          frame.contentDocument.getElementById("p").style.background = "cyan";
-          waitForAllPaintsFlushed(function(x1, y1, x2, y2) {
-            ok(x1 <= 1 && x2 >= 151 && y1 <= 271 && y2 >= 320,
-               "Entire updated region is painted: " + x1 + "," + y1 + "," + x2 + "," + y2);
-      
-            var tester = window.SimpleTest;
-            window.close();
-            tester.finish();
-          }, frame.contentDocument);
-        });
-      });
-    }
-  ]]>
-  </script>
-</window>
deleted file mode 100644
--- a/layout/base/tests/chrome/test_no_clip_iframe.xul
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
-                 type="text/css"?>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-  <!-- test results are displayed in the html:body -->
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  </body>
-
-  <!-- test code goes here -->
-  <script type="application/javascript">
-  <![CDATA[
-    SimpleTest.waitForExplicitFinish();
-    // Run the test in a separate window so that the test runs as a chrome
-    // window
-    window.open("no_clip_iframe_window.xul", "no_clip_iframe",
-                "chrome,width=200,height=400");
-  ]]>
-  </script>
-</window>
--- a/layout/generic/ViewportFrame.cpp
+++ b/layout/generic/ViewportFrame.cpp
@@ -369,67 +369,40 @@ ViewportFrame::Reflow(nsPresContext*    
       reflowInput.AvailableBSize() = maxSize.BSize(wm);
       // Not having border/padding simplifies things
       NS_ASSERTION(reflowInput.ComputedPhysicalBorderPadding() == nsMargin(0,0,0,0),
                    "Viewports can't have border/padding");
       reflowInput.SetComputedBSize(maxSize.BSize(wm));
     }
 
     nsRect rect = AdjustReflowInputAsContainingBlock(&reflowInput);
-    nsOverflowAreas* overflowAreas = &aDesiredSize.mOverflowAreas;
-    nsIScrollableFrame* rootScrollFrame =
-                    aPresContext->PresShell()->GetRootScrollFrameAsScrollable();
-    if (rootScrollFrame && !rootScrollFrame->IsIgnoringViewportClipping()) {
-      overflowAreas = nullptr;
-    }
     AbsPosReflowFlags flags =
       AbsPosReflowFlags::eCBWidthAndHeightChanged; // XXX could be optimized
-    GetAbsoluteContainingBlock()->Reflow(this, aPresContext, reflowInput, aStatus,
-                                         rect, flags, overflowAreas);
+    GetAbsoluteContainingBlock()->Reflow(this, aPresContext, reflowInput,
+                                         aStatus, rect, flags,
+                                         /* aOverflowAreas = */ nullptr);
   }
 
   if (mFrames.NotEmpty()) {
     ConsiderChildOverflow(aDesiredSize.mOverflowAreas, mFrames.FirstChild());
   }
 
   // If we were dirty then do a repaint
   if (GetStateBits() & NS_FRAME_IS_DIRTY) {
     InvalidateFrame();
   }
 
   // Clipping is handled by the document container (e.g., nsSubDocumentFrame),
   // so we don't need to change our overflow areas.
-  bool overflowChanged = FinishAndStoreOverflow(&aDesiredSize);
-  if (overflowChanged) {
-    // We may need to alert our container to get it to pick up the
-    // overflow change.
-    nsSubDocumentFrame* container = static_cast<nsSubDocumentFrame*>
-      (nsLayoutUtils::GetCrossDocParentFrame(this));
-    if (container && !container->ShouldClipSubdocument()) {
-      container->PresShell()->
-        FrameNeedsReflow(container, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
-    }
-  }
+  FinishAndStoreOverflow(&aDesiredSize);
 
   NS_FRAME_TRACE_REFLOW_OUT("ViewportFrame::Reflow", aStatus);
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
 }
 
-bool
-ViewportFrame::ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas)
-{
-  nsIScrollableFrame* rootScrollFrame =
-    PresShell()->GetRootScrollFrameAsScrollable();
-  if (rootScrollFrame && !rootScrollFrame->IsIgnoringViewportClipping()) {
-    return false;
-  }
-
-  return nsContainerFrame::ComputeCustomOverflow(aOverflowAreas);
-}
-
 void
 ViewportFrame::UpdateStyle(ServoRestyleState& aRestyleState)
 {
  nsAtom* pseudo = Style()->GetPseudo();
   RefPtr<ComputedStyle> newStyle =
     aRestyleState.StyleSet().ResolveInheritingAnonymousBoxStyle(pseudo, nullptr);
 
   // We're special because we have a null GetContent(), so don't call things
--- a/layout/generic/ViewportFrame.h
+++ b/layout/generic/ViewportFrame.h
@@ -60,17 +60,20 @@ public:
 
   virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
   virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
   virtual void Reflow(nsPresContext* aPresContext,
                       ReflowOutput& aDesiredSize,
                       const ReflowInput& aReflowInput,
                       nsReflowStatus& aStatus) override;
 
-  virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
+  bool ComputeCustomOverflow(nsOverflowAreas&) override
+  {
+    return false;
+  }
 
   /**
    * Adjust aReflowInput to account for scrollbars and pres shell
    * GetVisualViewportSizeSet and
    * GetContentDocumentFixedPositionMargins adjustments.
    * @return the rect to use as containing block rect
    */
   nsRect AdjustReflowInputAsContainingBlock(ReflowInput* aReflowInput) const;
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1158,20 +1158,16 @@ nsHTMLScrollFrame::Reflow(nsPresContext*
       mHelper.LayoutScrollbars(state.mBoxState, insideBorderArea,
                               oldScrollAreaBounds);
     } else {
       mHelper.mSkippedScrollbarLayout = true;
     }
   }
 
   aDesiredSize.SetOverflowAreasToDesiredBounds();
-  if (mHelper.IsIgnoringViewportClipping()) {
-    aDesiredSize.mOverflowAreas.UnionWith(
-      state.mContentsOverflowAreas + mHelper.mScrolledFrame->GetPosition());
-  }
 
   mHelper.UpdateSticky();
   FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);
 
   if (!InInitialReflow() && !mHelper.mHadNonInitialReflow) {
     mHelper.mHadNonInitialReflow = true;
   }
 
@@ -2524,25 +2520,16 @@ static void AdjustViews(nsIFrame* aFrame
     }
     nsFrameList::Enumerator childFrames(lists.CurrentList());
     for (; !childFrames.AtEnd(); childFrames.Next()) {
       AdjustViews(childFrames.get());
     }
   }
 }
 
-bool ScrollFrameHelper::IsIgnoringViewportClipping() const
-{
-  if (!mIsRoot)
-    return false;
-  nsSubDocumentFrame* subdocFrame = static_cast<nsSubDocumentFrame*>
-    (nsLayoutUtils::GetCrossDocParentFrame(mOuter->PresShell()->GetRootFrame()));
-  return subdocFrame && !subdocFrame->ShouldClipSubdocument();
-}
-
 void ScrollFrameHelper::MarkScrollbarsDirtyForReflow() const
 {
   nsIPresShell* presShell = mOuter->PresShell();
   if (mVScrollbarBox) {
     presShell->FrameNeedsReflow(mVScrollbarBox, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
   }
   if (mHScrollbarBox) {
     presShell->FrameNeedsReflow(mHScrollbarBox, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
@@ -3437,17 +3424,17 @@ ScrollFrameHelper::BuildDisplayList(nsDi
       mScrollPosForLayerPixelAlignment = nsPoint(-1,-1);
     }
   }
 
   // It's safe to get this value before the DecideScrollableLayer call below
   // because that call cannot create a displayport for root scroll frames,
   // and hence it cannot create an ignore scroll frame.
   bool ignoringThisScrollFrame =
-    aBuilder->GetIgnoreScrollFrame() == mOuter || IsIgnoringViewportClipping();
+    aBuilder->GetIgnoreScrollFrame() == mOuter;
 
   // Overflow clipping can never clip frames outside our subtree, so there
   // is no need to worry about whether we are a moving frame that might clip
   // non-moving frames.
   // Not all our descendants will be clipped by overflow clipping, but all
   // the ones that aren't clipped will be out of flow frames that have already
   // had dirty rects saved for them by their parent frames calling
   // MarkOutOfFlowChildrenForDisplayList, so it's safe to restrict our
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -404,18 +404,16 @@ public:
   void AdjustScrollbarRectForResizer(nsIFrame* aFrame, nsPresContext* aPresContext,
                                      nsRect& aRect, bool aHasResizer, bool aVertical);
   // returns true if a resizer should be visible
   bool HasResizer() { return mResizerBox && !mCollapsedResizer; }
   void LayoutScrollbars(nsBoxLayoutState& aState,
                         const nsRect& aContentArea,
                         const nsRect& aOldScrollArea);
 
-  bool IsIgnoringViewportClipping() const;
-
   void MarkScrollbarsDirtyForReflow() const;
 
   bool ShouldClampScrollPosition() const;
 
   bool IsAlwaysActive() const;
   void MarkRecentlyScrolled();
   void MarkNotRecentlyScrolled();
   nsExpirationState* GetExpirationState() { return &mActivityExpirationState; }
@@ -1011,19 +1009,16 @@ public:
     return mHelper.ComputeScrollMetadata(aLayerManager, aContainerReferenceFrame, aParameters, aClip);
   }
   virtual void ClipLayerToDisplayPort(Layer* aLayer,
                                       const mozilla::DisplayItemClip* aClip,
                                       const ContainerLayerParameters& aParameters) const override
   {
     mHelper.ClipLayerToDisplayPort(aLayer, aClip, aParameters);
   }
-  virtual bool IsIgnoringViewportClipping() const override {
-    return mHelper.IsIgnoringViewportClipping();
-  }
   virtual void MarkScrollbarsDirtyForReflow() const override {
     mHelper.MarkScrollbarsDirtyForReflow();
   }
   virtual bool UsesContainerScrolling() const override {
     return mHelper.UsesContainerScrolling();
   }
   virtual bool DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
                                      nsRect* aVisibleRect,
@@ -1470,19 +1465,16 @@ public:
   {
     return mHelper.ComputeScrollMetadata(aLayerManager, aContainerReferenceFrame, aParameters, aClip);
   }
   virtual void ClipLayerToDisplayPort(Layer* aLayer,
                                       const mozilla::DisplayItemClip* aClip,
                                       const ContainerLayerParameters& aParameters) const override {
     mHelper.ClipLayerToDisplayPort(aLayer, aClip, aParameters);
   }
-  virtual bool IsIgnoringViewportClipping() const override {
-    return mHelper.IsIgnoringViewportClipping();
-  }
   virtual void MarkScrollbarsDirtyForReflow() const override {
     mHelper.MarkScrollbarsDirtyForReflow();
   }
 
   // nsIStatefulFrame
   mozilla::UniquePtr<mozilla::PresState> SaveState() override {
     return mHelper.SaveState();
   }
--- a/layout/generic/nsIScrollableFrame.h
+++ b/layout/generic/nsIScrollableFrame.h
@@ -433,21 +433,16 @@ public:
   /**
    * Ensure's aLayer is clipped to the display port.
    */
   virtual void ClipLayerToDisplayPort(mozilla::layers::Layer* aLayer,
                                       const mozilla::DisplayItemClip* aClip,
                                       const ContainerLayerParameters& aParameters) const = 0;
 
   /**
-   * If this scroll frame is ignoring viewporting clipping
-   */
-  virtual bool IsIgnoringViewportClipping() const = 0;
-
-  /**
    * Mark the scrollbar frames for reflow.
    */
   virtual void MarkScrollbarsDirtyForReflow() const = 0;
 
   virtual void SetTransformingByAPZ(bool aTransforming) = 0;
   virtual bool IsTransformingByAPZ() const = 0;
 
   /**
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -443,19 +443,17 @@ nsSubDocumentFrame::BuildDisplayList(nsD
     aBuilder->EnterPresShell(subdocRootFrame, pointerEventsNone);
     aBuilder->IncrementPresShellPaintCount(presShell);
   } else {
     visible = aBuilder->GetVisibleRect();
     dirty = aBuilder->GetDirtyRect();
   }
 
   DisplayListClipState::AutoSaveRestore clipState(aBuilder);
-  if (ShouldClipSubdocument()) {
-    clipState.ClipContainingBlockDescendantsToContentBox(aBuilder, this);
-  }
+  clipState.ClipContainingBlockDescendantsToContentBox(aBuilder, this);
 
   nsIScrollableFrame *sf = presShell->GetRootScrollFrameAsScrollable();
   bool constructResolutionItem = subdocRootFrame &&
     (presShell->GetResolution() != 1.0);
   bool constructZoomItem = subdocRootFrame && parentAPD != subdocAPD;
   bool needsOwnLayer = false;
   if (constructResolutionItem ||
       constructZoomItem ||
@@ -847,22 +845,16 @@ nsSubDocumentFrame::Reflow(nsPresContext
                                            StylePosition());
 
     nsViewManager* vm = mInnerView->GetViewManager();
     vm->MoveViewTo(mInnerView, destRect.x, destRect.y);
     vm->ResizeView(mInnerView, nsRect(nsPoint(0, 0), destRect.Size()), true);
   }
 
   aDesiredSize.SetOverflowAreasToDesiredBounds();
-  if (!ShouldClipSubdocument()) {
-    nsIFrame* subdocRootFrame = GetSubdocumentRootFrame();
-    if (subdocRootFrame) {
-      aDesiredSize.mOverflowAreas.UnionWith(subdocRootFrame->GetOverflowAreas() + offset);
-    }
-  }
 
   FinishAndStoreOverflow(&aDesiredSize);
 
   if (!aPresContext->IsPaginated() && !mPostedReflowCallback) {
     PresShell()->PostReflowCallback(this);
     mPostedReflowCallback = true;
   }
 
--- a/layout/generic/nsSubDocumentFrame.h
+++ b/layout/generic/nsSubDocumentFrame.h
@@ -110,22 +110,16 @@ public:
   };
   nsIPresShell* GetSubdocumentPresShellForPainting(uint32_t aFlags);
   mozilla::ScreenIntSize GetSubdocumentSize();
 
   // nsIReflowCallback
   bool ReflowFinished() override;
   void ReflowCallbackCanceled() override;
 
-  bool ShouldClipSubdocument()
-  {
-    nsFrameLoader* frameLoader = FrameLoader();
-    return !frameLoader || frameLoader->ShouldClipSubdocument();
-  }
-
   bool ShouldClampScrollPosition()
   {
     nsFrameLoader* frameLoader = FrameLoader();
     return !frameLoader || frameLoader->ShouldClampScrollPosition();
   }
 
   /**
    * Return true if pointer event hit-testing should be allowed to target