Diff
Modified: trunk/LayoutTests/ChangeLog (254420 => 254421)
--- trunk/LayoutTests/ChangeLog 2020-01-13 03:12:13 UTC (rev 254420)
+++ trunk/LayoutTests/ChangeLog 2020-01-13 03:40:46 UTC (rev 254421)
@@ -1,3 +1,14 @@
+2020-01-12 Zalan Bujtas <[email protected]>
+
+ 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.
+
+ * platform/mac/css1/text_properties/text_indent-expected.txt:
+ * platform/mac/css2.1/t1601-c547-indent-01-d-expected.txt:
+
2020-01-12 Myles C. Maxfield <[email protected]>
REGRESSION(r185816): In the Hong Kong locale, navigator.language reports it's in the Taiwan locale
Modified: trunk/LayoutTests/platform/ios/css1/text_properties/text_indent-expected.txt (254420 => 254421)
--- trunk/LayoutTests/platform/ios/css1/text_properties/text_indent-expected.txt 2020-01-13 03:12:13 UTC (rev 254420)
+++ trunk/LayoutTests/platform/ios/css1/text_properties/text_indent-expected.txt 2020-01-13 03:40:46 UTC (rev 254421)
@@ -72,10 +72,10 @@
RenderText {#text} at (200,40) size 149x19
text run at (200,40) width 149: " which may be present."
RenderBlock {BLOCKQUOTE} at (40,661) size 704x60 [bgcolor=#00FFFF]
- RenderText {#text} at (392,0) size 651x59
- text run at (392,0) width 228: "In the first half of the test page, this"
- text run at (0,20) width 651: "BLOCKQUOTE element should have a text indent equal to 50% of the BODY element's width, since"
- text run at (0,40) width 512: "BLOCKQUOTE is a child of BODY; in the second half, it is a child of TABLE."
+ RenderText {#text} at (352,0) size 693x59
+ text run at (352,0) width 341: "In the first half of the test page, this BLOCKQUOTE"
+ 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"
+ text run at (0,40) width 374: "child of BODY; in the second half, it is a child of TABLE."
RenderTable {TABLE} at (0,737) size 784x554 [border: (1px outset #808080)]
RenderTableSection {TBODY} at (1,1) size 782x552
RenderTableRow {TR} at (0,0) size 782x28
@@ -130,7 +130,7 @@
RenderText {#text} at (200,40) size 149x19
text run at (200,40) width 149: " which may be present."
RenderBlock {BLOCKQUOTE} at (44,444) size 682x60 [bgcolor=#00FFFF]
- RenderText {#text} at (381,0) size 651x59
- text run at (381,0) width 228: "In the first half of the test page, this"
- text run at (0,20) width 651: "BLOCKQUOTE element should have a text indent equal to 50% of the BODY element's width, since"
- text run at (0,40) width 512: "BLOCKQUOTE is a child of BODY; in the second half, it is a child of TABLE."
+ RenderText {#text} at (341,0) size 682x59
+ text run at (341,0) width 341: "In the first half of the test page, this BLOCKQUOTE"
+ 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"
+ text run at (0,40) width 374: "child of BODY; in the second half, it is a child of TABLE."
Modified: trunk/LayoutTests/platform/ios/css2.1/t1601-c547-indent-01-d-expected.txt (254420 => 254421)
--- trunk/LayoutTests/platform/ios/css2.1/t1601-c547-indent-01-d-expected.txt 2020-01-13 03:12:13 UTC (rev 254420)
+++ trunk/LayoutTests/platform/ios/css2.1/t1601-c547-indent-01-d-expected.txt 2020-01-13 03:40:46 UTC (rev 254421)
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
-layer at (0,0) size 800x256
- RenderBlock {HTML} at (0,0) size 800x256
- RenderBody {BODY} at (8,16) size 784x232
+layer at (0,0) size 800x236
+ RenderBlock {HTML} at (0,0) size 800x236
+ RenderBody {BODY} at (8,16) size 784x212
RenderBlock {P} at (0,0) size 784x40 [bgcolor=#00FFFF]
RenderText {#text} at (392,0) size 759x39
text run at (392,0) width 367: "The first line of this sentence should be indented halfway"
@@ -24,9 +24,8 @@
text run at (0,60) width 116: "aligned on the left"
RenderText {#text} at (115,60) size 101x19
text run at (115,60) width 101: " of the window."
- RenderBlock {DIV} at (0,152) size 196x80 [bgcolor=#00FFFF]
- RenderText {#text} at (392,0) size 404x79
- text run at (392,0) width 12: "X"
- text run at (0,20) width 172: "The X on the previous line"
- text run at (0,40) width 188: "should be centered across the"
- text run at (0,60) width 55: "window."
+ RenderBlock {DIV} at (0,152) size 196x60 [bgcolor=#00FFFF]
+ RenderText {#text} at (98,0) size 181x59
+ text run at (98,0) width 76: "X The X on"
+ text run at (0,20) width 173: "the previous line should be"
+ text run at (0,40) width 181: "centered across the window."
Modified: trunk/LayoutTests/platform/mac/css1/text_properties/text_indent-expected.txt (254420 => 254421)
--- trunk/LayoutTests/platform/mac/css1/text_properties/text_indent-expected.txt 2020-01-13 03:12:13 UTC (rev 254420)
+++ trunk/LayoutTests/platform/mac/css1/text_properties/text_indent-expected.txt 2020-01-13 03:40:46 UTC (rev 254421)
@@ -72,10 +72,10 @@
RenderText {#text} at (200,36) size 149x18
text run at (200,36) width 149: " which may be present."
RenderBlock {BLOCKQUOTE} at (40,642) size 689x54 [bgcolor=#00FFFF]
- RenderText {#text} at (384,0) size 651x54
- text run at (384,0) width 228: "In the first half of the test page, this"
- text run at (0,18) width 651: "BLOCKQUOTE element should have a text indent equal to 50% of the BODY element's width, since"
- text run at (0,36) width 512: "BLOCKQUOTE is a child of BODY; in the second half, it is a child of TABLE."
+ RenderText {#text} at (344,0) size 684x54
+ text run at (344,0) width 340: "In the first half of the test page, this BLOCKQUOTE"
+ 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"
+ text run at (0,36) width 374: "child of BODY; in the second half, it is a child of TABLE."
RenderTable {TABLE} at (0,712) size 769x518 [border: (1px outset #808080)]
RenderTableSection {TBODY} at (1,1) size 767x516
RenderTableRow {TR} at (0,0) size 767x26
@@ -130,7 +130,7 @@
RenderText {#text} at (200,36) size 149x18
text run at (200,36) width 149: " which may be present."
RenderBlock {BLOCKQUOTE} at (44,416) size 667x54 [bgcolor=#00FFFF]
- RenderText {#text} at (373,0) size 651x54
- text run at (373,0) width 228: "In the first half of the test page, this"
+ RenderText {#text} at (333,0) size 651x54
+ text run at (333,0) width 228: "In the first half of the test page, this"
text run at (0,18) width 651: "BLOCKQUOTE element should have a text indent equal to 50% of the BODY element's width, since"
text run at (0,36) width 512: "BLOCKQUOTE is a child of BODY; in the second half, it is a child of TABLE."
Modified: trunk/LayoutTests/platform/mac/css2.1/t1601-c547-indent-01-d-expected.txt (254420 => 254421)
--- trunk/LayoutTests/platform/mac/css2.1/t1601-c547-indent-01-d-expected.txt 2020-01-13 03:12:13 UTC (rev 254420)
+++ trunk/LayoutTests/platform/mac/css2.1/t1601-c547-indent-01-d-expected.txt 2020-01-13 03:40:46 UTC (rev 254421)
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
-layer at (0,0) size 800x236
- RenderBlock {HTML} at (0,0) size 800x236
- RenderBody {BODY} at (8,16) size 784x212
+layer at (0,0) size 800x218
+ RenderBlock {HTML} at (0,0) size 800x218
+ RenderBody {BODY} at (8,16) size 784x194
RenderBlock {P} at (0,0) size 784x36 [bgcolor=#00FFFF]
RenderText {#text} at (392,0) size 758x36
text run at (392,0) width 366: "The first line of this sentence should be indented halfway"
@@ -24,9 +24,8 @@
text run at (0,54) width 116: "aligned on the left"
RenderText {#text} at (115,54) size 101x18
text run at (115,54) width 101: " of the window."
- RenderBlock {DIV} at (0,140) size 196x72 [bgcolor=#00FFFF]
- RenderText {#text} at (392,0) size 404x72
- text run at (392,0) width 12: "X"
- text run at (0,18) width 172: "The X on the previous line"
- text run at (0,36) width 188: "should be centered across the"
- text run at (0,54) width 55: "window."
+ RenderBlock {DIV} at (0,140) size 196x54 [bgcolor=#00FFFF]
+ RenderText {#text} at (98,0) size 181x54
+ text run at (98,0) width 76: "X The X on"
+ text run at (0,18) width 173: "the previous line should be"
+ text run at (0,36) width 181: "centered across the window."
Modified: trunk/Source/WebCore/ChangeLog (254420 => 254421)
--- trunk/Source/WebCore/ChangeLog 2020-01-13 03:12:13 UTC (rev 254420)
+++ trunk/Source/WebCore/ChangeLog 2020-01-13 03:40:46 UTC (rev 254421)
@@ -1,3 +1,17 @@
+2020-01-12 Zalan Bujtas <[email protected]>
+
+ 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.
+
+ 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):
+
2020-01-12 Yusuke Suzuki <[email protected]>
[WebCore] Reorganize JSType in WebCore to offer more bits to JSC
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (254420 => 254421)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2020-01-13 03:12:13 UTC (rev 254420)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2020-01-13 03:40:46 UTC (rev 254421)
@@ -1868,7 +1868,7 @@
{
LayoutUnit cw;
if (style().textIndent().isPercentOrCalculated())
- cw = containingBlock()->availableLogicalWidth();
+ cw = availableLogicalWidth();
return minimumValueForLength(style().textIndent(), cw);
}