Skip to content

Commit

Permalink
[IFC][Cleanup] Remove unused InlineDamage pieces
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=271528

Reviewed by Antti Koivisto.

* Source/WebCore/layout/formattingContexts/inline/invalidation/InlineDamage.h:
* Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp:
(WebCore::Layout::InlineInvalidation::restartForPagination):
(WebCore::Layout::InlineInvalidation::horizontalConstraintChanged): Deleted.
* Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.h:

Canonical link: https://commits.webkit.org/276610@main
  • Loading branch information
alanbaradlay committed Mar 24, 2024
1 parent fb829e0 commit 9122a31
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,7 @@ class InlineDamage {
enum class Type : uint8_t {
// Can't decide the type of damage. Let's nuke all the things.
Invalid,
// Content changed or some style property that drives soft wrap opportunities (e.g. going from white-space: pre to normal).
// This tells us to re-process the inline content and run line layout.
NeedsContentUpdateAndLineLayout,
// Same content but either the constraint or some style that may affect line breaking changed (e.g. font-size or containing block set new horizontal constraint).
NeedsLineLayout,
// Line breaking positions are the same, only height related style changed (e.g img's height changes).
NeedsVerticalAdjustment,
// Line breaking positions are the same, runs may show up at a different horizontal position (e.g. text-align changes).
NeedsHorizontalAdjustment
};
Type type() const { return m_damageType; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,6 @@ bool InlineInvalidation::inlineLevelBoxWillBeRemoved(const Box& layoutBox)
return invalidatedLine.has_value();
}

void InlineInvalidation::horizontalConstraintChanged()
{
m_inlineDamage.setDamageType(InlineDamage::Type::NeedsLineLayout);
}

void InlineInvalidation::restartForPagination(size_t lineIndex, LayoutUnit pageTopAdjustment)
{
auto leadingContentDisplayBoxOnDamagedLine = leadingContentDisplayForLineIndex(lineIndex, displayBoxes());
Expand All @@ -496,7 +491,7 @@ void InlineInvalidation::restartForPagination(size_t lineIndex, LayoutUnit pageT

auto invalidatedLine = InvalidatedLine { lineIndex, *inlineItemPositionForLeadingDisplayBox };

updateInlineDamage(InlineDamage::Type::NeedsLineLayout, InlineDamage::Reason::Pagination, invalidatedLine, ShouldApplyRangeLayout::Yes, pageTopAdjustment);
updateInlineDamage(InlineDamage::Type::NeedsContentUpdateAndLineLayout, InlineDamage::Reason::Pagination, invalidatedLine, ShouldApplyRangeLayout::Yes, pageTopAdjustment);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class InlineInvalidation {
bool inlineLevelBoxInserted(const Box&);
bool inlineLevelBoxWillBeRemoved(const Box&);

void horizontalConstraintChanged();

void restartForPagination(size_t lineIndex, LayoutUnit pageTopAdjustment);

private:
Expand Down

0 comments on commit 9122a31

Please sign in to comment.