Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement `word-break: keep-all` (#9673) #13414

Merged
merged 4 commits into from Sep 30, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

add tests

  • Loading branch information
flacerdk committed Sep 27, 2016
commit 44c26e014aceec8ab45d419619b5f321779618f2
@@ -17,3 +17,4 @@

[HTMLOptionsCollection.add method insert HTMLOptionElement Option element]
expected: FAIL

@@ -5946,6 +5946,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",
"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
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.