Truly independent web browser
LibWeb: Import loose line-breaking coverage
Andreas Klingd6be4ec72cac
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-cpm-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-cpm-loose.txtnew file mode 100644index 00000000000..7197b64539f--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-cpm-loose.txt@@ -0,0 +1,15 @@+Harness status: OK++Found 10 tests++10 Fail+Fail 30FB KATAKANA MIDDLE DOT may appear at line start if ja and loose+Fail FF1A FULLWIDTH COLON may appear at line start if ja and loose+Fail FF1B FULLWIDTH SEMICOLON may appear at line start if ja and loose+Fail FF65 HALFWIDTH KATAKANA MIDDLE DOT may appear at line start if ja and loose+Fail 203C DOUBLE EXCLAMATION MARK may appear at line start if ja and loose+Fail 2047 DOUBLE QUESTION MARK may appear at line start if ja and loose+Fail 2048 QUESTION EXCLAMATION MARK may appear at line start if ja and loose+Fail 2049 EXCLAMATION QUESTION MARK may appear at line start if ja and loose+Fail FF01 FULLWIDTH EXCLAMATION MARK may appear at line start if ja and loose+Fail FF1F FULLWIDTH QUESTION MARK may appear at line start if ja and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-hyphens-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-hyphens-loose.txtnew file mode 100644index 00000000000..a6216eaab6d--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-hyphens-loose.txt@@ -0,0 +1,7 @@+Harness status: OK++Found 2 tests++2 Fail+Fail 301C WAVE DASH may appear at line start if ja and loose+Fail 30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN may appear at line start if ja and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-iteration-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-iteration-loose.txtnew file mode 100644index 00000000000..98d4893bc97--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-iteration-loose.txt@@ -0,0 +1,11 @@+Harness status: OK++Found 6 tests++6 Fail+Fail 3005 IDEOGRAPHIC ITERATION MARK may appear at line start if ja and loose+Fail 303B VERTICAL IDEOGRAPHIC ITERATION MARK may appear at line start if ja and loose+Fail 309D HIRAGANA ITERATION MARK may appear at line start if ja and loose+Fail 309E HIRAGANA VOICED ITERATION MARK may appear at line start if ja and loose+Fail 30FD KATAKANA ITERATION MARK may appear at line start if ja and loose+Fail 30FE KATAKANA VOICED ITERATION MARK may appear at line start if ja and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-po-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-po-loose.txtnew file mode 100644index 00000000000..aa6e8f8e90b--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-po-loose.txt@@ -0,0 +1,15 @@+Harness status: OK++Found 10 tests++10 Fail+Fail 00B0 DEGREE SIGN may appear at line start if ja and loose+Fail 2030 PER MILLE SIGN may appear at line start if ja and loose+Fail 2032 PRIME may appear at line start if ja and loose+Fail 2033 DOUBLE PRIME may appear at line start if ja and loose+Fail 2035 REVERSED PRIME may appear at line start if ja and loose+Fail 2103 DEGREE CELSIUS may appear at line start if ja and loose+Fail 2109 DEGREE FAHRENHEIT may appear at line start if ja and loose+Fail FE6A SMALL PERCENT SIGN may appear at line start if ja and loose+Fail FF05 FULLWIDTH PERCENT SIGN may appear at line start if ja and loose+Fail FFE0 FULLWIDTH CENT SIGN may appear at line start if ja and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-iteration-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-iteration-loose.txtnew file mode 100644index 00000000000..4d4d86bac10--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-iteration-loose.txt@@ -0,0 +1,11 @@+Harness status: OK++Found 6 tests++6 Fail+Fail 3005 IDEOGRAPHIC ITERATION MARK may appear at line start if de and loose+Fail 303B VERTICAL IDEOGRAPHIC ITERATION MARK may appear at line start if de and loose+Fail 309D HIRAGANA ITERATION MARK may appear at line start if de and loose+Fail 309E HIRAGANA VOICED ITERATION MARK may appear at line start if de and loose+Fail 30FD KATAKANA ITERATION MARK may appear at line start if de and loose+Fail 30FE KATAKANA VOICED ITERATION MARK may appear at line start if de and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-po-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-po-loose.txtnew file mode 100644index 00000000000..ddc15b53829--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-po-loose.txt@@ -0,0 +1,16 @@+Harness status: OK++Found 10 tests++8 Pass+2 Fail+Pass 00B0 DEGREE SIGN may NOT appear at line start if de and loose+Pass 2030 PER MILLE SIGN may NOT appear at line start if de and loose+Pass 2032 PRIME may NOT appear at line start if de and loose+Pass 2033 DOUBLE PRIME may NOT appear at line start if de and loose+Pass 2035 REVERSED PRIME may NOT appear at line start if de and loose+Pass 2103 DEGREE CELSIUS may NOT appear at line start if de and loose+Pass 2109 DEGREE FAHRENHEIT may NOT appear at line start if de and loose+Fail FE6A SMALL PERCENT SIGN may NOT appear at line start if de and loose+Pass FF05 FULLWIDTH PERCENT SIGN may NOT appear at line start if de and loose+Fail FFE0 FULLWIDTH CENT SIGN may NOT appear at line start if de and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-iteration-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-iteration-loose.txtnew file mode 100644index 00000000000..9fee00f0337--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-iteration-loose.txt@@ -0,0 +1,11 @@+Harness status: OK++Found 6 tests++6 Fail+Fail 3005 IDEOGRAPHIC ITERATION MARK may appear at line start if lang unknown and loose+Fail 303B VERTICAL IDEOGRAPHIC ITERATION MARK may appear at line start if lang unknown and loose+Fail 309D HIRAGANA ITERATION MARK may appear at line start if lang unknown and loose+Fail 309E HIRAGANA VOICED ITERATION MARK may appear at line start if lang unknown and loose+Fail 30FD KATAKANA ITERATION MARK may appear at line start if lang unknown and loose+Fail 30FE KATAKANA VOICED ITERATION MARK may appear at line start if lang unknown and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-po-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-po-loose.txtnew file mode 100644index 00000000000..882eac38794--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-po-loose.txt@@ -0,0 +1,16 @@+Harness status: OK++Found 10 tests++8 Pass+2 Fail+Pass 00B0 DEGREE SIGN may NOT appear at line start if loose+Pass 2030 PER MILLE SIGN may NOT appear at line start if loose+Pass 2032 PRIME may NOT appear at line start if loose+Pass 2033 DOUBLE PRIME may NOT appear at line start if loose+Pass 2035 REVERSED PRIME may NOT appear at line start if loose+Pass 2103 DEGREE CELSIUS may NOT appear at line start if loose+Pass 2109 DEGREE FAHRENHEIT may NOT appear at line start if loose+Fail FE6A SMALL PERCENT SIGN may NOT appear at line start if loose+Pass FF05 FULLWIDTH PERCENT SIGN may NOT appear at line start if loose+Fail FFE0 FULLWIDTH CENT SIGN may NOT appear at line start if loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-cpm-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-cpm-loose.txtnew file mode 100644index 00000000000..add8adf11ef--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-cpm-loose.txt@@ -0,0 +1,15 @@+Harness status: OK++Found 10 tests++10 Fail+Fail 30FB KATAKANA MIDDLE DOT may appear at line start if zh and loose+Fail FF1A FULLWIDTH COLON may appear at line start if zh and loose+Fail FF1B FULLWIDTH SEMICOLON may appear at line start if zh and loose+Fail FF65 HALFWIDTH KATAKANA MIDDLE DOT may appear at line start if zh and loose+Fail 203C DOUBLE EXCLAMATION MARK may appear at line start if zh and loose+Fail 2047 DOUBLE QUESTION MARK may appear at line start if zh and loose+Fail 2048 QUESTION EXCLAMATION MARK may appear at line start if zh and loose+Fail 2049 EXCLAMATION QUESTION MARK may appear at line start if zh and loose+Fail FF01 FULLWIDTH EXCLAMATION MARK may appear at line start if zh and loose+Fail FF1F FULLWIDTH QUESTION MARK may appear at line start if zh and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-hyphens-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-hyphens-loose.txtnew file mode 100644index 00000000000..d81b47d9846--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-hyphens-loose.txt@@ -0,0 +1,7 @@+Harness status: OK++Found 2 tests++2 Fail+Fail 301C WAVE DASH may appear at line start if zh and loose+Fail 30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN may appear at line start if zh and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-iteration-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-iteration-loose.txtnew file mode 100644index 00000000000..d684ab66e6c--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-iteration-loose.txt@@ -0,0 +1,11 @@+Harness status: OK++Found 6 tests++6 Fail+Fail 3005 IDEOGRAPHIC ITERATION MARK may appear at line start if zh and loose+Fail 303B VERTICAL IDEOGRAPHIC ITERATION MARK may appear at line start if zh and loose+Fail 309D HIRAGANA ITERATION MARK may appear at line start if zh and loose+Fail 309E HIRAGANA VOICED ITERATION MARK may appear at line start if zh and loose+Fail 30FD KATAKANA ITERATION MARK may appear at line start if zh and loose+Fail 30FE KATAKANA VOICED ITERATION MARK may appear at line start if zh and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-po-loose.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-po-loose.txtnew file mode 100644index 00000000000..dfab6c01ca5--- /dev/null+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-po-loose.txt@@ -0,0 +1,15 @@+Harness status: OK++Found 10 tests++10 Fail+Fail 00B0 DEGREE SIGN may appear at line start if zh and loose+Fail 2030 PER MILLE SIGN may appear at line start if zh and loose+Fail 2032 PRIME may appear at line start if zh and loose+Fail 2033 DOUBLE PRIME may appear at line start if zh and loose+Fail 2035 REVERSED PRIME may appear at line start if zh and loose+Fail 2103 DEGREE CELSIUS may appear at line start if zh and loose+Fail 2109 DEGREE FAHRENHEIT may appear at line start if zh and loose+Fail FE6A SMALL PERCENT SIGN may appear at line start if zh and loose+Fail FF05 FULLWIDTH PERCENT SIGN may appear at line start if zh and loose+Fail FFE0 FULLWIDTH CENT SIGN may appear at line start if zh and loose\ No newline at end of filediff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-cpm-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-cpm-loose.htmlnew file mode 100644index 00000000000..3b1b62ec4a0--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-cpm-loose.html@@ -0,0 +1,76 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: centred punctuation (loose,ja)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 one of the centred punctuation characters listed.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `30FB KATAKANA MIDDLE DOT+FF1A FULLWIDTH COLON+FF1B FULLWIDTH SEMICOLON+FF65 HALFWIDTH KATAKANA MIDDLE DOT+203C DOUBLE EXCLAMATION MARK+2047 DOUBLE QUESTION MARK+2048 QUESTION EXCLAMATION MARK+2049 EXCLAMATION QUESTION MARK+FF01 FULLWIDTH EXCLAMATION MARK+FF1F FULLWIDTH QUESTION MARK`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="ja">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if ja and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-hyphens-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-hyphens-loose.htmlnew file mode 100644index 00000000000..93aa408b7cc--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-hyphens-loose.html@@ -0,0 +1,68 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS3 Text, linebreaks: hyphens (loose,ja)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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-like CJK characters.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `301C WAVE DASH+30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="ja">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if ja and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-iteration-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-iteration-loose.htmlnew file mode 100644index 00000000000..eb1d7b93d6c--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-iteration-loose.html@@ -0,0 +1,70 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: iteration (loose,ja)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 an iteration mark.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `3005 IDEOGRAPHIC ITERATION MARK+303B VERTICAL IDEOGRAPHIC ITERATION MARK+309D HIRAGANA ITERATION MARK+309E HIRAGANA VOICED ITERATION MARK+30FD KATAKANA ITERATION MARK+30FE KATAKANA VOICED ITERATION MARK`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="ja">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }+document.querySelector('body').innerHTML = out+setup({explicit_done: true});+document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if ja and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-po-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-po-loose.htmlnew file mode 100644index 00000000000..3cda5ee9ce5--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/ja/css-text-line-break-ja-po-loose.html@@ -0,0 +1,76 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: PO AFW (loose,ja)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 PO character with East Asian Width of A, F, or W.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `00B0 DEGREE SIGN+2030 PER MILLE SIGN+2032 PRIME+2033 DOUBLE PRIME+2035 REVERSED PRIME+2103 DEGREE CELSIUS+2109 DEGREE FAHRENHEIT+FE6A SMALL PERCENT SIGN+FF05 FULLWIDTH PERCENT SIGN+FFE0 FULLWIDTH CENT SIGN`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="ja">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if ja and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-iteration-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-iteration-loose.htmlnew file mode 100644index 00000000000..cdcadc1d4cd--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-iteration-loose.html@@ -0,0 +1,72 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: iteration (loose,de)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 allows a break before an iteration mark.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `3005 IDEOGRAPHIC ITERATION MARK+303B VERTICAL IDEOGRAPHIC ITERATION MARK+309D HIRAGANA ITERATION MARK+309E HIRAGANA VOICED ITERATION MARK+30FD KATAKANA ITERATION MARK+30FE KATAKANA VOICED ITERATION MARK`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="de">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="de">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if de and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-po-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-po-loose.htmlnew file mode 100644index 00000000000..60002a4cce8--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/other-lang/css-text-line-break-de-po-loose.html@@ -0,0 +1,76 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: PO AFW (loose,de)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 wll NOT allow a break before a PO character with East Asian Width of A, F, or W.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `00B0 DEGREE SIGN+2030 PER MILLE SIGN+2032 PRIME+2033 DOUBLE PRIME+2035 REVERSED PRIME+2103 DEGREE CELSIUS+2109 DEGREE FAHRENHEIT+FE6A SMALL PERCENT SIGN+FF05 FULLWIDTH PERCENT SIGN+FFE0 FULLWIDTH CENT SIGN`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="de">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="de">文文文文文<br/>文&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may NOT appear at line start if de and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-iteration-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-iteration-loose.htmlnew file mode 100644index 00000000000..b64b78ddc73--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-iteration-loose.html@@ -0,0 +1,72 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: iteration (loose,unknown)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 uknown, and line-break:loose, a browser allows a break before an iteration mark.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `3005 IDEOGRAPHIC ITERATION MARK+303B VERTICAL IDEOGRAPHIC ITERATION MARK+309D HIRAGANA ITERATION MARK+309E HIRAGANA VOICED ITERATION MARK+30FD KATAKANA ITERATION MARK+30FE KATAKANA VOICED ITERATION MARK`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if lang unknown and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-po-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-po-loose.htmlnew file mode 100644index 00000000000..50bd9f40a6a--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/unknown-lang/css-text-line-break-po-loose.html@@ -0,0 +1,76 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: PO AFW (loose,unknown)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 PO character with East Asian Width of A, F, or W.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `00B0 DEGREE SIGN+2030 PER MILLE SIGN+2032 PRIME+2033 DOUBLE PRIME+2035 REVERSED PRIME+2103 DEGREE CELSIUS+2109 DEGREE FAHRENHEIT+FE6A SMALL PERCENT SIGN+FF05 FULLWIDTH PERCENT SIGN+FFE0 FULLWIDTH CENT SIGN`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="">文文文文文<br/>文&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may NOT appear at line start if loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-cpm-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-cpm-loose.htmlnew file mode 100644index 00000000000..e6ba6b2d7dc--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-cpm-loose.html@@ -0,0 +1,76 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: centred punctuation (loose,zh)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 one of the centred punctuation characters listed.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `30FB KATAKANA MIDDLE DOT+FF1A FULLWIDTH COLON+FF1B FULLWIDTH SEMICOLON+FF65 HALFWIDTH KATAKANA MIDDLE DOT+203C DOUBLE EXCLAMATION MARK+2047 DOUBLE QUESTION MARK+2048 QUESTION EXCLAMATION MARK+2049 EXCLAMATION QUESTION MARK+FF01 FULLWIDTH EXCLAMATION MARK+FF1F FULLWIDTH QUESTION MARK`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="zh">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if zh and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-hyphens-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-hyphens-loose.htmlnew file mode 100644index 00000000000..b080786e997--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-hyphens-loose.html@@ -0,0 +1,68 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS3 Text, linebreaks: hyphens (loose,zh)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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-like CJK character.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `301C WAVE DASH+30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="zh">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if zh and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-iteration-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-iteration-loose.htmlnew file mode 100644index 00000000000..df7d4bfe9c4--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-iteration-loose.html@@ -0,0 +1,72 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: iteration (loose,zh)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 an iteration mark.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `3005 IDEOGRAPHIC ITERATION MARK+303B VERTICAL IDEOGRAPHIC ITERATION MARK+309D HIRAGANA ITERATION MARK+309E HIRAGANA VOICED ITERATION MARK+30FD KATAKANA ITERATION MARK+30FE KATAKANA VOICED ITERATION MARK`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="zh">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if zh and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-po-loose.html b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-po-loose.htmlnew file mode 100644index 00000000000..63521cef8ae--- /dev/null+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-text/i18n/zh/css-text-line-break-zh-po-loose.html@@ -0,0 +1,76 @@+<!DOCTYPE html>+<html lang="en" >+<head>+<meta charset="utf-8"/>+<title>CSS text, linebreaks: PO AFW (loose,zh)</title>+<link rel="author" title="Richard Ishida" href="mailto:[email protected]">+<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 PO character with East Asian Width of A, F, or W.">+<style type="text/css">+@font-face {+ font-family: 'mplus-1p-regular';+ src: url('../../../../fonts/mplus-1p-regular.woff') format('woff');+ }+#wrapper { position: relative; }+.test { color: red; }+.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; }+</style>+<style>+.test { line-break: loose; }+</style>+<script>+var charlist = `00B0 DEGREE SIGN+2030 PER MILLE SIGN+2032 PRIME+2033 DOUBLE PRIME+2035 REVERSED PRIME+2103 DEGREE CELSIUS+2109 DEGREE FAHRENHEIT+FE6A SMALL PERCENT SIGN+FF05 FULLWIDTH PERCENT SIGN+FFE0 FULLWIDTH CENT SIGN`+</script>+</head>+<body>+<script>+var lines = charlist.split('\n')+var out = '<div id="log"></div>\n'+for (var i=0;i<lines.length;i++) {+ // get the data+ var firstSpace = lines[i].indexOf(' ')+ var hex = lines[i].substr(0,firstSpace)+ var name = lines[i].substr(firstSpace)+ // make a test+ out += '<div class="wrapper"><div>'+hex+'</div>' ++ '<div class="test" id="test'+i+'" lang="zh">文文文文文文&#x'+hex+';字<span id="testSpan'+i+'">字</span></div>' ++ '<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' ++ '</div>'+ }++document.querySelector('body').innerHTML = out+setup({explicit_done: true});++document.fonts.ready.then(validate);++function validate() {+ for (i=0;i<lines.length;i++) {+ test(function() {+ assert_approx_equals(+ document.getElementById('testSpan'+i).getBoundingClientRect().left,+ document.getElementById('refSpan'+i).getBoundingClientRect().left, 1);+ // Hide successful tests.+ document.getElementById('test'+i).parentNode.style.display = 'none';+ }, lines[i]+' may appear at line start if zh and loose');+ }+ done();+}+</script>+<!--Notes:+The test creates a box with room for 6 characters, causing wrapping to occur either between the 6th and the 7th character, or before the 6th if the breaks after the 6th or before the 7th are prohibited.++It also creates the expected behaviour with a ref instance, using <br/>. Each line ends with a span. The test then checks whether the left edge of the span is in the same place in test and ref instance.+-->+</body>+</html>