Title: [270749] trunk
Revision
270749
Author
[email protected]
Date
2020-12-13 09:29:25 -0800 (Sun, 13 Dec 2020)

Log Message

[LFC][IFC] Offset the content logical left by the word-spacing value
https://bugs.webkit.org/show_bug.cgi?id=219706

Reviewed by Antti Koivisto.

Source/WebCore:

Let's decouple the whitespace width and the word-spacing value.
Instead of constructing a 9px long run for whitespace "width: 4px", "word-spacing: 5px",
we create a 4px long run at 5px.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::appendTextContent):
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::width):

LayoutTests:

Now we've got dedicated runs for these content.
-and the word-space-extra-expected.txt change is an actual (though not visual) progression.

* platform/mac/css1/text_properties/word_spacing-expected.txt:
* platform/mac/fast/css/word-space-extra-expected.txt:
* platform/mac/fast/text/atsui-negative-spacing-features-expected.txt:
* platform/mac/fast/text/atsui-spacing-features-expected.txt:
* platform/mac/fast/text/basic/004-expected.txt:
* platform/mac/fast/text/word-space-expected.txt:
* platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (270748 => 270749)


--- trunk/LayoutTests/ChangeLog	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/ChangeLog	2020-12-13 17:29:25 UTC (rev 270749)
@@ -1,3 +1,21 @@
+2020-12-13  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Offset the content logical left by the word-spacing value
+        https://bugs.webkit.org/show_bug.cgi?id=219706
+
+        Reviewed by Antti Koivisto.
+
+        Now we've got dedicated runs for these content.
+        -and the word-space-extra-expected.txt change is an actual (though not visual) progression.
+
+        * platform/mac/css1/text_properties/word_spacing-expected.txt:
+        * platform/mac/fast/css/word-space-extra-expected.txt:
+        * platform/mac/fast/text/atsui-negative-spacing-features-expected.txt:
+        * platform/mac/fast/text/atsui-spacing-features-expected.txt:
+        * platform/mac/fast/text/basic/004-expected.txt:
+        * platform/mac/fast/text/word-space-expected.txt:
+        * platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt:
+
 2020-12-12  Diego Pino Garcia  <[email protected]>
 
         [WPE] Unreviewed test gardening. Remove test entries referencing bug209859.

Modified: trunk/LayoutTests/platform/ios/css1/text_properties/word_spacing-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/ios/css1/text_properties/word_spacing-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/ios/css1/text_properties/word_spacing-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -32,25 +32,95 @@
       RenderBlock {HR} at (0,203) size 784x2 [border: (1px inset #000000)]
       RenderBlock {P} at (0,221) size 784x20
         RenderText {#text} at (0,0) size 716x19
-          text run at (0,0) width 716: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (57,0) width 44: " words"
+          text run at (129,0) width 17: " in"
+          text run at (174,0) width 28: " this"
+          text run at (230,0) width 60: " sentence"
+          text run at (318,0) width 47: " should"
+          text run at (393,0) width 35: " have"
+          text run at (456,0) width 37: " extra"
+          text run at (521,0) width 40: " space"
+          text run at (589,0) width 59: " between"
+          text run at (675,0) width 41: " them."
       RenderBlock {P} at (0,257) size 784x20
         RenderText {#text} at (0,0) size 617x19
-          text run at (0,0) width 617: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (47,0) width 44: " words"
+          text run at (109,0) width 17: " in"
+          text run at (144,0) width 28: " this"
+          text run at (190,0) width 60: " sentence"
+          text run at (268,0) width 48: " should"
+          text run at (334,0) width 35: " have"
+          text run at (387,0) width 37: " extra"
+          text run at (442,0) width 40: " space"
+          text run at (500,0) width 58: " between"
+          text run at (576,0) width 41: " them."
       RenderBlock {P} at (0,293) size 784x20
         RenderText {#text} at (0,0) size 617x19
-          text run at (0,0) width 617: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (47,0) width 44: " words"
+          text run at (109,0) width 17: " in"
+          text run at (144,0) width 28: " this"
+          text run at (190,0) width 60: " sentence"
+          text run at (268,0) width 48: " should"
+          text run at (334,0) width 35: " have"
+          text run at (387,0) width 37: " extra"
+          text run at (442,0) width 40: " space"
+          text run at (500,0) width 58: " between"
+          text run at (576,0) width 41: " them."
       RenderBlock {P} at (0,329) size 784x20
         RenderText {#text} at (0,0) size 468x19
-          text run at (0,0) width 468: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (32,0) width 44: " words"
+          text run at (79,0) width 17: " in"
+          text run at (100,0) width 28: " this"
+          text run at (131,0) width 60: " sentence"
+          text run at (194,0) width 47: " should"
+          text run at (244,0) width 36: " have"
+          text run at (283,0) width 37: " extra"
+          text run at (323,0) width 40: " space"
+          text run at (366,0) width 58: " between"
+          text run at (427,0) width 41: " them."
       RenderBlock {P} at (0,365) size 784x20
         RenderText {#text} at (0,0) size 468x19
-          text run at (0,0) width 468: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (32,0) width 44: " words"
+          text run at (79,0) width 17: " in"
+          text run at (100,0) width 28: " this"
+          text run at (131,0) width 60: " sentence"
+          text run at (194,0) width 47: " should"
+          text run at (244,0) width 36: " have"
+          text run at (283,0) width 37: " extra"
+          text run at (323,0) width 40: " space"
+          text run at (366,0) width 58: " between"
+          text run at (427,0) width 41: " them."
       RenderBlock {P} at (0,401) size 784x20
         RenderText {#text} at (0,0) size 588x19
-          text run at (0,0) width 588: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (44,0) width 44: " words"
+          text run at (103,0) width 17: " in"
+          text run at (136,0) width 28: " this"
+          text run at (179,0) width 60: " sentence"
+          text run at (254,0) width 47: " should"
+          text run at (316,0) width 36: " have"
+          text run at (367,0) width 37: " extra"
+          text run at (419,0) width 40: " space"
+          text run at (474,0) width 58: " between"
+          text run at (547,0) width 41: " them."
       RenderBlock {P} at (0,437) size 784x20
         RenderText {#text} at (0,0) size 500x19
-          text run at (0,0) width 500: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (35,0) width 44: " words"
+          text run at (85,0) width 18: " in"
+          text run at (109,0) width 28: " this"
+          text run at (143,0) width 60: " sentence"
+          text run at (209,0) width 48: " should"
+          text run at (263,0) width 36: " have"
+          text run at (305,0) width 37: " extra"
+          text run at (348,0) width 40: " space"
+          text run at (394,0) width 59: " between"
+          text run at (459,0) width 41: " them."
       RenderBlock {P} at (0,473) size 784x40
         RenderText {#text} at (0,0) size 763x19
           text run at (0,0) width 763: "This words in this sentence should have extra space between them, but the last few words in the sentence"
@@ -61,7 +131,25 @@
           text run at (179,20) width 5: "."
       RenderBlock {P} at (0,529) size 784x20
         RenderText {#text} at (0,0) size 716x19
-          text run at (0,0) width 716: "This words in this sentence should have reduced space between them, since negative values are allowed on this property."
+          text run at (0,0) width 29: "This"
+          text run at (25,0) width 44: " words"
+          text run at (65,0) width 17: " in"
+          text run at (78,0) width 28: " this"
+          text run at (102,0) width 60: " sentence"
+          text run at (158,0) width 47: " should"
+          text run at (201,0) width 35: " have"
+          text run at (232,0) width 56: " reduced"
+          text run at (284,0) width 40: " space"
+          text run at (320,0) width 58: " between"
+          text run at (374,0) width 41: " them,"
+          text run at (411,0) width 38: " since"
+          text run at (445,0) width 59: " negative"
+          text run at (500,0) width 45: " values"
+          text run at (541,0) width 25: " are"
+          text run at (562,0) width 55: " allowed"
+          text run at (613,0) width 21: " on"
+          text run at (630,0) width 28: " this"
+          text run at (654,0) width 62: " property."
       RenderTable {TABLE} at (0,565) size 784x366 [border: (1px outset #808080)]
         RenderTableSection {TBODY} at (1,1) size 782x364
           RenderTableRow {TR} at (0,0) size 782x28
@@ -76,25 +164,95 @@
             RenderTableCell {TD} at (12,28) size 771x336 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
               RenderBlock {P} at (4,4) size 762x20
                 RenderText {#text} at (0,0) size 716x19
-                  text run at (0,0) width 716: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (57,0) width 44: " words"
+                  text run at (129,0) width 17: " in"
+                  text run at (174,0) width 28: " this"
+                  text run at (230,0) width 60: " sentence"
+                  text run at (318,0) width 47: " should"
+                  text run at (393,0) width 35: " have"
+                  text run at (456,0) width 37: " extra"
+                  text run at (521,0) width 40: " space"
+                  text run at (589,0) width 59: " between"
+                  text run at (675,0) width 41: " them."
               RenderBlock {P} at (4,40) size 762x20
                 RenderText {#text} at (0,0) size 617x19
-                  text run at (0,0) width 617: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (47,0) width 44: " words"
+                  text run at (109,0) width 17: " in"
+                  text run at (144,0) width 28: " this"
+                  text run at (190,0) width 60: " sentence"
+                  text run at (268,0) width 48: " should"
+                  text run at (334,0) width 35: " have"
+                  text run at (387,0) width 37: " extra"
+                  text run at (442,0) width 40: " space"
+                  text run at (500,0) width 58: " between"
+                  text run at (576,0) width 41: " them."
               RenderBlock {P} at (4,76) size 762x20
                 RenderText {#text} at (0,0) size 617x19
-                  text run at (0,0) width 617: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (47,0) width 44: " words"
+                  text run at (109,0) width 17: " in"
+                  text run at (144,0) width 28: " this"
+                  text run at (190,0) width 60: " sentence"
+                  text run at (268,0) width 48: " should"
+                  text run at (334,0) width 35: " have"
+                  text run at (387,0) width 37: " extra"
+                  text run at (442,0) width 40: " space"
+                  text run at (500,0) width 58: " between"
+                  text run at (576,0) width 41: " them."
               RenderBlock {P} at (4,112) size 762x20
                 RenderText {#text} at (0,0) size 468x19
-                  text run at (0,0) width 468: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (32,0) width 44: " words"
+                  text run at (79,0) width 17: " in"
+                  text run at (100,0) width 28: " this"
+                  text run at (131,0) width 60: " sentence"
+                  text run at (194,0) width 47: " should"
+                  text run at (244,0) width 36: " have"
+                  text run at (283,0) width 37: " extra"
+                  text run at (323,0) width 40: " space"
+                  text run at (366,0) width 58: " between"
+                  text run at (427,0) width 41: " them."
               RenderBlock {P} at (4,148) size 762x20
                 RenderText {#text} at (0,0) size 468x19
-                  text run at (0,0) width 468: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (32,0) width 44: " words"
+                  text run at (79,0) width 17: " in"
+                  text run at (100,0) width 28: " this"
+                  text run at (131,0) width 60: " sentence"
+                  text run at (194,0) width 47: " should"
+                  text run at (244,0) width 36: " have"
+                  text run at (283,0) width 37: " extra"
+                  text run at (323,0) width 40: " space"
+                  text run at (366,0) width 58: " between"
+                  text run at (427,0) width 41: " them."
               RenderBlock {P} at (4,184) size 762x20
                 RenderText {#text} at (0,0) size 588x19
-                  text run at (0,0) width 588: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (44,0) width 44: " words"
+                  text run at (103,0) width 17: " in"
+                  text run at (136,0) width 28: " this"
+                  text run at (179,0) width 60: " sentence"
+                  text run at (254,0) width 47: " should"
+                  text run at (316,0) width 36: " have"
+                  text run at (367,0) width 37: " extra"
+                  text run at (419,0) width 40: " space"
+                  text run at (474,0) width 58: " between"
+                  text run at (547,0) width 41: " them."
               RenderBlock {P} at (4,220) size 762x20
                 RenderText {#text} at (0,0) size 500x19
-                  text run at (0,0) width 500: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (35,0) width 44: " words"
+                  text run at (85,0) width 18: " in"
+                  text run at (109,0) width 28: " this"
+                  text run at (143,0) width 60: " sentence"
+                  text run at (209,0) width 48: " should"
+                  text run at (263,0) width 36: " have"
+                  text run at (305,0) width 37: " extra"
+                  text run at (348,0) width 40: " space"
+                  text run at (394,0) width 59: " between"
+                  text run at (459,0) width 41: " them."
               RenderBlock {P} at (4,256) size 762x40
                 RenderText {#text} at (0,0) size 699x39
                   text run at (0,0) width 699: "This words in this sentence should have extra space between them, but the last few words in the"
@@ -106,4 +264,22 @@
                   text run at (243,20) width 5: "."
               RenderBlock {P} at (4,312) size 762x20
                 RenderText {#text} at (0,0) size 716x19
-                  text run at (0,0) width 716: "This words in this sentence should have reduced space between them, since negative values are allowed on this property."
+                  text run at (0,0) width 29: "This"
+                  text run at (25,0) width 44: " words"
+                  text run at (65,0) width 17: " in"
+                  text run at (78,0) width 28: " this"
+                  text run at (102,0) width 60: " sentence"
+                  text run at (158,0) width 47: " should"
+                  text run at (201,0) width 35: " have"
+                  text run at (232,0) width 56: " reduced"
+                  text run at (284,0) width 40: " space"
+                  text run at (320,0) width 58: " between"
+                  text run at (374,0) width 41: " them,"
+                  text run at (411,0) width 38: " since"
+                  text run at (445,0) width 59: " negative"
+                  text run at (500,0) width 45: " values"
+                  text run at (541,0) width 25: " are"
+                  text run at (562,0) width 55: " allowed"
+                  text run at (613,0) width 21: " on"
+                  text run at (630,0) width 28: " this"
+                  text run at (654,0) width 62: " property."

Modified: trunk/LayoutTests/platform/ios/fast/css/word-space-extra-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/ios/fast/css/word-space-extra-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/ios/fast/css/word-space-extra-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -8,8 +8,11 @@
           text run at (0,1) width 139: "word-spacing"
       RenderBlock (floating) {PRE} at (0,62) size 986x160
         RenderBlock {H3} at (0,15) size 986x17
-          RenderText {#text} at (0,0) size 145x16
-            text run at (0,0) width 145: "In a floated pre"
+          RenderText {#text} at (0,0) size 205x16
+            text run at (0,0) width 19: "In"
+            text run at (38,0) width 19: " a"
+            text run at (76,0) width 73: " floated"
+            text run at (168,0) width 37: " pre"
         RenderBlock (anonymous) at (0,46) size 986x113
           RenderText {#text} at (0,0) size 257x28
             text run at (0,0) width 0: " "
@@ -148,8 +151,11 @@
         RenderBR {BR} at (985,0) size 1x19
       RenderBlock {PRE} at (0,249) size 784x144
         RenderBlock {H3} at (0,0) size 784x16
-          RenderText {#text} at (0,0) size 181x16
-            text run at (0,0) width 181: "In an un-floated pre"
+          RenderText {#text} at (0,0) size 241x16
+            text run at (0,0) width 19: "In"
+            text run at (38,0) width 28: " an"
+            text run at (85,0) width 100: " un-floated"
+            text run at (204,0) width 37: " pre"
         RenderBlock (anonymous) at (0,31) size 784x113
           RenderText {#text} at (0,0) size 257x28
             text run at (0,0) width 0: " "
@@ -290,7 +296,9 @@
       RenderBlock (anonymous) at (0,411) size 784x24
         RenderBlock {H3} at (0,0) size 784x23
           RenderText {#text} at (0,0) size 115x22
-            text run at (0,0) width 115: "In a span"
+            text run at (0,0) width 18: "In"
+            text run at (37,0) width 16: " a"
+            text run at (72,0) width 43: " span"
       RenderBlock (anonymous) at (0,452) size 784x301
         RenderInline {SPAN} at (0,0) size 857x259
           RenderText {#text} at (0,0) size 179x19
@@ -895,8 +903,11 @@
           text run at (0,1) width 133: "both-spacing"
       RenderBlock (floating) {PRE} at (0,1641) size 1451x159
         RenderBlock {H3} at (0,15) size 1451x17
-          RenderText {#text} at (0,0) size 225x16
-            text run at (0,0) width 225: "In a floated pre"
+          RenderText {#text} at (0,0) size 285x16
+            text run at (0,0) width 29: "In"
+            text run at (48,0) width 29: " a"
+            text run at (96,0) width 113: " floated"
+            text run at (228,0) width 57: " pre"
         RenderBlock (anonymous) at (0,46) size 1451x113
           RenderText {#text} at (0,0) size 537x28
             text run at (0,0) width 0: " "
@@ -1035,8 +1046,11 @@
         RenderBR {BR} at (1450,0) size 1x19
       RenderBlock {PRE} at (0,1827) size 784x144
         RenderBlock {H3} at (0,0) size 784x16
-          RenderText {#text} at (0,0) size 281x16
-            text run at (0,0) width 281: "In an un-floated pre"
+          RenderText {#text} at (0,0) size 341x16
+            text run at (0,0) width 29: "In"
+            text run at (48,0) width 43: " an"
+            text run at (110,0) width 155: " un-floated"
+            text run at (284,0) width 57: " pre"
         RenderBlock (anonymous) at (0,31) size 784x113
           RenderText {#text} at (0,0) size 537x28
             text run at (0,0) width 0: " "
@@ -1178,7 +1192,9 @@
       RenderBlock (anonymous) at (0,2022) size 784x24
         RenderBlock {H3} at (0,0) size 784x23
           RenderText {#text} at (0,0) size 160x22
-            text run at (0,0) width 160: "In a span"
+            text run at (0,0) width 28: "In"
+            text run at (47,0) width 26: " a"
+            text run at (92,0) width 68: " span"
       RenderBlock (anonymous) at (0,2064) size 784x341
         RenderInline {SPAN} at (0,0) size 837x339
           RenderText {#text} at (0,0) size 428x19

Modified: trunk/LayoutTests/platform/ios/fast/text/basic/004-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/ios/fast/text/basic/004-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/ios/fast/text/basic/004-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -5,7 +5,16 @@
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock (floating) {P} at (0,16) size 652x24 [border: (2px solid #008000)]
         RenderText {#text} at (2,2) size 648x19
-          text run at (2,2) width 648: "There should be 30px of word spacing between each word."
+          text run at (2,2) width 38: "There"
+          text run at (69,2) width 47: " should"
+          text run at (145,2) width 21: " be"
+          text run at (195,2) width 37: " 30px"
+          text run at (261,2) width 18: " of"
+          text run at (308,2) width 38: " word"
+          text run at (375,2) width 54: " spacing"
+          text run at (458,2) width 58: " between"
+          text run at (545,2) width 34: " each"
+          text run at (608,2) width 42: " word."
       RenderBlock {DIV} at (0,0) size 784x100
       RenderTable {TABLE} at (0,100) size 100x144
         RenderTableSection {TBODY} at (0,0) size 100x144
@@ -14,9 +23,12 @@
               RenderBlock {P} at (0,0) size 100x144 [border: (2px solid #008000)]
                 RenderText {#text} at (2,2) size 86x139
                   text run at (2,2) width 38: "There"
-                  text run at (2,22) width 77: "should be"
-                  text run at (2,42) width 65: "15px of"
+                  text run at (2,22) width 43: "should"
+                  text run at (59,22) width 20: " be"
+                  text run at (2,42) width 32: "15px"
+                  text run at (49,42) width 18: " of"
                   text run at (2,62) width 33: "word"
                   text run at (2,82) width 49: "spacing"
                   text run at (2,102) width 54: "between"
-                  text run at (2,122) width 86: "each word."
+                  text run at (2,122) width 30: "each"
+                  text run at (46,122) width 42: " word."

Modified: trunk/LayoutTests/platform/ios/fast/text/basic/005-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/ios/fast/text/basic/005-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/ios/fast/text/basic/005-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -5,4 +5,11 @@
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock (floating) {DIV} at (0,0) size 263x24 [border: (2px solid #008000)]
         RenderText {#text} at (2,2) size 259x19
-          text run at (2,2) width 259: "Words should have a negative spacing of 5px."
+          text run at (2,2) width 42: "Words"
+          text run at (38,2) width 48: " should"
+          text run at (80,2) width 35: " have"
+          text run at (109,2) width 12: " a"
+          text run at (115,2) width 59: " negative"
+          text run at (168,2) width 54: " spacing"
+          text run at (216,2) width 18: " of"
+          text run at (228,2) width 33: " 5px."

Modified: trunk/LayoutTests/platform/ios/svg/custom/svg-fonts-word-spacing-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/ios/svg/custom/svg-fonts-word-spacing-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/ios/svg/custom/svg-fonts-word-spacing-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -14,7 +14,9 @@
           text run at (0,0) width 300: "word-spacing: 100px, all should look the same"
       RenderBlock {P} at (0,115) size 784x21
         RenderText {#text} at (0,1) size 270x19
-          text run at (0,1) width 270: "abc abc abc"
+          text run at (0,1) width 19: "abc"
+          text run at (118,1) width 27: " abc"
+          text run at (244,1) width 26: " abc"
       RenderBlock {P} at (0,154) size 784x21
         RenderText {#text} at (0,1) size 126x19
           text run at (0,1) width 126: "abc "

Modified: trunk/LayoutTests/platform/mac/css1/text_properties/word_spacing-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/mac/css1/text_properties/word_spacing-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/mac/css1/text_properties/word_spacing-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -32,25 +32,95 @@
       RenderBlock {HR} at (0,212) size 769x2 [border: (1px inset #000000)]
       RenderBlock {P} at (0,230) size 769x18
         RenderText {#text} at (0,0) size 716x18
-          text run at (0,0) width 716: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (57,0) width 44: " words"
+          text run at (129,0) width 17: " in"
+          text run at (174,0) width 28: " this"
+          text run at (230,0) width 60: " sentence"
+          text run at (318,0) width 47: " should"
+          text run at (393,0) width 35: " have"
+          text run at (456,0) width 37: " extra"
+          text run at (521,0) width 40: " space"
+          text run at (589,0) width 59: " between"
+          text run at (675,0) width 41: " them."
       RenderBlock {P} at (0,264) size 769x18
         RenderText {#text} at (0,0) size 617x18
-          text run at (0,0) width 617: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (47,0) width 44: " words"
+          text run at (109,0) width 17: " in"
+          text run at (144,0) width 28: " this"
+          text run at (190,0) width 60: " sentence"
+          text run at (268,0) width 48: " should"
+          text run at (334,0) width 35: " have"
+          text run at (387,0) width 37: " extra"
+          text run at (442,0) width 40: " space"
+          text run at (500,0) width 58: " between"
+          text run at (576,0) width 41: " them."
       RenderBlock {P} at (0,298) size 769x18
         RenderText {#text} at (0,0) size 617x18
-          text run at (0,0) width 617: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (47,0) width 44: " words"
+          text run at (109,0) width 17: " in"
+          text run at (144,0) width 28: " this"
+          text run at (190,0) width 60: " sentence"
+          text run at (268,0) width 48: " should"
+          text run at (334,0) width 35: " have"
+          text run at (387,0) width 37: " extra"
+          text run at (442,0) width 40: " space"
+          text run at (500,0) width 58: " between"
+          text run at (576,0) width 41: " them."
       RenderBlock {P} at (0,332) size 769x18
         RenderText {#text} at (0,0) size 468x18
-          text run at (0,0) width 468: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (32,0) width 44: " words"
+          text run at (79,0) width 17: " in"
+          text run at (100,0) width 28: " this"
+          text run at (131,0) width 60: " sentence"
+          text run at (194,0) width 47: " should"
+          text run at (244,0) width 36: " have"
+          text run at (283,0) width 37: " extra"
+          text run at (323,0) width 40: " space"
+          text run at (366,0) width 58: " between"
+          text run at (427,0) width 41: " them."
       RenderBlock {P} at (0,366) size 769x18
         RenderText {#text} at (0,0) size 468x18
-          text run at (0,0) width 468: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (32,0) width 44: " words"
+          text run at (79,0) width 17: " in"
+          text run at (100,0) width 28: " this"
+          text run at (131,0) width 60: " sentence"
+          text run at (194,0) width 47: " should"
+          text run at (244,0) width 36: " have"
+          text run at (283,0) width 37: " extra"
+          text run at (323,0) width 40: " space"
+          text run at (366,0) width 58: " between"
+          text run at (427,0) width 41: " them."
       RenderBlock {P} at (0,400) size 769x18
         RenderText {#text} at (0,0) size 588x18
-          text run at (0,0) width 588: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (44,0) width 44: " words"
+          text run at (103,0) width 17: " in"
+          text run at (136,0) width 28: " this"
+          text run at (179,0) width 60: " sentence"
+          text run at (254,0) width 47: " should"
+          text run at (316,0) width 36: " have"
+          text run at (367,0) width 37: " extra"
+          text run at (419,0) width 40: " space"
+          text run at (474,0) width 58: " between"
+          text run at (547,0) width 41: " them."
       RenderBlock {P} at (0,434) size 769x18
         RenderText {#text} at (0,0) size 500x18
-          text run at (0,0) width 500: "This words in this sentence should have extra space between them."
+          text run at (0,0) width 29: "This"
+          text run at (35,0) width 44: " words"
+          text run at (85,0) width 18: " in"
+          text run at (109,0) width 28: " this"
+          text run at (143,0) width 60: " sentence"
+          text run at (210,0) width 47: " should"
+          text run at (263,0) width 36: " have"
+          text run at (305,0) width 37: " extra"
+          text run at (348,0) width 41: " space"
+          text run at (395,0) width 58: " between"
+          text run at (459,0) width 41: " them."
       RenderBlock {P} at (0,468) size 769x36
         RenderText {#text} at (0,0) size 763x18
           text run at (0,0) width 763: "This words in this sentence should have extra space between them, but the last few words in the sentence"
@@ -61,7 +131,25 @@
           text run at (179,18) width 5: "."
       RenderBlock {P} at (0,520) size 769x18
         RenderText {#text} at (0,0) size 716x18
-          text run at (0,0) width 716: "This words in this sentence should have reduced space between them, since negative values are allowed on this property."
+          text run at (0,0) width 29: "This"
+          text run at (25,0) width 44: " words"
+          text run at (65,0) width 17: " in"
+          text run at (78,0) width 28: " this"
+          text run at (102,0) width 60: " sentence"
+          text run at (158,0) width 47: " should"
+          text run at (201,0) width 35: " have"
+          text run at (232,0) width 56: " reduced"
+          text run at (284,0) width 40: " space"
+          text run at (320,0) width 58: " between"
+          text run at (374,0) width 41: " them,"
+          text run at (411,0) width 38: " since"
+          text run at (445,0) width 59: " negative"
+          text run at (500,0) width 45: " values"
+          text run at (541,0) width 25: " are"
+          text run at (562,0) width 55: " allowed"
+          text run at (613,0) width 21: " on"
+          text run at (630,0) width 28: " this"
+          text run at (654,0) width 62: " property."
       RenderTable {TABLE} at (0,554) size 769x344 [border: (1px outset #808080)]
         RenderTableSection {TBODY} at (1,1) size 767x342
           RenderTableRow {TR} at (0,0) size 767x26
@@ -76,25 +164,95 @@
             RenderTableCell {TD} at (12,26) size 755x316 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]
               RenderBlock {P} at (4,4) size 747x18
                 RenderText {#text} at (0,0) size 716x18
-                  text run at (0,0) width 716: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (57,0) width 44: " words"
+                  text run at (129,0) width 17: " in"
+                  text run at (174,0) width 28: " this"
+                  text run at (230,0) width 60: " sentence"
+                  text run at (318,0) width 47: " should"
+                  text run at (393,0) width 35: " have"
+                  text run at (456,0) width 37: " extra"
+                  text run at (521,0) width 40: " space"
+                  text run at (589,0) width 59: " between"
+                  text run at (675,0) width 41: " them."
               RenderBlock {P} at (4,38) size 747x18
                 RenderText {#text} at (0,0) size 617x18
-                  text run at (0,0) width 617: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (47,0) width 44: " words"
+                  text run at (109,0) width 17: " in"
+                  text run at (144,0) width 28: " this"
+                  text run at (190,0) width 60: " sentence"
+                  text run at (268,0) width 48: " should"
+                  text run at (334,0) width 35: " have"
+                  text run at (387,0) width 37: " extra"
+                  text run at (442,0) width 40: " space"
+                  text run at (500,0) width 58: " between"
+                  text run at (576,0) width 41: " them."
               RenderBlock {P} at (4,72) size 747x18
                 RenderText {#text} at (0,0) size 617x18
-                  text run at (0,0) width 617: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (47,0) width 44: " words"
+                  text run at (109,0) width 17: " in"
+                  text run at (144,0) width 28: " this"
+                  text run at (190,0) width 60: " sentence"
+                  text run at (268,0) width 48: " should"
+                  text run at (334,0) width 35: " have"
+                  text run at (387,0) width 37: " extra"
+                  text run at (442,0) width 40: " space"
+                  text run at (500,0) width 58: " between"
+                  text run at (576,0) width 41: " them."
               RenderBlock {P} at (4,106) size 747x18
                 RenderText {#text} at (0,0) size 468x18
-                  text run at (0,0) width 468: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (32,0) width 44: " words"
+                  text run at (79,0) width 17: " in"
+                  text run at (100,0) width 28: " this"
+                  text run at (131,0) width 60: " sentence"
+                  text run at (194,0) width 47: " should"
+                  text run at (244,0) width 36: " have"
+                  text run at (283,0) width 37: " extra"
+                  text run at (323,0) width 40: " space"
+                  text run at (366,0) width 58: " between"
+                  text run at (427,0) width 41: " them."
               RenderBlock {P} at (4,140) size 747x18
                 RenderText {#text} at (0,0) size 468x18
-                  text run at (0,0) width 468: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (32,0) width 44: " words"
+                  text run at (79,0) width 17: " in"
+                  text run at (100,0) width 28: " this"
+                  text run at (131,0) width 60: " sentence"
+                  text run at (194,0) width 47: " should"
+                  text run at (244,0) width 36: " have"
+                  text run at (283,0) width 37: " extra"
+                  text run at (323,0) width 40: " space"
+                  text run at (366,0) width 58: " between"
+                  text run at (427,0) width 41: " them."
               RenderBlock {P} at (4,174) size 747x18
                 RenderText {#text} at (0,0) size 588x18
-                  text run at (0,0) width 588: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (44,0) width 44: " words"
+                  text run at (103,0) width 17: " in"
+                  text run at (136,0) width 28: " this"
+                  text run at (179,0) width 60: " sentence"
+                  text run at (254,0) width 47: " should"
+                  text run at (316,0) width 36: " have"
+                  text run at (367,0) width 37: " extra"
+                  text run at (419,0) width 40: " space"
+                  text run at (474,0) width 58: " between"
+                  text run at (547,0) width 41: " them."
               RenderBlock {P} at (4,208) size 747x18
                 RenderText {#text} at (0,0) size 500x18
-                  text run at (0,0) width 500: "This words in this sentence should have extra space between them."
+                  text run at (0,0) width 29: "This"
+                  text run at (35,0) width 44: " words"
+                  text run at (85,0) width 18: " in"
+                  text run at (109,0) width 28: " this"
+                  text run at (143,0) width 60: " sentence"
+                  text run at (210,0) width 47: " should"
+                  text run at (263,0) width 36: " have"
+                  text run at (305,0) width 37: " extra"
+                  text run at (348,0) width 41: " space"
+                  text run at (395,0) width 58: " between"
+                  text run at (459,0) width 41: " them."
               RenderBlock {P} at (4,242) size 747x36
                 RenderText {#text} at (0,0) size 699x36
                   text run at (0,0) width 699: "This words in this sentence should have extra space between them, but the last few words in the"
@@ -106,4 +264,22 @@
                   text run at (243,18) width 5: "."
               RenderBlock {P} at (4,294) size 747x18
                 RenderText {#text} at (0,0) size 716x18
-                  text run at (0,0) width 716: "This words in this sentence should have reduced space between them, since negative values are allowed on this property."
+                  text run at (0,0) width 29: "This"
+                  text run at (25,0) width 44: " words"
+                  text run at (65,0) width 17: " in"
+                  text run at (78,0) width 28: " this"
+                  text run at (102,0) width 60: " sentence"
+                  text run at (158,0) width 47: " should"
+                  text run at (201,0) width 35: " have"
+                  text run at (232,0) width 56: " reduced"
+                  text run at (284,0) width 40: " space"
+                  text run at (320,0) width 58: " between"
+                  text run at (374,0) width 41: " them,"
+                  text run at (411,0) width 38: " since"
+                  text run at (445,0) width 59: " negative"
+                  text run at (500,0) width 45: " values"
+                  text run at (541,0) width 25: " are"
+                  text run at (562,0) width 55: " allowed"
+                  text run at (613,0) width 21: " on"
+                  text run at (630,0) width 28: " this"
+                  text run at (654,0) width 62: " property."

Modified: trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/mac/fast/css/word-space-extra-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -8,8 +8,11 @@
           text run at (0,0) width 139: "word-spacing"
       RenderBlock (floating) {PRE} at (0,60) size 986x169
         RenderBlock {H3} at (0,15) size 986x18
-          RenderText {#text} at (0,0) size 145x17
-            text run at (0,0) width 145: "In a floated pre"
+          RenderText {#text} at (0,0) size 205x17
+            text run at (0,0) width 19: "In"
+            text run at (38,0) width 19: " a"
+            text run at (76,0) width 73: " floated"
+            text run at (168,0) width 37: " pre"
         RenderBlock (anonymous) at (0,47) size 986x121
           RenderText {#text} at (0,0) size 257x30
             text run at (0,0) width 0: " "
@@ -148,8 +151,11 @@
         RenderBR {BR} at (985,0) size 1x18
       RenderBlock {PRE} at (0,256) size 769x153
         RenderBlock {H3} at (0,0) size 769x17
-          RenderText {#text} at (0,0) size 181x17
-            text run at (0,0) width 181: "In an un-floated pre"
+          RenderText {#text} at (0,0) size 241x17
+            text run at (0,0) width 19: "In"
+            text run at (38,0) width 28: " an"
+            text run at (85,0) width 100: " un-floated"
+            text run at (204,0) width 37: " pre"
         RenderBlock (anonymous) at (0,32) size 769x121
           RenderText {#text} at (0,0) size 257x30
             text run at (0,0) width 0: " "
@@ -290,7 +296,9 @@
       RenderBlock (anonymous) at (0,427) size 769x23
         RenderBlock {H3} at (0,0) size 769x22
           RenderText {#text} at (0,0) size 115x22
-            text run at (0,0) width 115: "In a span"
+            text run at (0,0) width 18: "In"
+            text run at (37,0) width 16: " a"
+            text run at (72,0) width 43: " span"
       RenderBlock (anonymous) at (0,467) size 769x271
         RenderInline {SPAN} at (0,0) size 848x234
           RenderText {#text} at (0,0) size 179x18
@@ -895,8 +903,11 @@
           text run at (0,0) width 133: "both-spacing"
       RenderBlock (floating) {PRE} at (0,1607) size 1451x168
         RenderBlock {H3} at (0,15) size 1451x18
-          RenderText {#text} at (0,0) size 225x17
-            text run at (0,0) width 225: "In a floated pre"
+          RenderText {#text} at (0,0) size 285x17
+            text run at (0,0) width 29: "In"
+            text run at (48,0) width 29: " a"
+            text run at (96,0) width 113: " floated"
+            text run at (228,0) width 57: " pre"
         RenderBlock (anonymous) at (0,47) size 1451x121
           RenderText {#text} at (0,0) size 537x30
             text run at (0,0) width 0: " "
@@ -1035,8 +1046,11 @@
         RenderBR {BR} at (1450,0) size 1x18
       RenderBlock {PRE} at (0,1802) size 769x153
         RenderBlock {H3} at (0,0) size 769x17
-          RenderText {#text} at (0,0) size 281x17
-            text run at (0,0) width 281: "In an un-floated pre"
+          RenderText {#text} at (0,0) size 341x17
+            text run at (0,0) width 29: "In"
+            text run at (48,0) width 43: " an"
+            text run at (110,0) width 155: " un-floated"
+            text run at (284,0) width 57: " pre"
         RenderBlock (anonymous) at (0,32) size 769x121
           RenderText {#text} at (0,0) size 537x30
             text run at (0,0) width 0: " "
@@ -1178,7 +1192,9 @@
       RenderBlock (anonymous) at (0,2004) size 769x23
         RenderBlock {H3} at (0,0) size 769x22
           RenderText {#text} at (0,0) size 160x22
-            text run at (0,0) width 160: "In a span"
+            text run at (0,0) width 28: "In"
+            text run at (47,0) width 26: " a"
+            text run at (92,0) width 68: " span"
       RenderBlock (anonymous) at (0,2045) size 769x343
         RenderInline {SPAN} at (0,0) size 822x342
           RenderText {#text} at (0,0) size 428x18

Modified: trunk/LayoutTests/platform/mac/fast/text/atsui-negative-spacing-features-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/mac/fast/text/atsui-negative-spacing-features-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/mac/fast/text/atsui-negative-spacing-features-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -33,8 +33,14 @@
                     text run at (1,19) width 175: "consectetuer adipiscing e\x{300}lit."
                 RenderBlock {DIV} at (0,86) size 202x38 [border: (1px solid #008000)]
                   RenderText {#text} at (1,1) size 175x36
-                    text run at (1,1) width 174: "Lorem ipsum dolor sit amet,"
-                    text run at (1,19) width 175: "consectetuer adipiscing elit."
+                    text run at (1,1) width 43: "Lorem"
+                    text run at (41,1) width 44: " ipsum"
+                    text run at (82,1) width 39: " dolor"
+                    text run at (118,1) width 20: " sit"
+                    text run at (135,1) width 40: " amet,"
+                    text run at (1,19) width 80: "consectetuer"
+                    text run at (78,19) width 71: " adipiscing"
+                    text run at (146,19) width 30: " elit."
             RenderTableCell {TD} at (208,24) size 204x126 [r=1 c=1 rs=1 cs=1]
               RenderBlock {DIV} at (1,1) size 202x124
                 RenderBlock {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]

Modified: trunk/LayoutTests/platform/mac/fast/text/atsui-spacing-features-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/mac/fast/text/atsui-spacing-features-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/mac/fast/text/atsui-spacing-features-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -47,9 +47,14 @@
                     text run at (1,37) width 105: "adipiscing e\x{300}lit."
                 RenderBlock {DIV} at (0,122) size 202x56 [border: (1px solid #008000)]
                   RenderText {#text} at (1,1) size 173x54
-                    text run at (1,1) width 173: "Lorem ipsum dolor sit"
-                    text run at (1,19) width 130: "amet, consectetuer"
-                    text run at (1,37) width 105: "adipiscing elit."
+                    text run at (1,1) width 43: "Lorem"
+                    text run at (53,1) width 44: " ipsum"
+                    text run at (106,1) width 39: " dolor"
+                    text run at (154,1) width 20: " sit"
+                    text run at (1,19) width 36: "amet,"
+                    text run at (46,19) width 85: " consectetuer"
+                    text run at (1,37) width 66: "adipiscing"
+                    text run at (76,37) width 30: " elit."
             RenderTableCell {TD} at (208,24) size 204x234 [r=1 c=1 rs=1 cs=1]
               RenderBlock {DIV} at (1,1) size 202x232
                 RenderBlock {DIV} at (0,0) size 202x74 [border: (1px solid #0000FF)]

Modified: trunk/LayoutTests/platform/mac/fast/text/basic/004-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/mac/fast/text/basic/004-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/mac/fast/text/basic/004-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -5,7 +5,16 @@
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock (floating) {P} at (0,16) size 652x22 [border: (2px solid #008000)]
         RenderText {#text} at (2,2) size 648x18
-          text run at (2,2) width 648: "There should be 30px of word spacing between each word."
+          text run at (2,2) width 38: "There"
+          text run at (69,2) width 47: " should"
+          text run at (145,2) width 21: " be"
+          text run at (195,2) width 37: " 30px"
+          text run at (261,2) width 18: " of"
+          text run at (308,2) width 38: " word"
+          text run at (375,2) width 54: " spacing"
+          text run at (458,2) width 58: " between"
+          text run at (545,2) width 34: " each"
+          text run at (608,2) width 42: " word."
       RenderBlock {DIV} at (0,0) size 784x100
       RenderTable {TABLE} at (0,100) size 100x130
         RenderTableSection {TBODY} at (0,0) size 100x130
@@ -14,9 +23,12 @@
               RenderBlock {P} at (0,0) size 100x130 [border: (2px solid #008000)]
                 RenderText {#text} at (2,2) size 86x126
                   text run at (2,2) width 38: "There"
-                  text run at (2,20) width 77: "should be"
-                  text run at (2,38) width 65: "15px of"
+                  text run at (2,20) width 43: "should"
+                  text run at (59,20) width 20: " be"
+                  text run at (2,38) width 32: "15px"
+                  text run at (49,38) width 18: " of"
                   text run at (2,56) width 33: "word"
                   text run at (2,74) width 49: "spacing"
                   text run at (2,92) width 54: "between"
-                  text run at (2,110) width 86: "each word."
+                  text run at (2,110) width 30: "each"
+                  text run at (46,110) width 42: " word."

Modified: trunk/LayoutTests/platform/mac/fast/text/basic/005-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/mac/fast/text/basic/005-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/mac/fast/text/basic/005-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -5,4 +5,11 @@
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock (floating) {DIV} at (0,0) size 263x22 [border: (2px solid #008000)]
         RenderText {#text} at (2,2) size 259x18
-          text run at (2,2) width 259: "Words should have a negative spacing of 5px."
+          text run at (2,2) width 42: "Words"
+          text run at (38,2) width 48: " should"
+          text run at (80,2) width 35: " have"
+          text run at (109,2) width 12: " a"
+          text run at (115,2) width 59: " negative"
+          text run at (168,2) width 54: " spacing"
+          text run at (216,2) width 18: " of"
+          text run at (228,2) width 33: " 5px."

Modified: trunk/LayoutTests/platform/mac/fast/text/word-space-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/mac/fast/text/word-space-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/mac/fast/text/word-space-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -21,10 +21,12 @@
           text run at (0,0) width 267: "The next 7 lines should all look the same."
       RenderBlock (floating) {DIV} at (0,86) size 82x24 [border: (3px solid #000000)]
         RenderText {#text} at (3,3) size 76x18
-          text run at (3,3) width 76: "A B"
+          text run at (3,3) width 11: "A"
+          text run at (63,3) width 16: " B"
       RenderBlock (floating) {DIV} at (0,110) size 82x24 [border: (3px solid #000000)]
         RenderText {#text} at (3,3) size 76x18
-          text run at (3,3) width 76: "A B"
+          text run at (3,3) width 11: "A"
+          text run at (63,3) width 16: " B"
       RenderBlock (floating) {DIV} at (0,134) size 83x24 [border: (3px solid #000000)]
         RenderInline {SPAN} at (0,0) size 12x18
           RenderText {#text} at (3,3) size 12x18

Modified: trunk/LayoutTests/platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt (270748 => 270749)


--- trunk/LayoutTests/platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/LayoutTests/platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt	2020-12-13 17:29:25 UTC (rev 270749)
@@ -14,7 +14,9 @@
           text run at (0,0) width 300: "word-spacing: 100px, all should look the same"
       RenderBlock {P} at (0,110) size 784x20
         RenderText {#text} at (0,1) size 270x18
-          text run at (0,1) width 270: "abc abc abc"
+          text run at (0,1) width 19: "abc"
+          text run at (118,1) width 27: " abc"
+          text run at (244,1) width 26: " abc"
       RenderBlock {P} at (0,148) size 784x20
         RenderText {#text} at (0,1) size 126x18
           text run at (0,1) width 126: "abc "

Modified: trunk/Source/WebCore/ChangeLog (270748 => 270749)


--- trunk/Source/WebCore/ChangeLog	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/Source/WebCore/ChangeLog	2020-12-13 17:29:25 UTC (rev 270749)
@@ -1,3 +1,19 @@
+2020-12-13  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Offset the content logical left by the word-spacing value
+        https://bugs.webkit.org/show_bug.cgi?id=219706
+
+        Reviewed by Antti Koivisto.
+
+        Let's decouple the whitespace width and the word-spacing value.
+        Instead of constructing a 9px long run for whitespace "width: 4px", "word-spacing: 5px",
+        we create a 4px long run at 5px.
+
+        * layout/inlineformatting/InlineLine.cpp:
+        (WebCore::Layout::Line::appendTextContent):
+        * layout/inlineformatting/text/TextUtil.cpp:
+        (WebCore::Layout::TextUtil::width):
+
 2020-12-13  Simon Fraser  <[email protected]>
 
         Add some missing Grid files to the project

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp (270748 => 270749)


--- trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp	2020-12-13 17:29:25 UTC (rev 270749)
@@ -268,19 +268,33 @@
     if (willCollapseCompletely())
         return;
 
-    auto inlineTextItemNeedsNewRun = true;
-    if (!m_runs.isEmpty()) {
+    auto needsNewRun = [&] {
+        if (m_runs.isEmpty())
+            return true;
         auto& lastRun = m_runs.last();
-        inlineTextItemNeedsNewRun = lastRun.hasCollapsedTrailingWhitespace() || !lastRun.isText() || &lastRun.layoutBox() != &inlineTextItem.layoutBox();
-        if (!inlineTextItemNeedsNewRun)
-            lastRun.expand(inlineTextItem, logicalWidth);
+        if (&lastRun.layoutBox() != &inlineTextItem.layoutBox())
+            return true;
+        if (!lastRun.isText())
+            return true;
+        if (lastRun.hasCollapsedTrailingWhitespace())
+            return true;
+        if (inlineTextItem.isWordSeparator() && style.fontCascade().wordSpacing())
+            return true;
+        return false;
+    }();
+    auto oldContentLogicalWidth = contentLogicalWidth();
+    if (needsNewRun) {
+        // Note, negative words spacing may cause glyph overlap.
+        auto runLogicalLeft = contentLogicalRight() + (inlineTextItem.isWordSeparator() ? style.fontCascade().wordSpacing() : 0.0f);
+        m_runs.append({ inlineTextItem, runLogicalLeft, logicalWidth });
+        m_contentLogicalWidth = std::max(oldContentLogicalWidth, runLogicalLeft + logicalWidth);
+    } else {
+        m_runs.last().expand(inlineTextItem, logicalWidth);
+        m_contentLogicalWidth += logicalWidth;
     }
-    if (inlineTextItemNeedsNewRun)
-        m_runs.append({ inlineTextItem, contentLogicalRight(), logicalWidth });
-    m_contentLogicalWidth += logicalWidth;
     // Set the trailing trimmable content.
     if (inlineTextItem.isWhitespace() && !InlineTextItem::shouldPreserveSpacesAndTabs(inlineTextItem)) {
-        m_trimmableTrailingContent.addFullyTrimmableContent(m_runs.size() - 1, logicalWidth);
+        m_trimmableTrailingContent.addFullyTrimmableContent(m_runs.size() - 1, contentLogicalWidth() - oldContentLogicalWidth);
         // If we ever trim this content, we need to know if the line visibility state needs to be recomputed.
         if (m_trimmableTrailingContent.isEmpty())
             m_isConsideredEmptyBeforeTrimmableTrailingContent = isConsideredEmpty();

Modified: trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp (270748 => 270749)


--- trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp	2020-12-13 15:20:52 UTC (rev 270748)
+++ trunk/Source/WebCore/layout/inlineformatting/text/TextUtil.cpp	2020-12-13 17:29:25 UTC (rev 270749)
@@ -47,11 +47,8 @@
 {
     RELEASE_ASSERT(from >= inlineTextItem.start());
     RELEASE_ASSERT(to <= inlineTextItem.end());
-    if (inlineTextItem.isWhitespace() && !InlineTextItem::shouldPreserveSpacesAndTabs(inlineTextItem)) {
-        // Fast path for non-preserved whitespace.
-        auto& font = inlineTextItem.style().fontCascade();
-        return font.spaceWidth() + font.wordSpacing();
-    }
+    if (inlineTextItem.isWhitespace() && !InlineTextItem::shouldPreserveSpacesAndTabs(inlineTextItem))
+        return inlineTextItem.style().fontCascade().spaceWidth();
     return TextUtil::width(inlineTextItem.inlineTextBox(), from, to, contentLogicalLeft);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to