Skip to content

Commit

Permalink
[IFC] Replaced box behaves like any other inline level box as far as …
Browse files Browse the repository at this point in the history
…Line building is concerned

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

Reviewed by Antti Koivisto.

// FIXME: Surely replaced boxes behave differently.
Nope. At least not in the process of line breaking.

* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::append):
(WebCore::Layout::Line::appendGenericInlineLevelBox):
(WebCore::Layout::Line::appendNonReplacedInlineLevelBox): Deleted.
(WebCore::Layout::Line::appendReplacedInlineLevelBox): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineLine.h:

Canonical link: https://commits.webkit.org/267400@main
  • Loading branch information
alanbaradlay committed Aug 29, 2023
1 parent 3e47e6d commit e912b88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
16 changes: 3 additions & 13 deletions Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,12 @@ void Line::append(const InlineItem& inlineItem, const RenderStyle& style, Inline
appendInlineBoxStart(inlineItem, style, logicalWidth);
else if (inlineItem.isInlineBoxEnd())
appendInlineBoxEnd(inlineItem, style, logicalWidth);
else if (inlineItem.layoutBox().isReplacedBox())
appendReplacedInlineLevelBox(inlineItem, style, logicalWidth);
else if (inlineItem.isBox())
appendNonReplacedInlineLevelBox(inlineItem, style, logicalWidth);
appendGenericInlineLevelBox(inlineItem, style, logicalWidth);
else if (inlineItem.isOpaque()) {
ASSERT(!logicalWidth);
appendOpaqueBox(inlineItem, style);
}
else
} else
ASSERT_NOT_REACHED();
m_hasNonDefaultBidiLevelRun = m_hasNonDefaultBidiLevelRun || inlineItem.bidiLevel() != UBIDI_DEFAULT_LTR;
}
Expand Down Expand Up @@ -633,7 +630,7 @@ void Line::appendTextFast(const InlineTextItem& inlineTextItem, const RenderStyl
m_trailingSoftHyphenWidth = style.fontCascade().width(TextRun { StringView { style.hyphenString() } });
}

void Line::appendNonReplacedInlineLevelBox(const InlineItem& inlineItem, const RenderStyle& style, InlineLayoutUnit marginBoxLogicalWidth)
void Line::appendGenericInlineLevelBox(const InlineItem& inlineItem, const RenderStyle& style, InlineLayoutUnit marginBoxLogicalWidth)
{
resetTrailingContent();
// Do not let negative margin make the content shorter than it already is.
Expand All @@ -651,13 +648,6 @@ void Line::appendNonReplacedInlineLevelBox(const InlineItem& inlineItem, const R
m_runs.append({ inlineItem, style, lastRunLogicalRight() + marginStart, marginBoxLogicalWidth - marginStart });
}

void Line::appendReplacedInlineLevelBox(const InlineItem& inlineItem, const RenderStyle& style, InlineLayoutUnit marginBoxLogicalWidth)
{
ASSERT(inlineItem.layoutBox().isReplacedBox());
// FIXME: Surely replaced boxes behave differently.
appendNonReplacedInlineLevelBox(inlineItem, style, marginBoxLogicalWidth);
}

void Line::appendLineBreak(const InlineItem& inlineItem, const RenderStyle& style)
{
m_trailingSoftHyphenWidth = { };
Expand Down
3 changes: 1 addition & 2 deletions Source/WebCore/layout/formattingContexts/inline/InlineLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ class Line {
InlineLayoutUnit lastRunLogicalRight() const { return m_runs.isEmpty() ? 0.0f : m_runs.last().logicalRight(); }

void appendTextContent(const InlineTextItem&, const RenderStyle&, InlineLayoutUnit logicalWidth);
void appendNonReplacedInlineLevelBox(const InlineItem&, const RenderStyle&, InlineLayoutUnit marginBoxLogicalWidth);
void appendReplacedInlineLevelBox(const InlineItem&, const RenderStyle&, InlineLayoutUnit marginBoxLogicalWidth);
void appendGenericInlineLevelBox(const InlineItem&, const RenderStyle&, InlineLayoutUnit marginBoxLogicalWidth);
void appendInlineBoxStart(const InlineItem&, const RenderStyle&, InlineLayoutUnit logicalWidth);
void appendInlineBoxEnd(const InlineItem&, const RenderStyle&, InlineLayoutUnit logicalWidth);
void appendLineBreak(const InlineItem&, const RenderStyle&);
Expand Down

0 comments on commit e912b88

Please sign in to comment.