⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285933 in webkit


Ignore:
Timestamp:
Nov 17, 2021, 9:50:26 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Incorrect use of BreakWord with preferred width computation (it's a valid value for both WordBreak and OverflowWrap)
https://bugs.webkit.org/show_bug.cgi?id=233258

Reviewed by Antti Koivisto.

This was caught by fast/text/word-break.html (note that this codepath is not yet enabled).

  • layout/formattingContexts/inline/InlineContentBreaker.cpp:

(WebCore::Layout::InlineContentBreaker::wordBreakBehavior const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r285932 r285933  
     12021-11-17  Alan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Incorrect use of BreakWord with preferred width computation (it's a valid value for both WordBreak and OverflowWrap)
     4        https://bugs.webkit.org/show_bug.cgi?id=233258
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This was caught by fast/text/word-break.html (note that this codepath is not yet enabled).
     9
     10        * layout/formattingContexts/inline/InlineContentBreaker.cpp:
     11        (WebCore::Layout::InlineContentBreaker::wordBreakBehavior const):
     12
    1132021-11-17  Andreu Botella  <andreu@andreubotella.com>
    214
  • trunk/Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp

    r285930 r285933  
    653653    };
    654654
    655     // Soft wrap opportunities introduced by break-word are not considered when calculating min-content intrinsic sizes.
    656     auto breakWordIsApplicable = !isInIntrinsicWidthMode();
    657655    // For compatibility with legacy content, the word-break property also supports a deprecated break-word keyword.
    658656    // When specified, this has the same effect as word-break: normal and overflow-wrap: anywhere, regardless of the actual value of the overflow-wrap property.
    659     if ((breakWordIsApplicable && style.wordBreak() == WordBreak::BreakWord) && !hasWrapOpportunityAtPreviousPosition)
     657    if (style.wordBreak() == WordBreak::BreakWord && !hasWrapOpportunityAtPreviousPosition)
    660658        return includeHyphenationIfAllowed(WordBreakRule::AtArbitraryPosition);
    661659    // OverflowWrap::BreakWord/Anywhere An otherwise unbreakable sequence of characters may be broken at an arbitrary point if there are no otherwise-acceptable break points in the line.
    662660    // Note that this applies to content where CSS properties (e.g. WordBreak::KeepAll) make it unbreakable.
    663     if (((breakWordIsApplicable && style.overflowWrap() == OverflowWrap::BreakWord) || style.overflowWrap() == OverflowWrap::Anywhere) && !hasWrapOpportunityAtPreviousPosition)
     661    // Soft wrap opportunities introduced by overflow-wrap/word-wrap: break-word are not considered when calculating min-content intrinsic sizes.
     662    auto overflowWrapBreakWordIsApplicable = !isInIntrinsicWidthMode();
     663    if (((overflowWrapBreakWordIsApplicable && style.overflowWrap() == OverflowWrap::BreakWord) || style.overflowWrap() == OverflowWrap::Anywhere) && !hasWrapOpportunityAtPreviousPosition)
    664664        return includeHyphenationIfAllowed(WordBreakRule::AtArbitraryPosition);
    665665    // Breaking is forbidden within “words”.
Note: See TracChangeset for help on using the changeset viewer.