Skip to content

Commit

Permalink
[IFC] ASSERTION FAILED inlineItem.layoutBox().isInlineLevelBox() in I…
Browse files Browse the repository at this point in the history
…nlineFormattingUtils::inlineItemWidth

https://bugs.webkit.org/show_bug.cgi?id=266387

Reviewed by Antti Koivisto.

Do not try to measure out-of-flow content while rebuilding the line due to "revert to last breaking position" type of content.

* LayoutTests/fast/inline/inline-content-with-out-of-flow-assert-expected.txt: Added.
* LayoutTests/fast/inline/inline-content-with-out-of-flow-assert.html: Added.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::rebuildLineWithInlineContent):

Canonical link: https://commits.webkit.org/272031@main
  • Loading branch information
alanbaradlay committed Dec 14, 2023
1 parent aeda796 commit 2dbd2d5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PASS if no crash or assert
This should not assert.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<style>
div {
font-family: Monospace;
font-size: 10px;
width: 100px;
}
</style>
PASS if no crash or assert
<div>This <div style="position: absolute;"></div> should <span style="white-space: pre">not assert.</span></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,8 @@ size_t LineBuilder::rebuildLineWithInlineContent(const InlineItemRange& layoutRa
continue;
}
auto& style = isFirstFormattedLine() ? inlineItem.firstLineStyle() : inlineItem.style();
m_line.append(inlineItem, style, formattingContext().formattingUtils().inlineItemWidth(inlineItem, m_line.contentLogicalRight(), isFirstFormattedLine()));
auto inlineItemWidth = !inlineItem.isOpaque() ? formattingContext().formattingUtils().inlineItemWidth(inlineItem, m_line.contentLogicalRight(), isFirstFormattedLine()) : InlineLayoutUnit();
m_line.append(inlineItem, style, inlineItemWidth);
++numberOfInlineItemsOnLine;
if (&inlineItem == &lastInlineItemToAdd)
break;
Expand Down

0 comments on commit 2dbd2d5

Please sign in to comment.