Bug 1411765 - Part1:Convert an Incomplete reflow status to OverflowIncomplete also when our size is exactly the available size, not just less. r=mats draft
authorfantasai <fantasai.cvs@inkedblade.net>
Wed, 25 Oct 2017 14:21:19 -0700
changeset 694675 c7803976a9b42c6076acb233b68dcdbf3e8c93e8
parent 693772 4ea775c267be77107929d68799628a66027f3172
child 694676 34b89b430a38580f5b6aa8081fd78b26f4c3a115
push id88194
push userbmo:npancholi@mozilla.com
push dateWed, 08 Nov 2017 02:00:18 +0000
reviewersmats
bugs1411765
milestone58.0a1
Bug 1411765 - Part1:Convert an Incomplete reflow status to OverflowIncomplete also when our size is exactly the available size, not just less. r=mats MozReview-Commit-ID: JikD7p70pJy
layout/generic/nsBlockFrame.cpp
layout/reftests/w3c-css/submitted/break3/moz-block-fragmentation-001-ref.html
layout/reftests/w3c-css/submitted/break3/moz-block-fragmentation-001.html
layout/reftests/w3c-css/submitted/break3/reftest.list
layout/reftests/w3c-css/submitted/reftest.list
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -7486,20 +7486,19 @@ nsBlockFrame::ComputeFinalBSize(const Re
                "overflow container must not have computedBSizeLeftOver");
 
   aFinalSize.BSize(wm) =
     NSCoordSaturatingAdd(NSCoordSaturatingAdd(aBorderPadding.BStart(wm),
                                               computedBSizeLeftOver),
                          aBorderPadding.BEnd(wm));
 
   if (aStatus->IsIncomplete() &&
-      aFinalSize.BSize(wm) < aReflowInput.AvailableBSize()) {
-    // We fit in the available space - change status to OVERFLOW_INCOMPLETE.
-    // XXXmats why didn't Reflow report OVERFLOW_INCOMPLETE in the first place?
-    // XXXmats and why exclude the case when our size == AvailableBSize?
+      aFinalSize.BSize(wm) <= aReflowInput.AvailableBSize()) {
+    // We ran out of height on this page but we're incomplete.
+    // Set status to complete except for overflow.
     aStatus->SetOverflowIncomplete();
   }
 
   if (aStatus->IsComplete()) {
     if (computedBSizeLeftOver > 0 &&
         NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableBSize() &&
         aFinalSize.BSize(wm) > aReflowInput.AvailableBSize()) {
       if (ShouldAvoidBreakInside(aReflowInput)) {
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/break3/moz-block-fragmentation-001-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html class="reftest-paged">
+<title>
+  Reference
+</title>
+<style>
+  * {
+    box-sizing: border-box;
+    margin: 0;
+    padding: 0;
+    position: absolute;
+    left: 0; right: 0;
+    height: 100%;
+  }
+  div {
+    border: solid orange 10px;
+  }
+  div + div {
+    border: solid transparent 20px;
+  }
+  div > div {
+    border: solid gray 10px;
+    height: 300%;
+  }
+</style>
+<div></div>
+<div>
+  <div></div>
+</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/break3/moz-block-fragmentation-001.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html class="reftest-paged">
+<title>
+  Overflowing content does not affect whether a fixed-height box fits on a page,
+  but does get printed on the next page.
+</title>
+<meta name="flags" content="may print">
+<link rel="match" href="moz-block-fragmentation-001-ref.html">
+<link rel="help" href="https://www.w3.org/TR/css-break-3/#parallel-flows">
+<style>
+  * {
+    box-sizing: border-box;
+    margin: 0;
+    padding: 0;
+    height: 100%;
+  }
+  body {
+    border: solid orange 10px;
+    padding: 10px;
+  }
+  div {
+    border: solid gray 10px;
+    height: 300%;
+  }
+</style>
+<div></div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/break3/reftest.list
@@ -0,0 +1,1 @@
+== moz-block-fragmentation-001.html moz-block-fragmentation-001-ref.html
--- a/layout/reftests/w3c-css/submitted/reftest.list
+++ b/layout/reftests/w3c-css/submitted/reftest.list
@@ -11,16 +11,19 @@
 include align3/reftest.list
 
 # CSS2.1
 include css21/reftest.list
 
 # Backgrounds and Borders
 include background/reftest.list
 
+# Fragmentation
+include break3/reftest.list
+
 # Color Level 4
 include color4/reftest.list
 
 # Conditional Rules Level 3
 include conditional3/reftest.list
 
 # Containment
 include contain/reftest.list