Skip to content

Commit

Permalink
[css-text] Adjust test cases to match css-wg resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
frivoal committed Feb 6, 2020
1 parent 3e59c77 commit 964d265
Show file tree
Hide file tree
Showing 34 changed files with 336 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is Japanese, and line-break:loose, a browser allows a break before a hyphen.">
<meta name="assert" content="When the language is Japanese, and line-break:loose, a browser allows a break before a hyphen-like CJK characters.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: loose; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is Japanese, and line-break:normal, a browser allows a break before a hyphen.">
<meta name="assert" content="When the language is Japanese, and line-break:normal, a browser allows a break before a hyphen-like CJK characters.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: normal; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is Japanese, and line-break:strict, a browser will NOT allow a break before a hyphen.">
<meta name="assert" content="When the language is Japanese, and line-break:strict, a browser will NOT allow a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: strict; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is neither Japanese nor Chinese, and line-break:loose, a browser will NOT allow a break before a hyphen.">
<meta name="assert" content="When the language is neither Japanese nor Chinese, and line-break:loose, a browser will NOT allow a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: loose; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is neither Japanese nor Chinese, and line-break:normal, a browser will NOT allow a break before a hyphen.">
<meta name="assert" content="When the language is neither Japanese nor Chinese, and line-break:normal, a browser will NOT allow a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: normal; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is neither Japanese nor Chinese, and line-break:strict, a browser will NOT allow a break before a hyphen.">
<meta name="assert" content="When the language is neither Japanese nor Chinese, and line-break:strict, a browser will NOT allow a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: strict; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is unknown, and line-break:loose, a browser will NOT allow a break before a hyphen.">
<meta name="assert" content="When the language is unknown, and line-break:loose, a browser will NOT allow a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: loose; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is unkonwn, and line-break:normal, a browser will NOT allow a break before a hyphen.">
<meta name="assert" content="When the language is unkonwn, and line-break:normal, a browser will NOT allow a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: normal; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is unkonwn, and line-break:strict, a browser will NOT allow a break before a hyphen.">
<meta name="assert" content="When the language is unkonwn, and line-break:strict, a browser will NOT allow a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: strict; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is Chinese, and line-break:loose, a browser allows a break before a hyphen.">
<meta name="assert" content="When the language is Chinese, and line-break:loose, a browser allows a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: loose; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is Chinese, and line-break:normal, a browser allows a break before a hyphen.">
<meta name="assert" content="When the language is Chinese, and line-break:normal, a browser allows a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: normal; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="help" href="https://drafts.csswg.org/css-text-3/#line-break-property">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="assert" content="When the language is Chinese, and line-break:strict, a browser will NOT allow a break before a hyphen.">
<meta name="assert" content="When the language is Chinese, and line-break:strict, a browser will NOT allow a break before a hyphen-like CJK character.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand All @@ -21,9 +21,7 @@
.test { line-break: strict; }
</style>
<script>
var charlist = `2010 HYPHEN
2013 EN DASH
301C WAVE DASH
var charlist = `301C WAVE DASH
30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`
</script>
</head>
Expand Down
18 changes: 1 addition & 17 deletions css/css-text/line-break/line-break-loose-013.xht
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="help" title="5.3. Line Breaking Rules: the 'line-break' property" href="https://drafts.csswg.org/css-text-3/#line-break-property" />
<link rel="match" href="reference/line-break-loose-013-ref.xht" />
<meta http-equiv="content-language" content="en, ja" />
<meta name="assert" content="This test verifies that 'line-break: loose' allows line breaking before hyphens such as HYPHEN (U+2010) and ENDASH (U+2013)." />
<meta name="assert" content="This test verifies that 'line-break: loose' allows line breaking before U+301C and U+30A0." />
<style type="text/css">
@font-face
{
Expand Down Expand Up @@ -45,22 +45,6 @@
Test passes if the highlighted characters in each pair of rectangles are at the exact same horizontal position.
</p>
<!-- hyphens -->
<div class="wrapper">
<p class="test" lang="ja">
<span>サンプル文サンプル文<span class="target">&#x2010;</span>サンプル文</span>
</p>
<p class="control" lang="ja">
<span>サンプル文サンプル文<br /><span class="target">&#x2010;</span>サンプル文</span>
</p>
</div>
<div class="wrapper">
<p class="test" lang="ja">
<span>サンプル文サンプル文<span class="target">&#x2013;</span>サンプル文</span>
</p>
<p class="control" lang="ja">
<span>サンプル文サンプル文<br /><span class="target">&#x2013;</span>サンプル文</span>
</p>
</div>
<div class="wrapper">
<p class="test" lang="ja">
<span>サンプル文サンプル文<span class="target">&#x301c;</span>サンプル文</span>
Expand Down
21 changes: 21 additions & 0 deletions css/css-text/line-break/line-break-loose-hyphens-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>CSS test: hyphens and line-break:loose</title>
<link rel=author title="Florian Rivoal" href="https://florian.rivoal.net">
<link rel=help href="https://drafts.csswg.org/css-text-3/#propdef-line-break">
<link rel=match href="reference/line-break-loose-hyphens-001-ref.html">
<meta name=assert content="breaks before U+2010 or U+2013 when line-break is loose are allowed if the preceding character has class ID.">
<style>
div {
width: 2em;
line-break: loose;
border: solid cyan;
}
</style>

<p>The test passes if the second line in each box below starts with a hyphen.
(Note: the hyphens in each box do no need to be the same size.)

<div>文文‐文</div>
<div>文文–文</div>
24 changes: 24 additions & 0 deletions css/css-text/line-break/line-break-loose-hyphens-002.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>CSS test: hyphens and line-break:loose</title>
<link rel=author title="Florian Rivoal" href="https://florian.rivoal.net">
<link rel=help href="https://drafts.csswg.org/css-text-3/#propdef-line-break">
<link rel=help href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel=match href="reference/line-break-loose-hyphens-002-ref.html">
<meta name=assert content="breaks before U+2010 or U+2013 when line-break is loose are allowed if the preceding character is treated as having class ID due to word-break:break-all.">
<style>
div {
font-family: monospace;
width: 2ch;
line-break: loose;
word-break: break-all;
border: solid cyan;
}
</style>

<p>The test passes if the second line in each box below starts with a hyphen.
(Note: the hyphens in each box do no need to be the same size.)

<div>aa‐a</div>
<div>aa–a</div>
22 changes: 22 additions & 0 deletions css/css-text/line-break/line-break-loose-hyphens-003.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>CSS test: hyphens and line-break:loose</title>
<link rel=author title="Florian Rivoal" href="https://florian.rivoal.net">
<link rel=help href="https://drafts.csswg.org/css-text-3/#propdef-line-break">
<link rel=match href="reference/line-break-loose-hyphens-003-ref.html">
<meta name=assert content="breaks before U+2010 or U+2013 when line-break is loose are not allowed if the preceding character is not of line-breaking class ID.">
<style>
div {
font-family: monospace;
width: 2ch;
line-break: loose;
}
</style>

<p>The test passes if there are two lines of text below
and they both end with a hyphen.
(Note: the hyphens do no need to be the same size.)

<div>aa‐</div>
<div>aa–</div>
18 changes: 1 addition & 17 deletions css/css-text/line-break/line-break-normal-013.xht
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="help" title="5.3. Line Breaking Rules: the 'line-break' property" href="https://drafts.csswg.org/css-text-3/#line-break-property" />
<link rel="match" href="reference/line-break-normal-013-ref.xht" />
<meta http-equiv="content-language" content="en, ja" />
<meta name="assert" content="This test verifies that 'line-break: normal' allows line breaking before hyphens such as HYPHEN (U+2010) and ENDASH (U+2013)." />
<meta name="assert" content="This test verifies that 'line-break: normal' allows line breaking before U+301C and U+30A0.." />
<style type="text/css">
@font-face
{
Expand Down Expand Up @@ -45,22 +45,6 @@
Test passes if the highlighted characters in each pair of rectangles are at the exact same horizontal position.
</p>
<!-- hyphens -->
<div class="wrapper">
<p class="test" lang="ja">
<span>サンプル文サンプル文<span class="target">&#x2010;</span>サンプル文</span>
</p>
<p class="control" lang="ja">
<span>サンプル文サンプル文<br /><span class="target">&#x2010;</span>サンプル文</span>
</p>
</div>
<div class="wrapper">
<p class="test" lang="ja">
<span>サンプル文サンプル文<span class="target">&#x2013;</span>サンプル文</span>
</p>
<p class="control" lang="ja">
<span>サンプル文サンプル文<br /><span class="target">&#x2013;</span>サンプル文</span>
</p>
</div>
<div class="wrapper">
<p class="test" lang="ja">
<span>サンプル文サンプル文<span class="target">&#x301c;</span>サンプル文</span>
Expand Down
21 changes: 21 additions & 0 deletions css/css-text/line-break/line-break-normal-hyphens-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>CSS test: hyphens and line-break:normal</title>
<link rel=author title="Florian Rivoal" href="https://florian.rivoal.net">
<link rel=help href="https://drafts.csswg.org/css-text-3/#propdef-line-break">
<link rel=match href="reference/line-break-normal-hyphens-001-ref.html">
<meta name=assert content="breaks before U+2010 or U+2013 when line-break is normal are not allowed when the preceding character has class ID.">
<style>
div {
width: 2em;
line-break: normal;
border: solid cyan;
}
</style>

<p>The test passes if the second line in each box below ends with a hyphen.
(Note: the hyphens in each box do no need to be the same size.)

<div>文文‐文</div>
<div>文文–文</div>
Loading

0 comments on commit 964d265

Please sign in to comment.