Bug 197278

Summary: line should not be broken before the first space after a word
Product: WebKit Reporter: Javier Fernandez <jfernandez>
Component: TextAssignee: Javier Fernandez <jfernandez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, jfernandez, mmaxfield, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.chromium.org/p/chromium/issues/detail?id=956465
https://bugs.webkit.org/show_bug.cgi?id=197277
Attachments:
Description Flags
Test case to reproduce the issue
none
Actual result
none
Expected result
none
Patch
none
Archive of layout-test-results from ews101 for mac-highsierra
none
Archive of layout-test-results from ews105 for mac-highsierra-wk2
none
Archive of layout-test-results from ews117 for mac-highsierra
none
Archive of layout-test-results from ews122 for ios-simulator-wk2
none
Patch
none
Patch
none
Patch none

Description Javier Fernandez 2019-04-25 04:12:14 PDT
Created attachment 368228 [details]
Test case to reproduce the issue

What steps will reproduce the problem?
(1) Load the attached test cas 
(2)
(3)

What is the expected result?

The line is broken before the first word: "X |XX X" (expected.png)

What happens instead?

The line is broken just after the second word: "X XX| X" (actual.png)
Comment 1 Javier Fernandez 2019-04-25 04:14:25 PDT
Created attachment 368230 [details]
Actual result
Comment 2 Javier Fernandez 2019-04-25 04:14:41 PDT
Created attachment 368231 [details]
Expected result
Comment 3 Javier Fernandez 2019-04-26 09:39:40 PDT
This bug is related to a discussion [1] I held recently with the CSS WG regarding how different combinations of line breaking properties should handle the first space after a word as potential breaking opportunities.

[1] https://github.com/w3c/csswg-drafts/issues/3701
Comment 4 Javier Fernandez 2019-04-26 09:51:04 PDT
Created attachment 368323 [details]
Patch
Comment 5 EWS Watchlist 2019-04-26 10:50:03 PDT
Comment on attachment 368323 [details]
Patch

Attachment 368323 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/12006893

New failing tests:
imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-001.html
Comment 6 EWS Watchlist 2019-04-26 10:50:05 PDT
Created attachment 368336 [details]
Archive of layout-test-results from ews101 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 7 EWS Watchlist 2019-04-26 11:08:08 PDT
Comment on attachment 368323 [details]
Patch

Attachment 368323 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/12007046

New failing tests:
imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-001.html
Comment 8 EWS Watchlist 2019-04-26 11:08:10 PDT
Created attachment 368337 [details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 9 EWS Watchlist 2019-04-26 11:39:03 PDT
Comment on attachment 368323 [details]
Patch

Attachment 368323 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/12007190

New failing tests:
imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-001.html
Comment 10 EWS Watchlist 2019-04-26 11:39:05 PDT
Created attachment 368340 [details]
Archive of layout-test-results from ews117 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 11 EWS Watchlist 2019-04-26 11:48:01 PDT
Comment on attachment 368323 [details]
Patch

Attachment 368323 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/12007282

New failing tests:
imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-001.html
Comment 12 EWS Watchlist 2019-04-26 11:48:03 PDT
Created attachment 368341 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 13 Javier Fernandez 2019-04-29 03:42:10 PDT
Created attachment 368447 [details]
Patch

Patch rebased
Comment 14 Javier Fernandez 2019-04-29 04:24:20 PDT
Created attachment 368448 [details]
Patch

Fixed bugs in SimpleLayoutLine codepath
Comment 15 Javier Fernandez 2019-04-29 05:13:50 PDT
Created attachment 368449 [details]
Patch

Fixed errors in TestExpectations
Comment 16 WebKit Commit Bot 2019-04-29 12:57:02 PDT
Comment on attachment 368449 [details]
Patch

Clearing flags on attachment: 368449

Committed r244748: <https://trac.webkit.org/changeset/244748>
Comment 17 WebKit Commit Bot 2019-04-29 12:57:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 18 Radar WebKit Bug Importer 2019-04-29 12:58:16 PDT
<rdar://problem/50307483>