Bug 1652288 - Expand the RCD-RSF's ink overflow rect by the dynamic toolbar height in DescendIntoChild(). r=hiro
☠☠ backed out by de0b9fd13f53 ☠ ☠
authorBotond Ballo <botond@mozilla.com>
Fri, 24 Jul 2020 17:49:44 +0000
changeset 542085 564081c2d0cdd4a047bf7ac02d786c89313133e2
parent 542084 4a5520ecb0752ea1264c0c580964b995cda4e191
child 542086 1c0e0554d6d78ba26d4ddf5e7da254dcc670098c
push id122625
push userbballo@mozilla.com
push dateFri, 24 Jul 2020 17:50:28 +0000
treeherderautoland@564081c2d0cd [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->GetInkOverflowRect();
+
+  // 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;
   }