Bug 1595199 - Make nsGfxScrollFrame propagate ReflowInput's mFlags.mIsBResizeForPercentages to its inner, to fix vertical resizing layout bugs. r=dholbert
authorL. David Baron <dbaron@dbaron.org>
Tue, 12 Nov 2019 07:37:40 +0000
changeset 501610 36c0bb2ed66176a311907c90b0d56254461c716d
parent 501609 0ff2c7b2c0fd975231a77777779ab7ce75db2019
child 501611 71e2a5b608a5a1cb02597993cdc26d8166edc082
push id100316
push userdbaron@mozilla.com
push dateTue, 12 Nov 2019 17:37:36 +0000
treeherderautoland@36c0bb2ed661 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1595199
milestone72.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 1595199 - Make nsGfxScrollFrame propagate ReflowInput's mFlags.mIsBResizeForPercentages to its inner, to fix vertical resizing layout bugs. r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D52439
layout/generic/nsGfxScrollFrame.cpp
layout/reftests/bugs/1595199-1-ref.html
layout/reftests/bugs/1595199-1.html
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -621,19 +621,23 @@ void nsHTMLScrollFrame::ReflowScrolledFr
                              Nothing(), ReflowInput::CALLER_WILL_INIT);
   const nsMargin physicalPadding = padding.GetPhysicalMargin(wm);
   kidReflowInput.Init(presContext, Nothing(), nullptr, &physicalPadding);
   kidReflowInput.mFlags.mAssumingHScrollbar = aAssumeHScroll;
   kidReflowInput.mFlags.mAssumingVScrollbar = aAssumeVScroll;
   kidReflowInput.SetComputedBSize(computedBSize);
   kidReflowInput.ComputedMinBSize() = computedMinBSize;
   kidReflowInput.ComputedMaxBSize() = computedMaxBSize;
-  if (aState->mReflowInput.IsBResizeForWM(kidReflowInput.GetWritingMode())) {
+  const WritingMode kidWM = kidReflowInput.GetWritingMode();
+  if (aState->mReflowInput.IsBResizeForWM(kidWM)) {
     kidReflowInput.SetBResize(true);
   }
+  if (aState->mReflowInput.IsBResizeForPercentagesForWM(kidWM)) {
+    kidReflowInput.mFlags.mIsBResizeForPercentages = true;
+  }
 
   // Temporarily set mHasHorizontalScrollbar/mHasVerticalScrollbar to
   // reflect our assumptions while we reflow the child.
   bool didHaveHorizontalScrollbar = mHelper.mHasHorizontalScrollbar;
   bool didHaveVerticalScrollbar = mHelper.mHasVerticalScrollbar;
   mHelper.mHasHorizontalScrollbar = aAssumeHScroll;
   mHelper.mHasVerticalScrollbar = aAssumeVScroll;
 
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1595199-1-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<meta charset=UTF-8>
+<title>Testcase reference, bug 1595199</title>
+<style>
+  #outer {
+    background: fuchsia;
+    height: 100px;
+  }
+
+  #inner {
+    background: blue;
+    height: 100px;
+    width: 50%;
+  }
+</style>
+
+<div id="outer">
+  <div id="inner">
+  </div>
+</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1595199-1.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<meta charset=UTF-8>
+<title>Testcase, bug 1595199</title>
+<style>
+  #outer {
+    background: red;
+    overflow: hidden;
+  }
+
+  #wrapper1 {
+    background: red;
+    height: 100%;
+  }
+
+  #wrapper2 {
+    background: fuchsia;
+    height: 100%;
+  }
+
+  #inner {
+    background: blue;
+    height: 100px;
+    width: 50%;
+  }
+</style>
+
+<div id="outer" style="height: 50px">
+  <div id="wrapper1">
+    <div id="wrapper2">
+      <div id="inner">
+      </div>
+    </div>
+  </div>
+</div>
+
+<script>
+  window.addEventListener("load", function load_handler() {
+    document.getElementById("wrapper2").offsetHeight; // flush layout
+    document.getElementById("outer").style.height = "auto";
+  });
+</script>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -2082,8 +2082,9 @@ pref(image.downscale-during-decode.enabl
 != 1563484.html 1563484-notref.html
 == 1563484.html 1563484-ref.html
 fuzzy-if(!webrender||!winWidget,251-255,464-1613) fuzzy-if(webrender&&winWidget,255-255,6-6) fuzzy-if(geckoview&&webrender,251-255,1392-1401) == 1562733-rotated-nastaliq-1.html 1562733-rotated-nastaliq-1-ref.html
 fuzzy-if(winWidget&&webrender,0-31,0-3) fuzzy-if(geckoview&&webrender,0-93,0-87) == 1562733-rotated-nastaliq-2.html 1562733-rotated-nastaliq-2-ref.html
 test-pref(plain_text.wrap_long_lines,false) != 1565129.txt 1565129.txt
 fuzzy(0-32,0-8) fuzzy-if(Android&&webrender,0-32,0-1458) == 1576553-1.html 1576553-1-ref.html
 fuzzy(0-1,0-10000) == 1577566-1.html 1577566-1-ref.html
 == 1579953-2.html 1579953-2-ref.html
+== 1595199-1.html 1595199-1-ref.html