Skip to content

Commit

Permalink
[css-text] Fix ID and PR rules. (#29781)
Browse files Browse the repository at this point in the history
css-text-line-break-de-pr-*.html tests seems to be break opportunity tests for
PR and ID. But according to UAX #14, This rules are ID ÷ PR × ID. So these are
incorrect.
  • Loading branch information
makotokato authored Jul 29, 2021
1 parent 1d6ace2 commit 84330c9
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 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 neither Japanese nor Chinese, and line-break:loose, a browser wll NOT allow a break before a PR character with East Asian Width of A, F, or W.">
<meta name="assert" content="When the language is neither Japanese nor Chinese, and line-break:loose, a browser wll allow a break before a PR character with East Asian Width of A, F, or W.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand Down Expand Up @@ -40,10 +40,10 @@
var firstSpace = lines[i].indexOf(' ')
var hex = lines[i].substr(0,firstSpace)
var name = lines[i].substr(firstSpace)
// make a test
// make a test (ID ÷ PR × ID)
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 class="ref" id="ref'+i+'" lang="de">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' +
'</div>'
}
function spansNearEnough(counter) {
Expand All @@ -60,7 +60,7 @@
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if de and loose');
}, lines[i]+' may appear at line start if de and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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 PR character with East Asian Width of A, F, or W.">
<meta name="assert" content="When the language is neither Japanese nor Chinese, and line-break:normal, a browser will allow a break before a PR character with East Asian Width of A, F, or W.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand Down Expand Up @@ -40,10 +40,10 @@
var firstSpace = lines[i].indexOf(' ')
var hex = lines[i].substr(0,firstSpace)
var name = lines[i].substr(firstSpace)
// make a test
// make a test (ID ÷ PR × ID)
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 class="ref" id="ref'+i+'" lang="de">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' +
'</div>'
}
function spansNearEnough(counter) {
Expand All @@ -60,7 +60,7 @@
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if de and normal');
}, lines[i]+' may appear at line start if de and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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 PR character with East Asian Width of A, F, or W.">
<meta name="assert" content="When the language is neither Japanese nor Chinese, and line-break:strict, a browser will allow a break before a PR character with East Asian Width of A, F, or W.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand Down Expand Up @@ -40,10 +40,10 @@
var firstSpace = lines[i].indexOf(' ')
var hex = lines[i].substr(0,firstSpace)
var name = lines[i].substr(firstSpace)
// make a test
// make a test (ID ÷ PR × ID)
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 class="ref" id="ref'+i+'" lang="de">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' +
'</div>'
}
function spansNearEnough(counter) {
Expand All @@ -60,7 +60,7 @@
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if de and strict');
}, lines[i]+' may appear at line start if de and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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 PR character with East Asian Width of A, F, or W.">
<meta name="assert" content="When the language is unknown, and line-break:loose, a browser will allow a break before a PR character with East Asian Width of A, F, or W.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand Down Expand Up @@ -40,10 +40,10 @@
var firstSpace = lines[i].indexOf(' ')
var hex = lines[i].substr(0,firstSpace)
var name = lines[i].substr(firstSpace)
// make a test
// make a test (ID ÷ PR × ID)
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 class="ref" id="ref'+i+'" lang="">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' +
'</div>'
}
function spansNearEnough(counter) {
Expand All @@ -60,7 +60,7 @@
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if loose');
}, lines[i]+' may appear at line start if loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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 PR character with East Asian Width of A, F, or W.">
<meta name="assert" content="When the language is unkonwn, and line-break:normal, a browser will allow a break before a PR character with East Asian Width of A, F, or W.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand Down Expand Up @@ -40,10 +40,10 @@
var firstSpace = lines[i].indexOf(' ')
var hex = lines[i].substr(0,firstSpace)
var name = lines[i].substr(firstSpace)
// make a test
// make a test (ID ÷ PR × ID)
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 class="ref" id="ref'+i+'" lang="">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' +
'</div>'
}
function spansNearEnough(counter) {
Expand All @@ -60,7 +60,7 @@
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if normal');
}, lines[i]+' may appear at line start if normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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:strict, a browser will NOT allow a break before a PR character with East Asian Width of A, F, or W.">
<meta name="assert" content="When the language is unknown, and line-break:strict, a browser will allow a break before a PR character with East Asian Width of A, F, or W.">
<style type="text/css">
@font-face {
font-family: 'mplus-1p-regular';
Expand Down Expand Up @@ -40,10 +40,10 @@
var firstSpace = lines[i].indexOf(' ')
var hex = lines[i].substr(0,firstSpace)
var name = lines[i].substr(firstSpace)
// make a test
// make a test (ID ÷ PR × ID)
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 class="ref" id="ref'+i+'" lang="">文文文文文文<br/>&#x'+hex+';字<span id="refSpan'+i+'">字</span></div>' +
'</div>'
}
function spansNearEnough(counter) {
Expand All @@ -60,7 +60,7 @@
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if strict');
}, lines[i]+' may appear at line start if strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
Expand Down

0 comments on commit 84330c9

Please sign in to comment.