Changeset 283493 in webkit


Ignore:
Timestamp:
Oct 4, 2021 6:16:56 AM (10 months ago)
Author:
Alan Bujtas
Message:

'overflow-wrap: anywhere' should be considered when calculating min-content intrinsic sizes.
https://bugs.webkit.org/show_bug.cgi?id=231152

Reviewed by Javier Fernandez.

Source/WebCore:

As opposed to overflow-wrap: 'break-word', 'anywhere' should be taken into account when computing the preferred width.

"An otherwise unbreakable sequence of characters may be broken at an arbitrary point...
Soft wrap opportunities introduced by anywhere are considered when calculating min-content intrinsic sizes."

https://drafts.csswg.org/css-text-3/#overflow-wrap-property

  • rendering/RenderText.cpp:

(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):

LayoutTests:

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r283492 r283493  
     12021-10-04  Alan Bujtas  <zalan@apple.com>
     2
     3        'overflow-wrap: anywhere' should be considered when calculating min-content intrinsic sizes.
     4        https://bugs.webkit.org/show_bug.cgi?id=231152
     5
     6        Reviewed by Javier Fernandez.
     7
     8        * TestExpectations: Progressions.
     9
    1102021-10-04  Ziran Sun  <zsun@igalia.com>
    211
  • trunk/LayoutTests/TestExpectations

    r283492 r283493  
    26432643# overflow-wrap:anywhere feature is not implemented in legacy line layout.
    26442644webkit.org/b/195345 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-anywhere-003.html [ ImageOnlyFailure ]
    2645 webkit.org/b/195345 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-min-content-size-001.html [ ImageOnlyFailure ]
    26462645webkit.org/b/195345 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-min-content-size-002.html [ ImageOnlyFailure ]
    2647 webkit.org/b/195345 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-min-content-size-003.html [ ImageOnlyFailure ]
    26482646webkit.org/b/195345 imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-006.html [ ImageOnlyFailure ]
    26492647
     
    43924390webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/line-breaking/line-breaking-016.html [ ImageOnlyFailure ]
    43934391webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/line-breaking/line-breaking-017.html [ ImageOnlyFailure ]
    4394 webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-min-content-size-005.html [ ImageOnlyFailure ]
    4395 webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-min-content-size-007.html [ ImageOnlyFailure ]
    43964392webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-normal-keep-all-001.html [ ImageOnlyFailure ]
    43974393webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-shaping-001.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r283489 r283493  
     12021-10-04  Alan Bujtas  <zalan@apple.com>
     2
     3        'overflow-wrap: anywhere' should be considered when calculating min-content intrinsic sizes.
     4        https://bugs.webkit.org/show_bug.cgi?id=231152
     5
     6        Reviewed by Javier Fernandez.
     7
     8        As opposed to overflow-wrap: 'break-word', 'anywhere' should be taken into account when computing the preferred width.
     9
     10        "An otherwise unbreakable sequence of characters may be broken at an arbitrary point...
     11        Soft wrap opportunities introduced by anywhere are considered when calculating min-content intrinsic sizes."
     12
     13        https://drafts.csswg.org/css-text-3/#overflow-wrap-property
     14
     15        * rendering/RenderText.cpp:
     16        (WebCore::RenderText::computePreferredLogicalWidths):
     17        (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):
     18
    1192021-10-04  Kimmo Kinnunen  <kkinnunen@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r283481 r283493  
    10151015    bool breakNBSP = style.autoWrap() && style.nbspMode() == NBSPMode::Space;
    10161016   
    1017     // Note the deliberate omission of word-wrap and overflow-wrap from this breakAll check. Those
    1018     // do not affect minimum preferred sizes. Note that break-word is a non-standard value for
     1017    bool breakAnywhere = style.lineBreak() == LineBreak::Anywhere && style.autoWrap();
     1018    // Note the deliberate omission of word-wrap/overflow-wrap's break-word value from this breakAll check.
     1019    // Those do not affect minimum preferred sizes. Note that break-word is a non-standard value for
    10191020    // word-break, but we support it as though it means break-all.
    1020     bool breakAnywhere = style.lineBreak() == LineBreak::Anywhere && style.autoWrap();
    1021     bool breakAll = (style.wordBreak() == WordBreak::BreakAll || style.wordBreak() == WordBreak::BreakWord) && style.autoWrap();
     1021    bool breakAll = (style.wordBreak() == WordBreak::BreakAll || style.wordBreak() == WordBreak::BreakWord || style.overflowWrap() == OverflowWrap::Anywhere) && style.autoWrap();
    10221022    bool keepAllWords = style.wordBreak() == WordBreak::KeepAll;
    10231023    bool canUseLineBreakShortcut = iteratorMode == LineBreakIteratorMode::Default;
Note: See TracChangeset for help on using the changeset viewer.