Bug 1652288 - Expand the RCD-RSF's ink overflow rect by the dynamic toolbar height in DescendIntoChild(). r=hiro
authorBotond Ballo <botond@mozilla.com>
Fri, 24 Jul 2020 18:20:20 +0000
changeset 542076 236c6d4f049c5c3bd509297c6a3a720cb8688181
parent 542075 992c574a2e33cb6ec228ddce47cc60171780e354
child 542077 12546a93754fc73b87d6c5775af1bcfba8220a02
push id37636
push usernbeleuzu@mozilla.com
push dateSat, 25 Jul 2020 09:40:10 +0000
treeherdermozilla-central@3ad2fc2915b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1652288
milestone80.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 1652288 - Expand the RCD-RSF's ink overflow rect by the dynamic toolbar height in DescendIntoChild(). r=hiro Differential Revision: https://phabricator.services.mozilla.com/D84780
layout/generic/nsIFrame.cpp
--- a/layout/generic/nsIFrame.cpp
+++ b/layout/generic/nsIFrame.cpp
@@ -3845,17 +3845,30 @@ static bool DescendIntoChild(nsDisplayLi
 
   // There are cases where the "ignore scroll frame" on the builder is not set
   // correctly, and so we additionally want to catch cases where the child is
   // a root scrollframe and we are ignoring scrolling on the viewport.
   if (aChild == aBuilder->GetPresShellIgnoreScrollFrame()) {
     return true;
   }
 
-  const nsRect overflow = aChild->InkOverflowRect();
+  nsRect overflow = aChild->InkOverflowRect();
+
+  // On mobile, there may be a dynamic toolbar. The root content document's
+  // root scroll frame's ink overflow rect does not include the toolbar
+  // height, but if the toolbar is hidden, we still want to be able to target
+  // content underneath the toolbar, so expand the overflow rect here to
+  // allow display list building to descend into the scroll frame.
+  if (aBuilder->IsForEventDelivery() &&
+      aChild == aChild->PresShell()->GetRootScrollFrame() &&
+      aChild->PresContext()->IsRootContentDocumentCrossProcess() &&
+      aChild->PresContext()->HasDynamicToolbar()) {
+    overflow.SizeTo(nsLayoutUtils::ExpandHeightForDynamicToolbar(
+        aChild->PresContext(), overflow.Size()));
+  }
 
   if (aDirty.Intersects(overflow)) {
     return true;
   }
 
   if (aChild->ForceDescendIntoIfVisible() && aVisible.Intersects(overflow)) {
     return true;
   }