mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Auto merge of #13414 - flacerdk:master, r=mbrubeck
Implement `word-break: keep-all` (#9673) <!-- Please describe your changes on the following line: --> Implement the `keep-all` value for the `word-break` property, as specified in [CSS](https://drafts.csswg.org/css-text-3/#word-break-property). The relevant CSSWG tests (in `tests/wpt/css-tests/css-text-3_dev/html/word-break-keep-all-*.htm`) do not currently pass. As far as I can tell, this is because the tests use some JavaScript code that is not working properly. (But then, it seems that most tests in this directory are failing at the moment. I'm not sure what can be done here for now.) --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #9673. <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13414) <!-- Reviewable:end -->
This commit is contained in:
commit
c9442346d3
15 changed files with 282 additions and 13 deletions
|
@ -5970,6 +5970,54 @@
|
|||
"url": "/_mozilla/css/width_nonreplaced_block_simple_a.html"
|
||||
}
|
||||
],
|
||||
"css/word-break-keep-all-005.htm": [
|
||||
{
|
||||
"path": "css/word-break-keep-all-005.htm",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/word-break-keep-all-ref-005.htm",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/word-break-keep-all-005.htm"
|
||||
}
|
||||
],
|
||||
"css/word-break-keep-all-006.htm": [
|
||||
{
|
||||
"path": "css/word-break-keep-all-006.htm",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/word-break-keep-all-ref-006.htm",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/word-break-keep-all-006.htm"
|
||||
}
|
||||
],
|
||||
"css/word-break-keep-all-007.htm": [
|
||||
{
|
||||
"path": "css/word-break-keep-all-007.htm",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/word-break-keep-all-ref-007.htm",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/word-break-keep-all-007.htm"
|
||||
}
|
||||
],
|
||||
"css/word-break-keep-all-008.htm": [
|
||||
{
|
||||
"path": "css/word-break-keep-all-008.htm",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/word-break-keep-all-ref-008.htm",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/word-break-keep-all-008.htm"
|
||||
}
|
||||
],
|
||||
"css/word-spacing.html": [
|
||||
{
|
||||
"path": "css/word-spacing.html",
|
||||
|
@ -19632,6 +19680,54 @@
|
|||
"url": "/_mozilla/css/width_nonreplaced_block_simple_a.html"
|
||||
}
|
||||
],
|
||||
"css/word-break-keep-all-005.htm": [
|
||||
{
|
||||
"path": "css/word-break-keep-all-005.htm",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/word-break-keep-all-ref-005.htm",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/word-break-keep-all-005.htm"
|
||||
}
|
||||
],
|
||||
"css/word-break-keep-all-006.htm": [
|
||||
{
|
||||
"path": "css/word-break-keep-all-006.htm",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/word-break-keep-all-ref-006.htm",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/word-break-keep-all-006.htm"
|
||||
}
|
||||
],
|
||||
"css/word-break-keep-all-007.htm": [
|
||||
{
|
||||
"path": "css/word-break-keep-all-007.htm",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/word-break-keep-all-ref-007.htm",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/word-break-keep-all-007.htm"
|
||||
}
|
||||
],
|
||||
"css/word-break-keep-all-008.htm": [
|
||||
{
|
||||
"path": "css/word-break-keep-all-008.htm",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/word-break-keep-all-ref-008.htm",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/word-break-keep-all-008.htm"
|
||||
}
|
||||
],
|
||||
"css/word-spacing.html": [
|
||||
{
|
||||
"path": "css/word-spacing.html",
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[word-break-keep-all-008.htm]
|
||||
type: reftest
|
||||
expected: FAIL
|
24
tests/wpt/mozilla/tests/css/word-break-keep-all-005.htm
Normal file
24
tests/wpt/mozilla/tests/css/word-break-keep-all-005.htm
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<title>word-break: keep-all, latin</title>
|
||||
<meta content="word-break: keep-all means breaking is forbidden within 'words'." name="assert">
|
||||
<link href="https://drafts.csswg.org/css-text-3/#word-break-property" rel="help">
|
||||
<link href="word-break-keep-all-ref-005.htm" rel="match">
|
||||
<link href="mailto:ishida@w3.org" rel="author" title="Richard Ishida">
|
||||
<style type="text/css">
|
||||
.test { word-break: keep-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="test"><div id="testdiv"><span id="testspan">Latin latin latin latin</span></div></div>
|
||||
<div class="ref"><span>Latin latin latin<br>latin</span></div>
|
||||
<script>
|
||||
var sentenceWidth = document.getElementById('testspan').getBoundingClientRect().width;
|
||||
document.getElementById('testdiv').style.width = String(sentenceWidth - 5)+'px'
|
||||
</script>
|
||||
|
||||
</body></html>
|
23
tests/wpt/mozilla/tests/css/word-break-keep-all-006.htm
Normal file
23
tests/wpt/mozilla/tests/css/word-break-keep-all-006.htm
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<title>word-break: keep-all, japanese</title>
|
||||
<meta content="word-break: keep-all means breaking is forbidden within 'words'. In this style, sequences of CJK characters do not break." name="assert">
|
||||
<link href="https://drafts.csswg.org/css-text-3/#word-break-property" rel="help">
|
||||
<link href="word-break-keep-all-ref-006.htm" rel="match">
|
||||
<style type="text/css">
|
||||
.test { word-break: keep-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 lang="ja" class="test"><div id="testdiv"><span id="testspan">日本語 日本語 日本語</span></div></div>
|
||||
<div lang="ja" class="ref"><span>日本語 日本語<br>日本語</span></div>
|
||||
<script>
|
||||
var sentenceWidth = document.getElementById('testspan').getBoundingClientRect().width;
|
||||
document.getElementById('testdiv').style.width = String(sentenceWidth - 5)+'px'
|
||||
</script>
|
||||
|
||||
</body></html>
|
23
tests/wpt/mozilla/tests/css/word-break-keep-all-007.htm
Normal file
23
tests/wpt/mozilla/tests/css/word-break-keep-all-007.htm
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<title>word-break: keep-all, korean</title>
|
||||
<meta content="word-break: keep-all means breaking is forbidden within 'words'. In this style, sequences of CJK characters do not break." name="assert">
|
||||
<link href="https://drafts.csswg.org/css-text-3/#word-break-property" rel="help">
|
||||
<link href="word-break-keep-all-ref-007.htm" rel="match">
|
||||
<style type="text/css">
|
||||
.test { word-break: keep-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 lang="ko" class="test"><div id="testdiv"><span id="testspan">한글이 한글이 한글이</span></div></div>
|
||||
<div lang="ko" class="ref"><span>한글이 한글이<br>한글이</span></div>
|
||||
<script>
|
||||
var sentenceWidth = document.getElementById('testspan').getBoundingClientRect().width;
|
||||
document.getElementById('testdiv').style.width = String(sentenceWidth - 5)+'px'
|
||||
</script>
|
||||
|
||||
</body></html>
|
23
tests/wpt/mozilla/tests/css/word-break-keep-all-008.htm
Normal file
23
tests/wpt/mozilla/tests/css/word-break-keep-all-008.htm
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<title>word-break: keep-all, thai</title>
|
||||
<meta content="word-break: keep-all means breaking is forbidden within 'words', except where opportunities exist due to dictionary-based breaking (such as in Thai)." name="assert">
|
||||
<link href="https://drafts.csswg.org/css-text-3/#word-break-property" rel="help">
|
||||
<link href="word-break-keep-all-ref-008.htm" rel="match">
|
||||
<style type="text/css">
|
||||
.test { word-break: keep-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 lang="th" class="test"><div id="testdiv"><span id="testspan">แและ แและแและ</span></div></div>
|
||||
<div lang="th" class="ref"><span>แและ แและ<br>แและ</span></div>
|
||||
<script>
|
||||
var sentenceWidth = document.getElementById('testspan').getBoundingClientRect().width;
|
||||
document.getElementById('testdiv').style.width = String(sentenceWidth - 5)+'px'
|
||||
</script>
|
||||
|
||||
</body></html>
|
17
tests/wpt/mozilla/tests/css/word-break-keep-all-ref-005.htm
Normal file
17
tests/wpt/mozilla/tests/css/word-break-keep-all-ref-005.htm
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<title>word-break: keep-all, latin</title>
|
||||
<link href="mailto:ishida@w3.org" rel="author" title="Richard Ishida">
|
||||
<style type="text/css">
|
||||
.test { word-break: keep-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<br>latin</span></div>
|
||||
<div class="ref"><span>Latin latin latin<br>latin</span></div>
|
||||
|
||||
</body></html>
|
17
tests/wpt/mozilla/tests/css/word-break-keep-all-ref-006.htm
Normal file
17
tests/wpt/mozilla/tests/css/word-break-keep-all-ref-006.htm
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<title>word-break: keep-all, japanese</title>
|
||||
<link href="mailto:ishida@w3.org" rel="author" title="Richard Ishida">
|
||||
<style type="text/css">
|
||||
.test { word-break: keep-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 lang="ja" class="ref"><span>日本語 日本語<br>日本語</span></div>
|
||||
<div lang="ja" class="ref"><span>日本語 日本語<br>日本語</span></div>
|
||||
|
||||
</body></html>
|
17
tests/wpt/mozilla/tests/css/word-break-keep-all-ref-007.htm
Normal file
17
tests/wpt/mozilla/tests/css/word-break-keep-all-ref-007.htm
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<title>word-break: keep-all, korean</title>
|
||||
<link href="mailto:ishida@w3.org" rel="author" title="Richard Ishida">
|
||||
<style type="text/css">
|
||||
.test { word-break: keep-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 lang="ko" class="ref"><span>한글이 한글이<br>한글이</span></div>
|
||||
<div lang="ko" class="ref"><span>한글이 한글이<br>한글이</span></div>
|
||||
|
||||
</body></html>
|
17
tests/wpt/mozilla/tests/css/word-break-keep-all-ref-008.htm
Normal file
17
tests/wpt/mozilla/tests/css/word-break-keep-all-ref-008.htm
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<title>word-break: keep-all, thai</title>
|
||||
<link href="mailto:ishida@w3.org" rel="author" title="Richard Ishida">
|
||||
<style type="text/css">
|
||||
.test { word-break: keep-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 lang="th" class="ref"><span>แและ แและ<br>แและ</span></div>
|
||||
<div lang="th" class="ref"><span>แและ แและ<br>แและ</span></div>
|
||||
|
||||
</body></html>
|
Loading…
Add table
Add a link
Reference in a new issue