commit 854dfaf9a5f55afaa2176a5d70e6ea0f8d8e56a6
parent 228a0bb65f54ebd8d592b1fed2c9a1771e70ff1a
Author: Ting-Yu Lin <tlin@mozilla.com>
Date: Mon, 8 Dec 2025 23:29:46 +0000
Bug 2004166 - Ensure a continuation is an abspos containing block in PushAbsoluteContainingBlock(). r=dholbert,layout-reviewers
Assume an ib-split `-moz-block-inside-inline-wrapper` is split by a column-span.
The wrapper **before** column-span might not be an absolute containing block if
it does not have any abspos children. In that case, `nsIFrame::Init()` won't
create an absolute containing block for the wrapper continuation **after** the
column-span.
This patch removes the assertions and properly sets up an absolute containing
block for the continuation when it needs one.
Differential Revision: https://phabricator.services.mozilla.com/D275275
Diffstat:
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
@@ -865,15 +865,9 @@ void nsFrameConstructorState::PushAbsoluteContainingBlock(
return mFixedList;
}();
- if (aNewAbsoluteContainingBlock) {
- if (!aNewAbsoluteContainingBlock->GetPrevContinuation()) {
- aNewAbsoluteContainingBlock->MarkAsAbsoluteContainingBlock();
- } else {
- MOZ_ASSERT(
- aNewAbsoluteContainingBlock->GetAbsoluteContainingBlock(),
- "nsIFrame::Init() should've constructed AbsoluteContainingBlock in "
- "this case, since the frame is a continuation!");
- }
+ if (aNewAbsoluteContainingBlock &&
+ !aNewAbsoluteContainingBlock->IsAbsoluteContainer()) {
+ aNewAbsoluteContainingBlock->MarkAsAbsoluteContainingBlock();
}
}
diff --git a/testing/web-platform/tests/css/css-multicol/crashtests/block-in-inline-with-abspos-after-spanner.html b/testing/web-platform/tests/css/css-multicol/crashtests/block-in-inline-with-abspos-after-spanner.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=2004166">
+
+<div style="columns:2">
+<span id="span">
+<div style="column-span:all"></div><div>
+<div style="position:absolute"></div>
+<script>
+span.style.position = "relative"
+</script>