Implement "line-break: anywhere"
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 13:20:54 +0000 (13:20 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 13:20:54 +0000 (13:20 +0000)
commita2d3623367e36c9f81ce0cc376238c06b7620786
tree93f7fdcd1d7da9ee9c7d8b2f8bc060318b5d8cf7
parent67c39303b49149dde24fcdc441676bc847920cb3
Implement "line-break: anywhere"
https://bugs.webkit.org/show_bug.cgi?id=181169
<rdar://problem/48507088>

Reviewed by Myles C. Maxfield.

LayoutTests/imported/w3c:

New tests to verify the new line-break: anywhere feature and how
it behaves different to 'word-break: break-all'.

* web-platform-tests/css/css-text/line-break/line-break-anywhere-001.html:
* web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html:
* web-platform-tests/css/css-text/line-break/line-break-anywhere-003-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-004-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-005-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-006-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-007-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-008-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-009-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-010-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-011-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-012-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html: Added.
* web-platform-tests/css/css-text/parsing/line-break-valid-expected.txt:
* web-platform-tests/css/css-text/word-break/word-break-break-all-016-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-016.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-017-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-017.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-018-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-018.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-019-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-019.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-021-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-021.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-022-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-022.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-023-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-023.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-024-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-024.html: Added.

Source/WebCore:

The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] https://github.com/w3c/csswg-drafts/issues/1171

Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator LineBreak const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/BreakLines.h:
(WebCore::nextBreakablePositionBreakCharacter):
(WebCore::isBreakable):
* rendering/RenderText.cpp:
(WebCore::mapLineBreakToIteratorMode):
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

Some of the new tests added to verify the new 'line-break:
anywhere' feature and its different behavior to what 'word-break:
break-all' may provide, fail due to several bugs present in
current WebKit's trunk.

* TestExpectations:
  - webkit.org/b/197409
  - webkit.org/b/197411
  - webkit.org/b/197411
  - webkit.org/b/197430

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
51 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-001.html
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/line-break-valid-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperties.json
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/parser/CSSParserFastPaths.cpp
Source/WebCore/rendering/BreakLines.h
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/line/BreakingContext.h
Source/WebCore/rendering/style/RenderStyleConstants.h