Update web-platform-tests to revision 0f0b7a7e353421b600ee555bf354d3a98bb603ae

This commit is contained in:
WPT Sync Bot 2019-02-01 20:48:40 -05:00
parent 363073568e
commit 71dcf37d55
175 changed files with 2749 additions and 678 deletions

View file

@ -89,17 +89,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if ja and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if ja and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -89,17 +89,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if ja and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if ja and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -89,17 +89,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if ja and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if ja and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -42,17 +42,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if ja and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if ja and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -42,17 +42,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if ja and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if ja and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -42,17 +42,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -43,17 +43,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if ja and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if ja and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -43,17 +43,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -43,17 +43,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -44,17 +44,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if ja and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if ja and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -44,17 +44,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -44,17 +44,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if ja and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if ja and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="ja">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if ja and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if ja and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if zh and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if zh and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if zh and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if zh and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if zh and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if zh and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -42,17 +42,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if zh and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if zh and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -42,17 +42,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if zh and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if zh and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -42,17 +42,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if zh and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if zh and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -43,17 +43,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if zh and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if zh and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -43,17 +43,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if zh and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if zh and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -43,17 +43,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if zh and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if zh and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -44,17 +44,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if zh and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if zh and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -44,17 +44,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if zh and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if zh and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -44,17 +44,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if zh and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if zh and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may appear at line start if zh and loose');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may appear at line start if zh and loose');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if zh and normal');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if zh and normal');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.

View file

@ -48,17 +48,26 @@ for (var i=0;i<lines.length;i++) {
'<div class="ref" id="ref'+i+'" lang="zh">文文文文文<br/>&#x'+hex+';<span id="refSpan'+i+'"></span></div>' +
'</div>'
}
function spansNearEnough(counter) {
return Math.abs( document.getElementById('testSpan'+counter).getBoundingClientRect().left
- document.getElementById('refSpan'+counter).getBoundingClientRect().left ) < 1;
}
document.querySelector('body').innerHTML = out
// hide successful tests
for (i=0;i<lines.length;i++) {
if (document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft) document.getElementById('test'+i).parentNode.style.display = 'none'
}
// run the test framework
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(document.getElementById('testSpan'+i).offsetLeft === document.getElementById('refSpan'+i).offsetLeft);
}, lines[i]+' may NOT appear at line start if zh and strict');
}
setup({explicit_done: true});
document.fonts.ready.then(validate);
function validate() {
for (i=0;i<lines.length;i++) {
test(function() {
assert_true(spansNearEnough(i));
}, lines[i]+' may NOT appear at line start if zh and strict');
// Hide successful tests.
if (spansNearEnough(i)) document.getElementById('test'+i).parentNode.style.display = 'none'
}
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.