Skip to content

Commit

Permalink
Check text-wrap-mode in RenderStyle::autoWrap
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=263766
rdar://117570756

Reviewed by Alan Baradlay.

This helps towards removing `RenderStyle::whiteSpace()` and the WhiteSpace enum, which are superseded by the longhands equivalents (white-space-collapse / text-wrap-mode).

No behavior change.

* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::autoWrap const):
(WebCore::RenderStyle::autoWrap): Deleted.

Canonical link: https://commits.webkit.org/269853@main
  • Loading branch information
nt1m committed Oct 27, 2023
1 parent 9344ec4 commit 18c4cc1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion Source/WebCore/rendering/style/RenderStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ class RenderStyle {
int computeLineHeight(const Length&) const;

WhiteSpace whiteSpace() const;
static constexpr bool autoWrap(WhiteSpace);
inline bool autoWrap() const;
static constexpr bool preserveNewline(WhiteSpace);
inline bool preserveNewline() const;
Expand Down
8 changes: 1 addition & 7 deletions Source/WebCore/rendering/style/RenderStyleInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ inline const NamedGridLinesMap& RenderStyle::autoRepeatNamedGridColumnLines() co
inline const NamedGridLinesMap& RenderStyle::autoRepeatNamedGridRowLines() const { return m_nonInheritedData->rareData->grid->autoRepeatNamedGridRowLines(); }
inline const OrderedNamedGridLinesMap& RenderStyle::autoRepeatOrderedNamedGridColumnLines() const { return m_nonInheritedData->rareData->grid->autoRepeatOrderedNamedGridColumnLines(); }
inline const OrderedNamedGridLinesMap& RenderStyle::autoRepeatOrderedNamedGridRowLines() const { return m_nonInheritedData->rareData->grid->autoRepeatOrderedNamedGridRowLines(); }
inline bool RenderStyle::autoWrap() const { return autoWrap(whiteSpace()); }
inline bool RenderStyle::autoWrap() const { return textWrapMode() != TextWrapMode::NoWrap; }
inline BackfaceVisibility RenderStyle::backfaceVisibility() const { return static_cast<BackfaceVisibility>(m_nonInheritedData->rareData->backfaceVisibility); }
inline FillAttachment RenderStyle::backgroundAttachment() const { return backgroundLayers().attachment(); }
inline BlendMode RenderStyle::backgroundBlendMode() const { return backgroundLayers().blendMode(); }
Expand Down Expand Up @@ -800,12 +800,6 @@ inline bool RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles() const
return static_cast<unsigned>(PseudoId::PublicPseudoIdMask) & pseudoBits;
}

constexpr bool RenderStyle::autoWrap(WhiteSpace mode)
{
// Nowrap and pre don't automatically wrap.
return mode != WhiteSpace::NoWrap && mode != WhiteSpace::Pre;
}

inline bool RenderStyle::breakOnlyAfterWhiteSpace() const
{
return whiteSpace() == WhiteSpace::PreWrap || whiteSpace() == WhiteSpace::BreakSpaces || lineBreak() == LineBreak::AfterWhiteSpace;
Expand Down

0 comments on commit 18c4cc1

Please sign in to comment.