Changeset 254438 in webkit


Ignore:
Timestamp:
Jan 13, 2020 10:34:42 AM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC][Integration] Turn off trailing letter-space trimming for the LineBreaker content
https://bugs.webkit.org/show_bug.cgi?id=206181
<rdar://problem/58532931>

Reviewed by Antti Koivisto.

Source/WebCore:

Do not mark trailing letter-spacing as trimmable in the "continuous content" we feed in to line breaking.
This causes different and unexpected line breaking behavior as we don't try to fit the letter-spacing after the last character.

  • layout/inlineformatting/InlineLineBreaker.cpp:

(WebCore::Layout::ContinuousContent::ContinuousContent):

LayoutTests:

  • platform/ios/css1/text_properties/letter_spacing-expected.txt: Undo the rebaselining.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r254437 r254438  
     12020-01-13  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Integration] Turn off trailing letter-space trimming for the LineBreaker content
     4        https://bugs.webkit.org/show_bug.cgi?id=206181
     5        <rdar://problem/58532931>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * platform/ios/css1/text_properties/letter_spacing-expected.txt: Undo the rebaselining.
     10
    1112020-01-13  Wenson Hsieh  <wenson_hsieh@apple.com>
    212
  • trunk/LayoutTests/platform/ios/css1/text_properties/letter_spacing-expected.txt

    r254430 r254438  
    1 layer at (0,0) size 805x1439
     1layer at (0,0) size 800x1459
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x1439
    4   RenderBlock {HTML} at (0,0) size 800x1439
    5     RenderBody {BODY} at (8,8) size 784x1423 [bgcolor=#CCCCCC]
     3layer at (0,0) size 800x1459
     4  RenderBlock {HTML} at (0,0) size 800x1459
     5    RenderBody {BODY} at (8,8) size 784x1443 [bgcolor=#CCCCCC]
    66      RenderBlock {P} at (0,0) size 784x20
    77        RenderText {#text} at (0,0) size 363x19
     
    3939          text run at (0,60) width 180: "them."
    4040      RenderBlock {P} at (0,317) size 784x60
    41         RenderText {#text} at (0,0) size 796x59
     41        RenderText {#text} at (0,0) size 723x59
    4242          text run at (0,0) width 723: "This letters in this sentence"
    43           text run at (0,20) width 796: "should have extra space between"
    44           text run at (0,40) width 131: "them."
     43          text run at (0,20) width 588: "should have extra space"
     44          text run at (0,40) width 339: "between them."
    4545      RenderBlock {P} at (0,393) size 784x60
    46         RenderText {#text} at (0,0) size 796x59
     46        RenderText {#text} at (0,0) size 723x59
    4747          text run at (0,0) width 723: "This letters in this sentence"
    48           text run at (0,20) width 796: "should have extra space between"
    49           text run at (0,40) width 131: "them."
     48          text run at (0,20) width 588: "should have extra space"
     49          text run at (0,40) width 339: "between them."
    5050      RenderBlock {P} at (0,469) size 784x20
    5151        RenderText {#text} at (0,0) size 696x19
     
    5454        RenderText {#text} at (0,0) size 696x19
    5555          text run at (0,0) width 696: "This letters in this sentence should have extra space between them."
    56       RenderBlock {P} at (0,541) size 784x40
    57         RenderText {#text} at (0,0) size 797x39
    58           text run at (0,0) width 797: "This letters in this sentence should"
    59           text run at (0,20) width 684: "have extra space between them."
    60       RenderBlock {P} at (0,597) size 784x40
     56      RenderBlock {P} at (0,541) size 784x60
     57        RenderText {#text} at (0,0) size 706x59
     58          text run at (0,0) width 639: "This letters in this sentence"
     59          text run at (0,20) width 706: "should have extra space between"
     60          text run at (0,40) width 116: "them."
     61      RenderBlock {P} at (0,617) size 784x40
    6162        RenderText {#text} at (0,0) size 710x39
    6263          text run at (0,0) width 710: "This letters in this sentence should have extra space"
    6364          text run at (0,20) width 187: "between them."
    64       RenderBlock {P} at (0,653) size 784x40
     65      RenderBlock {P} at (0,673) size 784x40
    6566        RenderText {#text} at (0,0) size 763x39
    6667          text run at (0,0) width 763: "This letters in this sentence should have extra space between them,"
     
    7172        RenderText {#text} at (622,20) size 10x19
    7273          text run at (622,20) width 10: "."
    73       RenderBlock {P} at (0,709) size 784x40
     74      RenderBlock {P} at (0,729) size 784x40
    7475        RenderText {#text} at (0,0) size 746x39
    7576          text run at (0,0) width 746: "This letters in this sentence should have normal space between them, since percentage values are not allowed on this"
    7677          text run at (0,20) width 58: "property."
    77       RenderBlock {P} at (0,765) size 784x20
     78      RenderBlock {P} at (0,785) size 784x20
    7879        RenderText {#text} at (0,0) size 580x19
    7980          text run at (0,0) width 580: "This letters in this sentence should have reduced space between them, since negative values are allowed on this property."
    80       RenderTable {TABLE} at (0,801) size 784x622 [border: (1px outset #808080)]
     81      RenderTable {TABLE} at (0,821) size 784x622 [border: (1px outset #808080)]
    8182        RenderTableSection {TBODY} at (1,1) size 782x620
    8283          RenderTableRow {TR} at (0,0) size 782x28
  • trunk/Source/WebCore/ChangeLog

    r254431 r254438  
     12020-01-13  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Integration] Turn off trailing letter-space trimming for the LineBreaker content
     4        https://bugs.webkit.org/show_bug.cgi?id=206181
     5        <rdar://problem/58532931>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Do not mark trailing letter-spacing as trimmable in the "continuous content" we feed in to line breaking.
     10        This causes different and unexpected line breaking behavior as we don't try to fit the letter-spacing after the last character.
     11
     12        * layout/inlineformatting/InlineLineBreaker.cpp:
     13        (WebCore::Layout::ContinuousContent::ContinuousContent):
     14
    1152020-01-13  Antti Koivisto  <antti@apple.com>
    216
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp

    r254425 r254438  
    3333#include "InlineItem.h"
    3434#include "InlineTextItem.h"
     35#include "RuntimeEnabledFeatures.h"
    3536#include "TextUtil.h"
    3637
     
    361362                continue;
    362363            }
    363             if (auto collapsibleWidth = inlineTextItem.style().letterSpacing()) {
    364                 m_trailingCollapsibleContent.width += collapsibleWidth;
    365                 m_trailingCollapsibleContent.isFullyCollapsible = false;
     364            if (!RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()) {
     365                // A run with trailing letter spacing is partially collapsible.
     366                if (auto collapsibleWidth = inlineTextItem.style().letterSpacing()) {
     367                    m_trailingCollapsibleContent.width += collapsibleWidth;
     368                    m_trailingCollapsibleContent.isFullyCollapsible = false;
     369                }
    366370            }
    367371            // End of whitespace content.
Note: See TracChangeset for help on using the changeset viewer.