Title: [243437] trunk
Revision
243437
Author
[email protected]
Date
2019-03-25 08:07:35 -0700 (Mon, 25 Mar 2019)

Log Message

A single leading space is not considered as a word break even when word-break: break-all is set
https://bugs.webkit.org/show_bug.cgi?id=195361

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Imported additonal WPT from the CSS Text Suite that verify the
change doesn't regress in any case, specially for the word-break:
break-word feature.

* web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007-expected.html: Added.
* web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html: Added.
* web-platform-tests/css/css-text/overflow-wrap/w3c-import.log:
* web-platform-tests/css/css-text/white-space/pre-wrap-008-expected.html: Added.
* web-platform-tests/css/css-text/white-space/pre-wrap-008.html: Added.
* web-platform-tests/css/css-text/white-space/w3c-import.log:
* web-platform-tests/css/css-text/word-break/w3c-import.log:
* web-platform-tests/css/css-text/word-break/word-break-break-all-015-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-015.html: Added.

Source/WebCore:

We must consider leading white-spaces as potential soft-breaking
opportunities that may avoid breaking in the middle of the word.

However, 'break-word: break-all' [1] implies that we should ignore
previous opportunities and break at any character (among the ones
valid for 'break-all') that prevents the line to overflow. Note,
that these breakable characters are different from the ones
provided by 'line-break: anywhere' [2].

This change is covered by the already existent tests of the CSS
Text 3 suite of the Web Platform Tests.

The word-break-break-all-010.html was precisely designed to cover
the basic issue fixed with this change, verifying that the word is
indeed broken even if a single leading space constitutes a
previous soft-breaking opportunity.

There are other Web Platform Tests. which already pass before this
change, to verify that such leading white-space must be used
instead of breaking the word in any other case, including
overflow-wrap: break-word and even the deprecated word-break:
break-word.

   - white-space/pre-wrap-008.html
   - white-space/pre-wrap-015.html
   - white-space/pre-wrap-016.html
   - overflow-wrap/overflow-wrap-break-word-004.html
   - overflow-wrap/overflow-wrap-break-word-005.html
   - overflow-wrap/overflow-wrap-break-word-007.html
   - word-break/word-break-break-all-011.html
   - word-break/word-break-break-all-014.html

The reason why the word-break-break-all-010.html passes in Mac
platform is that for that case the SimpleLineLayout codepath is
executed instead, which doesn't have this bug, present in the old
line-breaking logic implemented in the BreakingContext class.

In order to verify the validity of this change, I've added several
tests under fast/text with the SimpleLineLayout disabled.

Tests: fast/text/overflow-wrap-break-word-004.html
       fast/text/overflow-wrap-break-word-005.html
       fast/text/overflow-wrap-break-word-007.html
       fast/text/whitespace/pre-wrap-008.html
       fast/text/whitespace/pre-wrap-015.html
       fast/text/whitespace/pre-wrap-016.html
       fast/text/word-break-break-all-010.html
       fast/text/word-break-break-all-011.html
       fast/text/word-break-break-all-015.html
       imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html
       imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015.html

* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):

LayoutTests:

Removed some entries from the GTK expectation file.
Added tests to verify the codepath with SimpleLineLayout disabled.

* fast/text/overflow-wrap-break-word-004-expected.html: Added.
* fast/text/overflow-wrap-break-word-004.html: Added.
* fast/text/overflow-wrap-break-word-005-expected.html: Added.
* fast/text/overflow-wrap-break-word-005.html: Added.
* fast/text/overflow-wrap-break-word-007-expected.html: Added.
* fast/text/overflow-wrap-break-word-007.html: Added.
* fast/text/whitespace/pre-wrap-008-expected.html: Added.
* fast/text/whitespace/pre-wrap-008.html: Added.
* fast/text/whitespace/pre-wrap-015-expected.html: Added.
* fast/text/whitespace/pre-wrap-015.html: Added.
* fast/text/whitespace/pre-wrap-016-expected.html: Added.
* fast/text/whitespace/pre-wrap-016.html: Added.
* fast/text/word-break-break-all-010-expected.html: Added.
* fast/text/word-break-break-all-010.html: Added.
* fast/text/word-break-break-all-011-expected.html: Added.
* fast/text/word-break-break-all-011.html: Added.
* fast/text/word-break-break-all-015-expected.html: Added.
* fast/text/word-break-break-all-015.html: Added.
* platform/gtk/TestExpectations:
  - word-break-break-all-010.html passes now thanks to this change.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243436 => 243437)


--- trunk/LayoutTests/ChangeLog	2019-03-25 14:42:42 UTC (rev 243436)
+++ trunk/LayoutTests/ChangeLog	2019-03-25 15:07:35 UTC (rev 243437)
@@ -1,3 +1,34 @@
+2019-03-25  Javier Fernandez  <[email protected]>
+
+        A single leading space is not considered as a word break even when word-break: break-all is set
+        https://bugs.webkit.org/show_bug.cgi?id=195361
+
+        Reviewed by Ryosuke Niwa.
+
+        Removed some entries from the GTK expectation file.
+        Added tests to verify the codepath with SimpleLineLayout disabled.
+
+        * fast/text/overflow-wrap-break-word-004-expected.html: Added.
+        * fast/text/overflow-wrap-break-word-004.html: Added.
+        * fast/text/overflow-wrap-break-word-005-expected.html: Added.
+        * fast/text/overflow-wrap-break-word-005.html: Added.
+        * fast/text/overflow-wrap-break-word-007-expected.html: Added.
+        * fast/text/overflow-wrap-break-word-007.html: Added.
+        * fast/text/whitespace/pre-wrap-008-expected.html: Added.
+        * fast/text/whitespace/pre-wrap-008.html: Added.
+        * fast/text/whitespace/pre-wrap-015-expected.html: Added.
+        * fast/text/whitespace/pre-wrap-015.html: Added.
+        * fast/text/whitespace/pre-wrap-016-expected.html: Added.
+        * fast/text/whitespace/pre-wrap-016.html: Added.
+        * fast/text/word-break-break-all-010-expected.html: Added.
+        * fast/text/word-break-break-all-010.html: Added.
+        * fast/text/word-break-break-all-011-expected.html: Added.
+        * fast/text/word-break-break-all-011.html: Added.
+        * fast/text/word-break-break-all-015-expected.html: Added.
+        * fast/text/word-break-break-all-015.html: Added.
+        * platform/gtk/TestExpectations:
+          - word-break-break-all-010.html passes now thanks to this change.
+
 2019-03-25  Diego Pino Garcia  <[email protected]>
 
         [GTK][WPE] Gardening, update test expectations.

Added: trunk/LayoutTests/fast/text/overflow-wrap-break-word-004-expected.html (0 => 243437)


--- trunk/LayoutTests/fast/text/overflow-wrap-break-word-004-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/overflow-wrap-break-word-004-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/fast/text/overflow-wrap-break-word-004.html (0 => 243437)


--- trunk/LayoutTests/fast/text/overflow-wrap-break-word-004.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/overflow-wrap-break-word-004.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: overflow-wrap: break-word</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="A Single leading white-space constitutes a soft breaking opportunity, honoring the 'white-space: pre-wrap' property, that must prevent the word to be broken.">
+<style>
+div {
+  position: relative;
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+}
+.test {
+  color: green;
+  width: 5ch;
+
+  white-space: pre-wrap;
+  overflow-wrap: break-word;
+}
+</style>
+<script>
+// Force line box path.
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"><br>XXXXX</div>
+  <div class="test"> XXXXX </div>
+</body>

Added: trunk/LayoutTests/fast/text/overflow-wrap-break-word-005-expected.html (0 => 243437)


--- trunk/LayoutTests/fast/text/overflow-wrap-break-word-005-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/overflow-wrap-break-word-005-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/fast/text/overflow-wrap-break-word-005.html (0 => 243437)


--- trunk/LayoutTests/fast/text/overflow-wrap-break-word-005.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/overflow-wrap-break-word-005.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: overflow-wrap: break-word</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="A Single leading white-space constitutes a soft breaking opportunity, honoring the 'white-space: pre-wrap' property, that must prevent the word to be broken.">
+<style>
+div {
+  position: relative;
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+}
+.fail {
+  position: absolute;
+  color: red;
+  z-index: -1;
+}
+span { color: green; }
+.test {
+  color: green;
+  width: 5ch;
+
+  white-space: pre-wrap;
+  overflow-wrap: break-word;
+}
+</style>
+<script>
+// Force line box path.
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="fail">XXX<span>XX<br></span><span>XXXXX<br></span>XXXXX<br>XXXX<span>X<br></span><span>XXXXX</span></div>
+  <div class="test">XXX
+ XXXXXXXXX</div>
+</body>

Added: trunk/LayoutTests/fast/text/overflow-wrap-break-word-007-expected.html (0 => 243437)


--- trunk/LayoutTests/fast/text/overflow-wrap-break-word-007-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/overflow-wrap-break-word-007-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href=""
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/fast/text/overflow-wrap-break-word-007.html (0 => 243437)


--- trunk/LayoutTests/fast/text/overflow-wrap-break-word-007.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/overflow-wrap-break-word-007.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: overflow-wrap: break-word</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="A Single leading white-space constitutes a soft breaking opportunity, honoring the 'white-space: break-spaces' property, that must prevent the word to be broken.">
+<style>
+div {
+  position: relative;
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+  white-space: pre;
+}
+.test {
+  color: green;
+  width: 5ch;
+
+  white-space: pre-wrap;
+  overflow-wrap: break-word;
+}
+</style>
+<script>
+// Force line box path.
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"> XX  <br>XXX</div>
+  <div class="test"> XX XXX </div>
+</body>

Added: trunk/LayoutTests/fast/text/whitespace/pre-wrap-008-expected.html (0 => 243437)


--- trunk/LayoutTests/fast/text/whitespace/pre-wrap-008-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/whitespace/pre-wrap-008-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Javier Fernandez" href="" />
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+    <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/fast/text/whitespace/pre-wrap-008.html (0 => 243437)


--- trunk/LayoutTests/fast/text/whitespace/pre-wrap-008.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/whitespace/pre-wrap-008.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space: pre-wrap</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="The word is not broken despite the 'word-break: break-word' if there are previous breaking opportunities, honoring the white-space: pre-wrap value.">
+<style>
+div {
+   position: relative;
+   font-size: 20px;
+   font-family: Ahem;
+   line-height: 1em;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+  white-space: pre;
+}
+.test {
+  color: green;
+  width: 5ch;
+
+  white-space: pre-wrap;
+  word-break: break-word;
+}
+</style>
+<script>
+// Force line box path.
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"> XX  <br>XXX</div>
+  <div class="test"> XX XXX </div>
+</body>

Added: trunk/LayoutTests/fast/text/whitespace/pre-wrap-015-expected.html (0 => 243437)


--- trunk/LayoutTests/fast/text/whitespace/pre-wrap-015-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/whitespace/pre-wrap-015-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text level 3 Test reference file</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<style>
+div {
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+  color: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div>XX<br>XX</div>
+</body>

Added: trunk/LayoutTests/fast/text/whitespace/pre-wrap-015.html (0 => 243437)


--- trunk/LayoutTests/fast/text/whitespace/pre-wrap-015.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/whitespace/pre-wrap-015.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space: pre-wrap</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="The text is broken at the end of the space between the two words, never before, so it hangs and cause an overflow">
+<style>
+div {
+   position: relative;
+   font: 20px/1 Ahem;
+}
+.ref {
+  position: absolute;
+  color: red;
+  z-index: -1;
+}
+.test {
+  color: green;
+  width: 20px;
+
+  white-space: pre-wrap;
+  word-break: break-all;
+}
+</style>
+<script>
+// Force line box path.
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="ref">X<span style="color: green">X</span><br>X<span style="color: green">X</span></div>
+  <div class="test">X X</div>
+</body>

Added: trunk/LayoutTests/fast/text/whitespace/pre-wrap-016-expected.html (0 => 243437)


--- trunk/LayoutTests/fast/text/whitespace/pre-wrap-016-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/whitespace/pre-wrap-016-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text level 3 Test reference file</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<style>
+div {
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+  color: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div>XX<br>XX</div>
+</body>

Added: trunk/LayoutTests/fast/text/whitespace/pre-wrap-016.html (0 => 243437)


--- trunk/LayoutTests/fast/text/whitespace/pre-wrap-016.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/whitespace/pre-wrap-016.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space: pre-wrap</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="The word is not broken if there are previous breaking opportunities, honoring the white-space: pre-wrap value.">
+<style>
+div {
+   position: relative;
+   font-size: 20px;
+   font-family: Ahem;
+   line-height: 1em;
+}
+.red {
+  position: absolute;
+  white-space: pre;
+  background: green;
+  color: red;
+  width: 40px;
+  height: 40px;
+  z-index: -1;
+}
+.test {
+  color: green;
+  width: 2ch;
+
+  white-space: pre-wrap;
+  word-break: break-word;
+}
+</style>
+<script>
+// Force line box path.
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"><br>XX</div>
+  <div class="test"> XX</div>
+</body>

Added: trunk/LayoutTests/fast/text/word-break-break-all-010-expected.html (0 => 243437)


--- trunk/LayoutTests/fast/text/word-break-break-all-010-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/word-break-break-all-010-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/fast/text/word-break-break-all-010.html (0 => 243437)


--- trunk/LayoutTests/fast/text/word-break-break-all-010.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/word-break-break-all-010.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="The word is broken even if pre-wrap provides a former breaking opportunity in leading white-space.">
+<style>
+div {
+  position: relative;
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+}
+.red {
+  position: absolute;
+  white-space: pre;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+}
+.test {
+  color: green;
+  width: 5ch;
+
+  white-space: pre-wrap;
+  word-break: break-all;
+}
+</style>
+<script>
+// Force line box path.
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"> XXXX<br>X</div>
+  <div class="test"> XXXXX</div>
+</body>

Added: trunk/LayoutTests/fast/text/word-break-break-all-011-expected.html (0 => 243437)


--- trunk/LayoutTests/fast/text/word-break-break-all-011-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/word-break-break-all-011-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/fast/text/word-break-break-all-011.html (0 => 243437)


--- trunk/LayoutTests/fast/text/word-break-break-all-011.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/word-break-break-all-011.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="A single leading white-space should account as soft breaking opportunity, honoring the 'white-space: pre-wrap', on top to the ones provided by 'word-break: break-all'.">
+<style>
+div {
+  position: relative;
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+  white-space: pre;
+}
+span { color: green; }
+.test {
+  color: green;
+  width: 1ch;
+
+  white-space: pre-wrap;
+  word-break: break-all;
+}
+</style>
+<script>
+// Force line box path.
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+</script>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"> <br>X<br>X</div>
+  <div class="test"> XX</div>
+</body>

Added: trunk/LayoutTests/fast/text/word-break-break-all-015-expected.html (0 => 243437)


--- trunk/LayoutTests/fast/text/word-break-break-all-015-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/word-break-break-all-015-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/fast/text/word-break-break-all-015.html (0 => 243437)


--- trunk/LayoutTests/fast/text/word-break-break-all-015.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/word-break-break-all-015.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="The word is broken even if white-space: pre-wrap provides a former breaking opportunity in leading white-space.">
+<style>
+div {
+   position: relative;
+   font-size: 20px;
+   font-family: Ahem;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+  white-space: pre;
+}
+.test {
+  color: green;
+  line-height: 1em;
+  width: 5ch;
+  line-break: strict; /* Avoid WebKit's SimpleLineLayout codepath */
+
+  white-space: pre-wrap;
+  word-break: break-all;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"> XX X<br>XX</div>
+  <div class="test"> XX XXX </div>
+</body>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (243436 => 243437)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-03-25 14:42:42 UTC (rev 243436)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-03-25 15:07:35 UTC (rev 243437)
@@ -1,3 +1,24 @@
+2019-03-25  Javier Fernandez  <[email protected]>
+
+        A single leading space is not considered as a word break even when word-break: break-all is set
+        https://bugs.webkit.org/show_bug.cgi?id=195361
+
+        Reviewed by Ryosuke Niwa.
+
+        Imported additonal WPT from the CSS Text Suite that verify the
+        change doesn't regress in any case, specially for the word-break:
+        break-word feature.
+
+        * web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007-expected.html: Added.
+        * web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html: Added.
+        * web-platform-tests/css/css-text/overflow-wrap/w3c-import.log:
+        * web-platform-tests/css/css-text/white-space/pre-wrap-008-expected.html: Added.
+        * web-platform-tests/css/css-text/white-space/pre-wrap-008.html: Added.
+        * web-platform-tests/css/css-text/white-space/w3c-import.log:
+        * web-platform-tests/css/css-text/word-break/w3c-import.log:
+        * web-platform-tests/css/css-text/word-break/word-break-break-all-015-expected.html: Added.
+        * web-platform-tests/css/css-text/word-break/word-break-break-all-015.html: Added.
+
 2019-03-25  Rob Buis  <[email protected]>
 
         Reflect HTMLLinkElement.as according to the spec

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007-expected.html (0 => 243437)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007-expected.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href=""
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html (0 => 243437)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: overflow-wrap: break-word</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="A Single leading white-space constitutes a soft breaking opportunity, honoring the 'white-space: break-spaces' property, that must prevent the word to be broken.">
+<style>
+div {
+  position: relative;
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+  white-space: pre;
+}
+.test {
+  color: green;
+  width: 5ch;
+
+  white-space: pre-wrap;
+  overflow-wrap: break-word;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"> XX  <br>XXX</div>
+  <div class="test"> XX XXX </div>
+</body>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/w3c-import.log (243436 => 243437)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/w3c-import.log	2019-03-25 14:42:42 UTC (rev 243436)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/w3c-import.log	2019-03-25 15:07:35 UTC (rev 243437)
@@ -47,6 +47,8 @@
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-005.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-006-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-006.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-fit-content-001-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-fit-content-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-span-001-expected.html

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008-expected.html (0 => 243437)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008-expected.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Javier Fernandez" href="" />
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+    <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008.html (0 => 243437)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: white-space: pre-wrap</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="The word is not broken despite the 'word-break: break-word' if there are previous breaking opportunities, honoring the white-space: pre-wrap value.">
+<style>
+div {
+  position: relative;
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+  white-space: pre;
+}
+.test {
+  color: green;
+  width: 5ch;
+
+  white-space: pre-wrap;
+  word-break: break-word;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"> XX  <br>XXX</div>
+  <div class="test"> XX XXX </div>
+</body>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/w3c-import.log (243436 => 243437)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/w3c-import.log	2019-03-25 14:42:42 UTC (rev 243436)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/w3c-import.log	2019-03-25 15:07:35 UTC (rev 243437)
@@ -172,6 +172,8 @@
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-006.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-007-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-007.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-011-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-011.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-012-expected.html

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/w3c-import.log (243436 => 243437)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/w3c-import.log	2019-03-25 14:42:42 UTC (rev 243436)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/w3c-import.log	2019-03-25 15:07:35 UTC (rev 243437)
@@ -42,6 +42,8 @@
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-013.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-014-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-014.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-020-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-020.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-keep-all-000-expected.html

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015-expected.html (0 => 243437)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015-expected.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015-expected.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href=""
+<style>
+div {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  background: green;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div></div>
+</body>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015.html (0 => 243437)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015.html	2019-03-25 15:07:35 UTC (rev 243437)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<meta name="flags" content="ahem">
+<link rel="match" href=""
+<meta name="assert" content="The word is broken even if white-space: pre-wrap provides a former breaking opportunity in leading white-space.">
+<style>
+div {
+  position: relative;
+  font-size: 20px;
+  font-family: Ahem;
+  line-height: 1em;
+}
+.red {
+  position: absolute;
+  background: green;
+  color: red;
+  width: 100px;
+  height: 100px;
+  z-index: -1;
+  white-space: pre;
+}
+.test {
+  color: green;
+  width: 5ch;
+
+  white-space: pre-wrap;
+  word-break: break-all;
+}
+</style>
+<body>
+  <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+  <div class="red"> XX X<br>XX</div>
+  <div class="test"> XX XXX </div>
+</body>

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (243436 => 243437)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2019-03-25 14:42:42 UTC (rev 243436)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2019-03-25 15:07:35 UTC (rev 243437)
@@ -3499,7 +3499,6 @@
 webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-normal-bo-000.html [ ImageOnlyFailure ]
 webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-normal-lo-000.html [ ImageOnlyFailure ]
 
-webkit.org/b/195275 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-010.html [ ImageOnlyFailure ]
 webkit.org/b/195275 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-014.html [ ImageOnlyFailure ]
 
 webkit.org/b/195275 imported/w3c/web-platform-tests/css/css-text/boundary-shaping/boundary-shaping-004.html [ Timeout ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (243436 => 243437)


--- trunk/Source/WebCore/ChangeLog	2019-03-25 14:42:42 UTC (rev 243436)
+++ trunk/Source/WebCore/ChangeLog	2019-03-25 15:07:35 UTC (rev 243437)
@@ -1,3 +1,66 @@
+2019-03-25  Javier Fernandez  <[email protected]>
+
+        A single leading space is not considered as a word break even when word-break: break-all is set
+        https://bugs.webkit.org/show_bug.cgi?id=195361
+
+        Reviewed by Ryosuke Niwa.
+
+        We must consider leading white-spaces as potential soft-breaking
+        opportunities that may avoid breaking in the middle of the word.
+
+        However, 'break-word: break-all' [1] implies that we should ignore
+        previous opportunities and break at any character (among the ones
+        valid for 'break-all') that prevents the line to overflow. Note,
+        that these breakable characters are different from the ones
+        provided by 'line-break: anywhere' [2].
+
+        This change is covered by the already existent tests of the CSS
+        Text 3 suite of the Web Platform Tests.
+
+        The word-break-break-all-010.html was precisely designed to cover
+        the basic issue fixed with this change, verifying that the word is
+        indeed broken even if a single leading space constitutes a
+        previous soft-breaking opportunity.
+
+        There are other Web Platform Tests. which already pass before this
+        change, to verify that such leading white-space must be used
+        instead of breaking the word in any other case, including
+        overflow-wrap: break-word and even the deprecated word-break:
+        break-word.
+
+           - white-space/pre-wrap-008.html
+           - white-space/pre-wrap-015.html
+           - white-space/pre-wrap-016.html
+           - overflow-wrap/overflow-wrap-break-word-004.html
+           - overflow-wrap/overflow-wrap-break-word-005.html
+           - overflow-wrap/overflow-wrap-break-word-007.html
+           - word-break/word-break-break-all-011.html
+           - word-break/word-break-break-all-014.html
+
+        The reason why the word-break-break-all-010.html passes in Mac
+        platform is that for that case the SimpleLineLayout codepath is
+        executed instead, which doesn't have this bug, present in the old
+        line-breaking logic implemented in the BreakingContext class.
+
+        In order to verify the validity of this change, I've added several
+        tests under fast/text with the SimpleLineLayout disabled.
+
+        Tests: fast/text/overflow-wrap-break-word-004.html
+               fast/text/overflow-wrap-break-word-005.html
+               fast/text/overflow-wrap-break-word-007.html
+               fast/text/whitespace/pre-wrap-008.html
+               fast/text/whitespace/pre-wrap-015.html
+               fast/text/whitespace/pre-wrap-016.html
+               fast/text/word-break-break-all-010.html
+               fast/text/word-break-break-all-011.html
+               fast/text/word-break-break-all-015.html
+               imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html
+               imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008.html
+               imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015.html
+
+        * rendering/line/BreakingContext.h:
+        (WebCore::BreakingContext::handleText):
+
 2019-03-25  Rob Buis  <[email protected]>
 
         Reflect HTMLLinkElement.as according to the spec

Modified: trunk/Source/WebCore/rendering/line/BreakingContext.h (243436 => 243437)


--- trunk/Source/WebCore/rendering/line/BreakingContext.h	2019-03-25 14:42:42 UTC (rev 243436)
+++ trunk/Source/WebCore/rendering/line/BreakingContext.h	2019-03-25 15:07:35 UTC (rev 243437)
@@ -817,6 +817,11 @@
         UChar c = m_current.current();
         m_currentCharacterIsSpace = c == ' ' || c == '\t' || (!m_preservesNewline && (c == '\n'));
 
+        // A single preserved leading white-space doesn't fulfill the 'betweenWords' condition, however it's indeed a
+        // soft-breaking opportunty so we may want to avoid breaking in the middle of the word.
+        if (m_atStart && m_currentCharacterIsSpace && !previousCharacterIsSpace)
+            breakWords = false;
+
         if (canHangPunctuationAtStart && m_width.isFirstLine() && !m_width.committedWidth() && !wrapW && !inlineLogicalWidth(m_current.renderer(), true, false)) {
             m_width.addUncommittedWidth(-renderText.hangablePunctuationStartWidth(m_current.offset()));
             canHangPunctuationAtStart = false;
@@ -839,7 +844,7 @@
 
         m_currentCharacterIsWS = m_currentCharacterIsSpace || (breakNBSP && c == noBreakSpace);
 
-        if ((breakAll || breakWords) && !midWordBreak && (!m_currentCharacterIsSpace || style.whiteSpace() != WhiteSpace::PreWrap)) {
+        if ((breakAll || breakWords) && !midWordBreak && (!m_currentCharacterIsSpace || m_atStart || style.whiteSpace() != WhiteSpace::PreWrap)) {
             wrapW += charWidth;
             bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && U16_IS_TRAIL(renderText.characterAt(m_current.offset() + 1));
             charWidth = textWidth(renderText, m_current.offset(), midWordBreakIsBeforeSurrogatePair ? 2 : 1, font, m_width.committedWidth() + wrapW, isFixedPitch, m_collapseWhiteSpace, fallbackFonts, textLayout);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to