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: http://svn.webkit.org/repository/webkit/trunk@245275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 604e407..563df33 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
+2019-05-14 Javier Fernandez <jfernandez@igalia.com>
+
+ Implement "line-break: anywhere"
+ https://bugs.webkit.org/show_bug.cgi?id=181169
+ <rdar://problem/48507088>
+
+ Reviewed by Myles C. Maxfield.
+
+ 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
+
2019-05-13 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] When running layout tests that tap in the same location, subsequent tests fail to fire click handlers
diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations
index cdf8129..b17e22e 100644
--- a/LayoutTests/TestExpectations
+++ b/LayoutTests/TestExpectations
@@ -1990,6 +1990,14 @@
webkit.org/b/197277 imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-004.html [ ImageOnlyFailure ]
webkit.org/b/197277 imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-005.html [ ImageOnlyFailure ]
+webkit.org/b/197409 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html [ ImageOnlyFailure ]
+webkit.org/b/197409 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html [ ImageOnlyFailure ]
+webkit.org/b/197411 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html [ ImageOnlyFailure ]
+webkit.org/b/197411 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html [ ImageOnlyFailure ]
+webkit.org/b/197411 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html [ ImageOnlyFailure ]
+webkit.org/b/197430 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html [ ImageOnlyFailure ]
+webkit.org/b/197430 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html [ ImageOnlyFailure ]
+
########################################
### START OF display: contents failures
diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog
index 0a05cee..cf295ec 100644
--- a/LayoutTests/imported/w3c/ChangeLog
+++ b/LayoutTests/imported/w3c/ChangeLog
@@ -1,3 +1,54 @@
+2019-05-14 Javier Fernandez <jfernandez@igalia.com>
+
+ Implement "line-break: anywhere"
+ https://bugs.webkit.org/show_bug.cgi?id=181169
+ <rdar://problem/48507088>
+
+ Reviewed by Myles C. Maxfield.
+
+ 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.
+
2019-05-07 Antoine Quint <graouts@apple.com>
[Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-001.html
index 001fe26..a031765 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-001.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-001.html
@@ -1,8 +1,9 @@
-<!DOCTYPE html>
+<!DOCTYPE html>
<html lang=en>
<meta charset="utf-8">
<title>CSS Text Test: line-break: anywhere</title>
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
<link rel="match" href="reference/line-break-anywhere-001-ref.html">
<meta name="flags" content="">
@@ -28,5 +29,5 @@
<p>Test passes if there is a green rectangle below and no red.</p>
<div id=green></div>
-<!-- with line breaks everywhere, none of the following characters should stick out from under the green div -->
+<!-- with line breaks everywhere, none of the following characters should stick out from under the green div -->
<div id=test>aa-a.a)a,a)a aa⁠a‍a・a</div>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html
index bf53a85..ddbf554 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html
@@ -1,8 +1,9 @@
-<!DOCTYPE html>
+<!DOCTYPE html>
<html lang=en>
<meta charset="utf-8">
<title>CSS Text Test: line-break: anywhere</title>
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
<link rel="match" href="reference/line-break-anywhere-001-ref.html">
<meta name="flags" content="">
@@ -21,12 +22,12 @@
color: red;
font-family: monospace;
line-break: anywhere;
- -webkit-hyphens: auto;
+ hyphens: auto;
}
</style>
<p>Test passes if there is a green rectangle below and no red.</p>
<div id=green></div>
-<!-- Hyphenation, if it occurs, will produce a hyphen that sticks out from under the green rectangle.
- Also, if the words fails to be wrapped between all letters, letters will also stick out from under the green rectangle -->
+<!-- Hyphenation, if it occurs, will produce a hyphen that sticks out from under the green rectangle.
+ Also, if the words fails to be wrapped between all letters, letters will also stick out from under the green rectangle -->
<div id=test>no hyphenation</div>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003-expected.html
new file mode 100644
index 0000000..ceec198
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003-expected.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8">
+<title>word-break: break-all, latin</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<style type='text/css'>
+.test { word-break: break-all; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; padding: 10px; width: 390px; font: 36px/1 sans-serif; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the two orange boxes are the same.</div>
+<div class="ref"><span>Latin latin latin lati<br/>n</span></div>
+<div class="ref"><span>Latin latin latin lati<br/>n</span></div>
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
new file mode 100644
index 0000000..c1d1777
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang=en>
+<meta charset="utf-8">
+<title>CSS Text Test: line-break: anywhere</title>
+<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" />
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<link rel="match" href="reference/line-break-anywhere-003-ref.html">
+<meta name="flags" content="">
+<meta name="assert" content="line-break: anywhere means lines may break between any two typographic letter units.">
+<style type='text/css'>
+.test { line-break: anywhere; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; padding: 10px; width: 390px; font: 36px/1 sans-serif; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the two orange boxes are the same.</div>
+<div class="test"><div id="testdiv"><span id="testspan">Latin latin latin latin</span></div></div>
+<div class="ref"><span>Latin latin latin lati<br/>n</span></div>
+<script>
+var sentenceWidth = document.getElementById('testspan').offsetWidth
+document.getElementById('testdiv').style.width = String(sentenceWidth - 5)+'px'
+</script>
+</body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
new file mode 100644
index 0000000..95b73c2
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: line-break: anywhere</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-keep-all">
+<meta name="flags" content="">
+<link rel="match" href="reference/line-break-anywhere-004-ref.html">
+<meta name="assert" content="The second word is broken, despite the word-break: keep-all, because line-break: anywhere disregarde any prohibition against line breaks mandate by word-break.">
+<style>
+div {
+ position: relative;
+ font-size: 25px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 4ch;
+ line-height: 1;
+ word-break: keep-all;
+ line-break: anywhere;
+}
+</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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
new file mode 100644
index 0000000..7c9c617
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: overflow-wrap:break-word + white-space:break-spaces</title>
+<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" />
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<link rel="match" href="reference/line-break-anywhere-004-ref.html">
+<meta name="assert" content="line-break: anywhere + break-spaces do allow a break
+between the last character of a word and the first space of a sequence of preserved
+spaces even if there is a previous breaking opportunity">
+<style>
+div {
+ font: 25px/1 Ahem;
+ width: 4ch;
+ line-height: 1;
+}
+.red {
+ position: absolute;
+ white-space: pre;
+ color: red;
+ background: green;
+ z-index: -1;
+}
+.test {
+ white-space: break-spaces;
+ line-break: anywhere;
+ color: green;
+}
+</style>
+<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+<div class="red">X XX<br> XX <br>X XX<br> X</div>
+<div class="test">X XX XX X XX X</div>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
new file mode 100644
index 0000000..874846c
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: line-break: anywhere</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<meta name="flags" content="">
+<link rel="match" href="reference/line-break-anywhere-004-ref.html">
+<meta name="assert" content="line-break: anywhere' disgregard the prohibition against line breaks introduced by characters with the GL character class">
+<style>
+div {
+ position: relative;
+ font-size: 25px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 4ch;
+ line-break: anywhere;
+}
+</style>
+<body>
+ <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+ <div class="red">XXXX<br> XXX<br>X X <br>X</div>
+ <div class="test">XXXX XXXX X X</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
new file mode 100644
index 0000000..9f097ee
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<meta name="flags" content="">
+<link rel="match" href="reference/line-break-anywhere-004-ref.html">
+<meta name="assert" content="line-break:anywhere allows breaking opportunities around punctuaction characters.">
+<style>
+div {
+ position: relative;
+ font-size: 20px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 5ch;
+ line-break: anywhere;
+}
+</style>
+<body>
+ <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+ <div class="red">X XXX<br>XX</div>
+ <div class="test">X XX...</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
new file mode 100644
index 0000000..c103109
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
@@ -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="mailto:jfernandez@igalia.com">
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<meta name="flags" content="">
+<link rel="match" href="reference/line-break-anywhere-004-ref.html">
+<meta name="assert" content="break-all breaks between the last two letters, because breaking opportunities between the punctuaction characters are forbidden.">
+<style>
+div {
+ position: relative;
+ font-size: 20px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 5ch;
+ white-space: pre-wrap;
+ line-break: anywhere;
+}
+</style>
+<body>
+ <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+ <div class="red">X XXX<br>XX</div>
+ <div class="test">X XX...</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
new file mode 100644
index 0000000..7beba06
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: line-break: anywhere</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<meta name="flags" content="">
+<link rel="match" href="reference/line-break-anywhere-004-ref.html">
+<meta name="assert" content="line-break: anywhere' disgregard the prohibition against line breaks introduced by characters with the GL character class">
+<style>
+div {
+ position: relative;
+ font-size: 25px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 4ch;
+ white-space: break-spaces;
+ line-break: anywhere;
+}
+</style>
+<body>
+ <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+ <div class="red">XXXX<br> XXX<br>X X <br>X</div>
+ <div class="test">XXXX XXXX X X</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
new file mode 100644
index 0000000..2e0c717
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: line-break: anywhere</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<meta name="flags" content="">
+<link rel="match" href="reference/line-break-anywhere-004-ref.html">
+<meta name="assert" content="line-break: anywhere' disgregard the prohibition against line breaks introduced by characters with the GL character class">
+<style>
+div {
+ position: relative;
+ font-size: 25px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 4ch;
+ white-space: break-spaces;
+ line-break: anywhere;
+}
+</style>
+<body>
+ <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+ <div class="red">XXXX<br> XXX<br>X X <br>X</div>
+ <div class="test">XXXX XXXX X X</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
new file mode 100644
index 0000000..acc46db
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<meta name="flags" content="">
+<link rel="match" href="reference/line-break-anywhere-004-ref.html">
+<meta name="assert" content="line-break:anywhere allows breaking opportunities around slash characters.">
+<style>
+div {
+ position: relative;
+ font-size: 20px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 5ch;
+ line-break: anywhere;
+}
+</style>
+<body>
+ <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+ <div class="red">X XXX<br>XX</div>
+ <div class="test">X XX///</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
new file mode 100644
index 0000000..e2c5d36
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="5.3. Line Breaking Strictness: the line-break property" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere">
+<meta name="flags" content="">
+<link rel="match" href="reference/line-break-anywhere-004-ref.html">
+<meta name="assert" content="line-break:anywhere allows breaking opportunities around slash characters.">
+<style>
+div {
+ position: relative;
+ font-size: 20px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 5ch;
+ line-break: anywhere;
+}
+</style>
+<body>
+ <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+ <div class="red">X XXX<br>XX</div>
+ <div class="test">X XX\\\</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/line-break-valid-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/line-break-valid-expected.txt
index 7db3162..a84fd8a 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/line-break-valid-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/line-break-valid-expected.txt
@@ -3,5 +3,5 @@
PASS e.style['line-break'] = "loose" should set the property value
PASS e.style['line-break'] = "normal" should set the property value
PASS e.style['line-break'] = "strict" should set the property value
-FAIL e.style['line-break'] = "anywhere" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['line-break'] = "anywhere" should set the property value
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
new file mode 100644
index 0000000..8917d42
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<meta name="flags" content="">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="break-all breaks between the last two letters, because breaking opportunities between the punctuaction characters are forbidden.">
+<style>
+div {
+ position: relative;
+ font-size: 20px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 8ch;
+ 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 XX<br>XXXX</div>
+ <div class="test">XX XXX...</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
new file mode 100644
index 0000000..6cf3be6
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<meta name="flags" content="ahem">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="break-all + break-spaces do not allow a break
+between the last character of a word and the first space of a sequence of preserved spaces
+if there are other wrapping opportunities earlier in the line.">
+<style>
+div {
+ font: 25px/1 Ahem;
+ width: 4ch;
+}
+.red {
+ position: absolute;
+ white-space: pre;
+ color: red;
+ background: green;
+ z-index: -1;
+}
+.test {
+ white-space: break-spaces;
+ word-break: break-all;
+ color: green;
+}
+</style>
+<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
+<div class="red">X<br>XX X<br>X X <br>XX X</div>
+<div class="test">X XX XX X XX X</div>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
new file mode 100644
index 0000000..be092be
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="word-break: break-all' must honors line breaking behavior introduced by characters with the GL character class">
+<style>
+div {
+ position: relative;
+ font-size: 25px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 4ch;
+ 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">XXX <br>X XX<br>XX X<br>X</div>
+ <div class="test">XXXX XXXX X X</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
new file mode 100644
index 0000000..66dba54
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="break-all breaks between the last two letters, because breaking opportunities between the punctuaction characters are forbidden.">
+<style>
+div {
+ position: relative;
+ font-size: 20px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 8ch;
+ 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 XX<br>XXXX</div>
+ <div class="test">XX XXX...</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
new file mode 100644
index 0000000..80f2dda
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="word-break: break-all' must honor line breaking behavior introduced by characters with the GL character class">
+<style>
+div {
+ position: relative;
+ font-size: 25px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 4ch;
+ 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">XXX <br>X XX<br>XX X<br>X</div>
+ <div class="test">XXXX XXXX X X</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
new file mode 100644
index 0000000..73e8503
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://www.w3.org/TR/css-text-3/#white-space-property">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="word-break: break-all' must honor line breaking behavior introduced by characters with the GL character class">
+<style>
+div {
+ position: relative;
+ font-size: 25px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 4ch;
+ white-space: break-spaces;
+ 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">XXX <br>X XX<br>XX <br>X X</div>
+ <div class="test">XXXX XXXX X X</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
new file mode 100644
index 0000000..7ade96e
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<meta name="flags" content="">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="break-all breaks between the last two letters, because breaking opportunities between the backslashes characters are forbidden.">
+<style>
+div {
+ position: relative;
+ font-size: 20px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 8ch;
+ 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 XXX<br>XXXX</div>
+ <div class="test">XX XXX\\\</div>
+</body>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024-expected.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024-expected.html
new file mode 100644
index 0000000..0e0300a
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024-expected.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference File</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<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>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html
new file mode 100644
index 0000000..f114d94
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: word-break: break-all</title>
+<link rel="author" title="Javier Fernandez Garcia-Boente" href="mailto:jfernandez@igalia.com">
+<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-break-all">
+<meta name="flags" content="">
+<link rel="match" href="reference/word-break-break-all-010-ref.html">
+<meta name="assert" content="break-all breaks between the last two letters, because breaking opportunities between the slashes characters are forbidden.">
+<style>
+div {
+ position: relative;
+ font-size: 20px;
+ font-family: Ahem;
+ line-height: 1em;
+}
+.red {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+ color: red;
+ z-index: -1;
+}
+.test {
+ color: green;
+ width: 8ch;
+ 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 XX<br>XXXX</div>
+ <div class="test">XX XXX///</div>
+</body>
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index ec1fd07..4abfecf 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,53 @@
+2019-05-14 Javier Fernandez <jfernandez@igalia.com>
+
+ Implement "line-break: anywhere"
+ https://bugs.webkit.org/show_bug.cgi?id=181169
+ <rdar://problem/48507088>
+
+ Reviewed by Myles C. Maxfield.
+
+ 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:
+
2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, build fix after 245258, missing ThreadSpecific.h include
diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h
index 24370cf..f608cfe 100644
--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h
@@ -1644,6 +1644,9 @@
case LineBreak::AfterWhiteSpace:
m_value.valueID = CSSValueAfterWhiteSpace;
break;
+ case LineBreak::Anywhere:
+ m_value.valueID = CSSValueAnywhere;
+ break;
}
}
@@ -1685,6 +1688,8 @@
return LineBreak::Strict;
case CSSValueAfterWhiteSpace:
return LineBreak::AfterWhiteSpace;
+ case CSSValueAnywhere:
+ return LineBreak::Anywhere;
default:
break;
}
diff --git a/Source/WebCore/css/CSSProperties.json b/Source/WebCore/css/CSSProperties.json
index d7c7656..1d9b6b8 100644
--- a/Source/WebCore/css/CSSProperties.json
+++ b/Source/WebCore/css/CSSProperties.json
@@ -5547,7 +5547,8 @@
"value": "after-white-space",
"status": "non-standard",
"comment": "Added in https://trac.webkit.org/changeset/7763"
- }
+ },
+ "anywhere"
],
"specification": {
"category": "css-text",
diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in
index aa2d854..5afe356 100644
--- a/Source/WebCore/css/CSSValueKeywords.in
+++ b/Source/WebCore/css/CSSValueKeywords.in
@@ -789,6 +789,7 @@
// normal
strict
after-white-space
+anywhere
// -webkit-appearance
// The order here must match the order in the ControlPart enum in ThemeTypes.h.
diff --git a/Source/WebCore/css/parser/CSSParserFastPaths.cpp b/Source/WebCore/css/parser/CSSParserFastPaths.cpp
index 72c5867..a0a0e31 100644
--- a/Source/WebCore/css/parser/CSSParserFastPaths.cpp
+++ b/Source/WebCore/css/parser/CSSParserFastPaths.cpp
@@ -731,8 +731,8 @@
return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueAntialiased || valueID == CSSValueSubpixelAntialiased;
case CSSPropertyWebkitLineAlign:
return valueID == CSSValueNone || valueID == CSSValueEdges;
- case CSSPropertyLineBreak: // auto | loose | normal | strict | after-white-space
- return valueID == CSSValueAuto || valueID == CSSValueLoose || valueID == CSSValueNormal || valueID == CSSValueStrict || valueID == CSSValueAfterWhiteSpace;
+ case CSSPropertyLineBreak: // auto | loose | normal | strict | after-white-space | anywhere
+ return valueID == CSSValueAuto || valueID == CSSValueLoose || valueID == CSSValueNormal || valueID == CSSValueStrict || valueID == CSSValueAfterWhiteSpace || valueID == CSSValueAnywhere;
case CSSPropertyWebkitLineSnap:
return valueID == CSSValueNone || valueID == CSSValueBaseline || valueID == CSSValueContain;
case CSSPropertyWebkitMarginAfterCollapse:
diff --git a/Source/WebCore/rendering/BreakLines.h b/Source/WebCore/rendering/BreakLines.h
index b85148b..0539c6a 100644
--- a/Source/WebCore/rendering/BreakLines.h
+++ b/Source/WebCore/rendering/BreakLines.h
@@ -187,12 +187,25 @@
return nextBreakablePosition<UChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace, CanUseShortcut::No>(lazyBreakIterator, stringView.characters16(), stringView.length(), startPosition);
}
-inline bool isBreakable(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition, Optional<unsigned>& nextBreakable, bool breakNBSP, bool canUseShortcut, bool keepAllWords)
+inline unsigned nextBreakablePositionBreakCharacter(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition)
+{
+ auto stringView = lazyBreakIterator.stringView();
+ ASSERT(startPosition <= stringView.length());
+ // FIXME: Can/Should we implement this using a Shared Iterator (performance issue)
+ // https://bugs.webkit.org/show_bug.cgi?id=197876
+ NonSharedCharacterBreakIterator iterator(stringView);
+ Optional<unsigned> next = ubrk_following(iterator, startPosition);
+ return next.valueOr(stringView.length());
+}
+
+inline bool isBreakable(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition, Optional<unsigned>& nextBreakable, bool breakNBSP, bool canUseShortcut, bool keepAllWords, bool breakAnywhere)
{
if (nextBreakable && nextBreakable.value() >= startPosition)
return startPosition == nextBreakable;
- if (keepAllWords) {
+ if (breakAnywhere)
+ nextBreakable = nextBreakablePositionBreakCharacter(lazyBreakIterator, startPosition);
+ else if (keepAllWords) {
if (breakNBSP)
nextBreakable = nextBreakablePositionKeepingAllWords(lazyBreakIterator, startPosition);
else
diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp
index 44373b6..e37f348 100644
--- a/Source/WebCore/rendering/RenderText.cpp
+++ b/Source/WebCore/rendering/RenderText.cpp
@@ -704,6 +704,7 @@
switch (lineBreak) {
case LineBreak::Auto:
case LineBreak::AfterWhiteSpace:
+ case LineBreak::Anywhere:
return LineBreakIteratorMode::Default;
case LineBreak::Loose:
return LineBreakIteratorMode::Loose;
@@ -828,6 +829,7 @@
// Note the deliberate omission of word-wrap and overflow-wrap from this breakAll check. Those
// do not affect minimum preferred sizes. Note that break-word is a non-standard value for
// word-break, but we support it as though it means break-all.
+ bool breakAnywhere = style.lineBreak() == LineBreak::Anywhere && style.autoWrap();
bool breakAll = (style.wordBreak() == WordBreak::BreakAll || style.wordBreak() == WordBreak::BreakWord) && style.autoWrap();
bool keepAllWords = style.wordBreak() == WordBreak::KeepAll;
bool canUseLineBreakShortcut = iteratorMode == LineBreakIteratorMode::Default;
@@ -876,7 +878,7 @@
continue;
}
- bool hasBreak = breakAll || isBreakable(breakIterator, i, nextBreakable, breakNBSP, canUseLineBreakShortcut, keepAllWords);
+ bool hasBreak = breakAll || isBreakable(breakIterator, i, nextBreakable, breakNBSP, canUseLineBreakShortcut, keepAllWords, breakAnywhere);
bool betweenWords = true;
unsigned j = i;
while (c != '\n' && !isSpaceAccordingToStyle(c, style) && c != '\t' && (c != softHyphen || style.hyphens() == Hyphens::None)) {
@@ -884,7 +886,7 @@
if (j == length)
break;
c = string[j];
- if (isBreakable(breakIterator, j, nextBreakable, breakNBSP, canUseLineBreakShortcut, keepAllWords) && characterAt(j - 1) != softHyphen)
+ if (isBreakable(breakIterator, j, nextBreakable, breakNBSP, canUseLineBreakShortcut, keepAllWords, breakAnywhere) && characterAt(j - 1) != softHyphen)
break;
if (breakAll) {
betweenWords = false;
diff --git a/Source/WebCore/rendering/line/BreakingContext.h b/Source/WebCore/rendering/line/BreakingContext.h
index 24010f6..d6f5ccd 100644
--- a/Source/WebCore/rendering/line/BreakingContext.h
+++ b/Source/WebCore/rendering/line/BreakingContext.h
@@ -713,7 +713,8 @@
// which is only possible if the word is the first thing on the line.
bool breakWords = m_currentStyle->breakWords() && ((m_autoWrap && (!m_width.committedWidth() && !m_width.hasCommittedReplaced())) || m_currWS == WhiteSpace::Pre);
bool midWordBreak = false;
- bool breakAll = m_currentStyle->wordBreak() == WordBreak::BreakAll && m_autoWrap;
+ bool breakAnywhere = m_currentStyle->lineBreak() == LineBreak::Anywhere && m_autoWrap;
+ bool breakAll = (m_currentStyle->wordBreak() == WordBreak::BreakAll || breakAnywhere) && m_autoWrap;
bool keepAllWords = m_currentStyle->wordBreak() == WordBreak::KeepAll;
float hyphenWidth = 0;
auto iteratorMode = mapLineBreakToIteratorMode(m_blockStyle.lineBreak());
@@ -755,7 +756,7 @@
// 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) {
- m_hasFormerOpportunity = true;
+ m_hasFormerOpportunity = !breakAnywhere;
breakWords = false;
canBreakMidWord = breakAll;
}
@@ -790,7 +791,7 @@
}
Optional<unsigned> nextBreakablePosition = m_current.nextBreakablePosition();
- bool betweenWords = c == '\n' || (m_currWS != WhiteSpace::Pre && !m_atStart && isBreakable(m_renderTextInfo.lineBreakIterator, m_current.offset(), nextBreakablePosition, breakNBSP, canUseLineBreakShortcut, keepAllWords)
+ bool betweenWords = c == '\n' || (m_currWS != WhiteSpace::Pre && !m_atStart && isBreakable(m_renderTextInfo.lineBreakIterator, m_current.offset(), nextBreakablePosition, breakNBSP, canUseLineBreakShortcut, keepAllWords, breakAnywhere)
&& (style.hyphens() != Hyphens::None || (m_current.previousInSameNode() != softHyphen)));
m_current.setNextBreakablePosition(nextBreakablePosition);
@@ -953,7 +954,7 @@
wrapW = wrapWidthOffset;
// Auto-wrapping text should not wrap in the middle of a word once it has had an
// opportunity to break after a word.
- m_hasFormerOpportunity = true;
+ m_hasFormerOpportunity = !breakAnywhere;
breakWords = false;
canBreakMidWord = breakAll;
}
diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h
index d78d253..64e3ce9 100644
--- a/Source/WebCore/rendering/style/RenderStyleConstants.h
+++ b/Source/WebCore/rendering/style/RenderStyleConstants.h
@@ -533,7 +533,8 @@
Loose,
Normal,
Strict,
- AfterWhiteSpace
+ AfterWhiteSpace,
+ Anywhere
};
enum class Resize : uint8_t {