High firefox Logic Error 🔧 Commit mapped

Overview

High
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Impacthigh
DescriptionIncorrect boundary conditions in the Layout: Block and Inline component
ComponentLayout
Bug ClassLogic Error
Tracker2079255
Fix commit84cec52ebaf5 (firefox) +27/-0
CISA KEVNot listed
CreditedMozilla
Disclosed2026-10-27

Files Changed

  • layout/generic/nsBlockFrame.cpp
  • testing/web-platform/tests/css/css-multicol/crashtests/block-break-before.html
diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp
index b5b8860f7a9..fc85976a029 100644
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -4063,6 +4063,7 @@ bool nsBlockFrame::ReflowDirtyLines(BlockReflowState& aState) {
         RemoveFirstLine(nextInFlow->mLines, nextInFlow->mFrames, &pulledLine,
                         &pulledFrames);
         ClearLineCursors();
+        nextInFlow->ClearLineCursors();
       } else {
         // Grab an overflow line if there are any
         FrameLines* overflowLines = nextInFlow->GetOverflowLines();
@@ -4426,6 +4427,7 @@ nsIFrame* nsBlockFrame::PullFrameFrom(nsLineBox* aLine,
     MOZ_ASSERT(aLine == mLines.back());
     MOZ_ASSERT(aFromLine == aFromContainer->mLines.begin(),
                "should only pull from first line");
+    aFromContainer->ClearLineCursors();
     aFromContainer->mFrames.RemoveFrame(frame);
 
     // When pushing and pulling frames we need to check for whether any
diff --git a/testing/web-platform/tests/css/css-multicol/crashtests/block-break-before.html b/testing/web-platform/tests/css/css-multicol/crashtests/block-break-before.html
new file mode 100644
index 00000000000..bfb5f0894b8
--- /dev/null
+++ b/testing/web-platform/tests/css/css-multicol/crashtests/block-break-before.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<style>
+body { margin: 0; }
+#mc { column-width: 200px; column-gap: 0; width: 600px; font: 16px/20px monospace; }
+#G { display: flex; flex-direction: column; }
+#G > div { height: 20px; }
+#g2 { break-before: always; }
+</style>
+<div id="mc"></div>
+<script>
+let html = "";
+for (let i = 0; i < 10; i++) html += '<span id="a' + i + '">A' + i + '</span><br>';
+html += '<div id="G"><div id="g1">g1</div><div id="g2">g2</div><div id="g3">g3</div></div>';
+for (let i = 0; i < 8; i++) html += '<span id="u' + i + '">U' + i + '</span><br>';
+mc.innerHTML = html;
+onload = () => {
+  document.body.offsetHeight;
+  u0.scrollIntoView();
+  mc.style.width = "400px";
+  g3.style.breakBefore = "always";
+  document.body.offsetHeight;
+  u0.scrollIntoView();
+};
+</script>
Loading diff…

Regression Test / PoC

shipped with the fix
diff --git a/testing/web-platform/tests/css/css-multicol/crashtests/block-break-before.html b/testing/web-platform/tests/css/css-multicol/crashtests/block-break-before.html
new file mode 100644
index 00000000000..bfb5f0894b8
--- /dev/null
+++ b/testing/web-platform/tests/css/css-multicol/crashtests/block-break-before.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<style>
+body { margin: 0; }
+#mc { column-width: 200px; column-gap: 0; width: 600px; font: 16px/20px monospace; }
+#G { display: flex; flex-direction: column; }
+#G > div { height: 20px; }
+#g2 { break-before: always; }
+</style>
+<div id="mc"></div>
+<script>
+let html = "";
+for (let i = 0; i < 10; i++) html += '<span id="a' + i + '">A' + i + '</span><br>';
+html += '<div id="G"><div id="g1">g1</div><div id="g2">g2</div><div id="g3">g3</div></div>';
+for (let i = 0; i < 8; i++) html += '<span id="u' + i + '">U' + i + '</span><br>';
+mc.innerHTML = html;
+onload = () => {
+  document.body.offsetHeight;
+  u0.scrollIntoView();
+  mc.style.width = "400px";
+  g3.style.breakBefore = "always";
+  document.body.offsetHeight;
+  u0.scrollIntoView();
+};
+</script>
Loading diff…