Changeset 254421 in webkit


Ignore:
Timestamp:
Jan 12, 2020 7:40:46 PM (4 years ago)
Author:
Alan Bujtas
Message:

Text-indent with percentage value should resolve against the available width
https://bugs.webkit.org/show_bug.cgi?id=206155
<rdar://problem/58514882>

Reviewed by Antti Koivisto.

Source/WebCore:

https://www.w3.org/TR/css-text-3/#text-indent-property
"<percentage> Gives the amount of the indent as a percentage of the block container’s own logical width"

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::textIndentOffset const):

LayoutTests:

  • platform/mac/css1/text_properties/text_indent-expected.txt:
  • platform/mac/css2.1/t1601-c547-indent-01-d-expected.txt:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r254415 r254421  
     12020-01-12  Zalan Bujtas  <zalan@apple.com>
     2
     3        Text-indent with percentage value should resolve against the available width
     4        https://bugs.webkit.org/show_bug.cgi?id=206155
     5        <rdar://problem/58514882>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * platform/mac/css1/text_properties/text_indent-expected.txt:
     10        * platform/mac/css2.1/t1601-c547-indent-01-d-expected.txt:
     11
    1122020-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
    213
  • trunk/LayoutTests/platform/ios/css1/text_properties/text_indent-expected.txt

    r254044 r254421  
    7373          text run at (200,40) width 149: " which may be present."
    7474      RenderBlock {BLOCKQUOTE} at (40,661) size 704x60 [bgcolor=#00FFFF]
    75         RenderText {#text} at (392,0) size 651x59
    76           text run at (392,0) width 228: "In the first half of the test page, this"
    77           text run at (0,20) width 651: "BLOCKQUOTE element should have a text indent equal to 50% of the BODY element's width, since"
    78           text run at (0,40) width 512: "BLOCKQUOTE is a child of BODY; in the second half, it is a child of TABLE."
     75        RenderText {#text} at (352,0) size 693x59
     76          text run at (352,0) width 341: "In the first half of the test page, this BLOCKQUOTE"
     77          text run at (0,20) width 676: "element should have a text indent equal to 50% of the BODY element's width, since BLOCKQUOTE is a"
     78          text run at (0,40) width 374: "child of BODY; in the second half, it is a child of TABLE."
    7979      RenderTable {TABLE} at (0,737) size 784x554 [border: (1px outset #808080)]
    8080        RenderTableSection {TBODY} at (1,1) size 782x552
     
    131131                  text run at (200,40) width 149: " which may be present."
    132132              RenderBlock {BLOCKQUOTE} at (44,444) size 682x60 [bgcolor=#00FFFF]
    133                 RenderText {#text} at (381,0) size 651x59
    134                   text run at (381,0) width 228: "In the first half of the test page, this"
    135                   text run at (0,20) width 651: "BLOCKQUOTE element should have a text indent equal to 50% of the BODY element's width, since"
    136                   text run at (0,40) width 512: "BLOCKQUOTE is a child of BODY; in the second half, it is a child of TABLE."
     133                RenderText {#text} at (341,0) size 682x59
     134                  text run at (341,0) width 341: "In the first half of the test page, this BLOCKQUOTE"
     135                  text run at (0,20) width 676: "element should have a text indent equal to 50% of the BODY element's width, since BLOCKQUOTE is a"
     136                  text run at (0,40) width 374: "child of BODY; in the second half, it is a child of TABLE."
  • trunk/LayoutTests/platform/ios/css2.1/t1601-c547-indent-01-d-expected.txt

    r174491 r254421  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x256
    4   RenderBlock {HTML} at (0,0) size 800x256
    5     RenderBody {BODY} at (8,16) size 784x232
     3layer at (0,0) size 800x236
     4  RenderBlock {HTML} at (0,0) size 800x236
     5    RenderBody {BODY} at (8,16) size 784x212
    66      RenderBlock {P} at (0,0) size 784x40 [bgcolor=#00FFFF]
    77        RenderText {#text} at (392,0) size 759x39
     
    2525        RenderText {#text} at (115,60) size 101x19
    2626          text run at (115,60) width 101: " of the window."
    27       RenderBlock {DIV} at (0,152) size 196x80 [bgcolor=#00FFFF]
    28         RenderText {#text} at (392,0) size 404x79
    29           text run at (392,0) width 12: "X"
    30           text run at (0,20) width 172: "The X on the previous line"
    31           text run at (0,40) width 188: "should be centered across the"
    32           text run at (0,60) width 55: "window."
     27      RenderBlock {DIV} at (0,152) size 196x60 [bgcolor=#00FFFF]
     28        RenderText {#text} at (98,0) size 181x59
     29          text run at (98,0) width 76: "X The X on"
     30          text run at (0,20) width 173: "the previous line should be"
     31          text run at (0,40) width 181: "centered across the window."
  • trunk/LayoutTests/platform/mac/css1/text_properties/text_indent-expected.txt

    r254044 r254421  
    7373          text run at (200,36) width 149: " which may be present."
    7474      RenderBlock {BLOCKQUOTE} at (40,642) size 689x54 [bgcolor=#00FFFF]
    75         RenderText {#text} at (384,0) size 651x54
    76           text run at (384,0) width 228: "In the first half of the test page, this"
    77           text run at (0,18) width 651: "BLOCKQUOTE element should have a text indent equal to 50% of the BODY element's width, since"
    78           text run at (0,36) width 512: "BLOCKQUOTE is a child of BODY; in the second half, it is a child of TABLE."
     75        RenderText {#text} at (344,0) size 684x54
     76          text run at (344,0) width 340: "In the first half of the test page, this BLOCKQUOTE"
     77          text run at (0,18) width 676: "element should have a text indent equal to 50% of the BODY element's width, since BLOCKQUOTE is a"
     78          text run at (0,36) width 374: "child of BODY; in the second half, it is a child of TABLE."
    7979      RenderTable {TABLE} at (0,712) size 769x518 [border: (1px outset #808080)]
    8080        RenderTableSection {TBODY} at (1,1) size 767x516
     
    131131                  text run at (200,36) width 149: " which may be present."
    132132              RenderBlock {BLOCKQUOTE} at (44,416) size 667x54 [bgcolor=#00FFFF]
    133                 RenderText {#text} at (373,0) size 651x54
    134                   text run at (373,0) width 228: "In the first half of the test page, this"
     133                RenderText {#text} at (333,0) size 651x54
     134                  text run at (333,0) width 228: "In the first half of the test page, this"
    135135                  text run at (0,18) width 651: "BLOCKQUOTE element should have a text indent equal to 50% of the BODY element's width, since"
    136136                  text run at (0,36) width 512: "BLOCKQUOTE is a child of BODY; in the second half, it is a child of TABLE."
  • trunk/LayoutTests/platform/mac/css2.1/t1601-c547-indent-01-d-expected.txt

    r177774 r254421  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x236
    4   RenderBlock {HTML} at (0,0) size 800x236
    5     RenderBody {BODY} at (8,16) size 784x212
     3layer at (0,0) size 800x218
     4  RenderBlock {HTML} at (0,0) size 800x218
     5    RenderBody {BODY} at (8,16) size 784x194
    66      RenderBlock {P} at (0,0) size 784x36 [bgcolor=#00FFFF]
    77        RenderText {#text} at (392,0) size 758x36
     
    2525        RenderText {#text} at (115,54) size 101x18
    2626          text run at (115,54) width 101: " of the window."
    27       RenderBlock {DIV} at (0,140) size 196x72 [bgcolor=#00FFFF]
    28         RenderText {#text} at (392,0) size 404x72
    29           text run at (392,0) width 12: "X"
    30           text run at (0,18) width 172: "The X on the previous line"
    31           text run at (0,36) width 188: "should be centered across the"
    32           text run at (0,54) width 55: "window."
     27      RenderBlock {DIV} at (0,140) size 196x54 [bgcolor=#00FFFF]
     28        RenderText {#text} at (98,0) size 181x54
     29          text run at (98,0) width 76: "X The X on"
     30          text run at (0,18) width 173: "the previous line should be"
     31          text run at (0,36) width 181: "centered across the window."
  • trunk/Source/WebCore/ChangeLog

    r254416 r254421  
     12020-01-12  Zalan Bujtas  <zalan@apple.com>
     2
     3        Text-indent with percentage value should resolve against the available width
     4        https://bugs.webkit.org/show_bug.cgi?id=206155
     5        <rdar://problem/58514882>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        https://www.w3.org/TR/css-text-3/#text-indent-property
     10        "<percentage> Gives the amount of the indent as a percentage of the block container’s own logical width"
     11
     12        * rendering/RenderBlock.cpp:
     13        (WebCore::RenderBlock::textIndentOffset const):
     14
    1152020-01-12  Yusuke Suzuki  <ysuzuki@apple.com>
    216
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r254087 r254421  
    18691869    LayoutUnit cw;
    18701870    if (style().textIndent().isPercentOrCalculated())
    1871         cw = containingBlock()->availableLogicalWidth();
     1871        cw = availableLogicalWidth();
    18721872    return minimumValueForLength(style().textIndent(), cw);
    18731873}
Note: See TracChangeset for help on using the changeset viewer.