Update web-platform-tests to revision 58b72393db0bd273bb93268c33666cf893feb985

This commit is contained in:
Josh Matthews 2017-10-31 08:58:31 -04:00
parent 43a4f01647
commit 64e0a52537
12717 changed files with 59835 additions and 59820 deletions

View file

@ -0,0 +1,4 @@
@drott
@fantasai
@litherum
@nattokirai

View file

@ -0,0 +1,144 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</script>
</head>
<body>
<script>
setup({explicit_done : true});
var styleValidTests = {
'weight': [
'bold',
'700',
'900',
'850',
'850.3',
'calc(100 + 300)',
'calc(0.2 + 205.5)',
],
'stretch': ['51%', '199%', 'calc(10% + 20%)'],
'style' : [ 'normal', 'italic', 'oblique', 'oblique 50deg', 'oblique -90deg', 'oblique 90deg',
'oblique calc(30deg + 20deg)' ]
};
var styleInvalidTests = {
'weight': ['100 400', 'calc(0 - 100)', 'calc(200 + 801)'],
'stretch': ['100% 110%', '0%', '100% 150%', 'calc(1 + 10%)'],
'style' : [ 'normal 10deg', 'italic 10deg', 'oblique -91deg', 'oblique 91deg', 'oblique calc(90deg + 20deg)']
};
function testParseStyle() {
for (validStyleTestCategory of Object.keys(styleValidTests)) {
for (validStyleTest of styleValidTests[validStyleTestCategory]) {
test(
function() {
assert_true(
CSS.supports('font-' + validStyleTestCategory, validStyleTest));
},
'Valid value ' + validStyleTest + ' for font property ' +
validStyleTestCategory + ' used for styling.')
}
}
for (invalidStyleTestCategory of Object.keys(styleInvalidTests)) {
for (invalidStyleTest of styleInvalidTests[invalidStyleTestCategory]) {
test(
function() {
assert_false(CSS.supports(
'font-' + invalidStyleTestCategory, invalidStyleTest));
},
'Invalid value ' + invalidStyleTest + ' for font property ' +
invalidStyleTestCategory + ' used for styling.')
}
}
}
var faceTests = {
'weight': [
['100', '100'], ['700', '700'], ['900', '900'], ['bold', 'bold'],
['normal', 'normal'], ['100 400', '100 400'], ['100 101.5', '100 101.5'],
['999.8 999.9', '999.8 999.9']
],
'stretch': [
['100%', '100%'],
['110%', '110%'],
['111.5%', '111.5%'],
[ "50% 200%", "50% 200%" ],
[ "0.1% 1%", "0.1% 1%" ],
[ "900% 901%", "900% 901%" ],
['ultra-condensed', 'ultra-condensed'],
['ultra-expanded', 'ultra-expanded'],
],
'style' : [
[ "normal", "normal" ],
[ "italic", "italic" ],
[ "oblique", "oblique" ],
[ "oblique 10deg", "oblique 10deg" ],
[ "oblique 10deg 20deg", "oblique 10deg 20deg" ]
]
};
var faceInvalidTests = {
'weight': [
'0',
'0.9',
'-100 200',
'100 -200',
'500 400',
'100 1001',
'1001',
'1000.5',
'100 200 300',
'a',
'a b c',
],
'stretch': [
'-0.5%', '-1%', '0%', 'calc(0% - 10%)', '60% 70% 80%', 'a%', 'a b c', '0.1',
'-60% 80%', 'ultra-expannnned', '50% 0'
],
'style' : [ 'oblique 100deg', 'oblique italic', 'oblique -91deg', 'oblique 0',
'oblique 10', 'iiitalic', '90deg', '11', 'italic 90deg' ]
};
function testParseFace() {
for (var theProperty of Object.keys(faceTests)) {
for (var faceTest of faceTests[theProperty]) {
test(
() => {
var fontFace = new FontFace('testfont', 'url()');
assert_equals(fontFace[theProperty], 'normal');
fontFace[theProperty] = faceTest[0];
assert_equals(fontFace[theProperty], faceTest[1]);
},
'Valid value ' + faceTest[0] + ' matches ' + faceTest[1] + ' for ' +
theProperty + ' in @font-face.');
}
}
for (var theProperty of Object.keys(faceInvalidTests)) {
for (var faceTest of faceInvalidTests[theProperty]) {
test(
() => {
var fontFace = new FontFace('testfont', 'url()');
assert_throws('SyntaxError', () => {
fontFace[theProperty] = faceTest;
}, 'Value must not be accepted as weight value.');
},
'Value ' + faceTest + ' must not be accepted as ' + theProperty +
' in @font-face.')
}
}
}
window.addEventListener('load', function() {
testParseStyle();
testParseFace();
done();
});
</script>
</body>
</html>

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<style>
@font-face {
font-family: variabletest_box;
src: url(resources/variabletest_box.ttf);
}
body {
font-family: variabletest_box, sans-serif;
font-size: 200px;
}
</style>
▄ ▀
<script>
document.fonts.ready.then(
() => { document.documentElement.classList.remove("reftest-wait"); });
</script>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="variable-box-font-ref.html">
<meta charset="utf-8">
<style>
@font-face {
font-family: variabletest_box;
src: url(resources/variabletest_box.ttf);
}
body {
font-family: variabletest_box,
sans-serif;
font-size: 200px;
}
.a_up {
font-variation-settings: "UPWD" 350;
}
</style>
<!-- The variabletest_box font has an A glyph that looks like a lower half box,
with deltas on the 'UPWD' variation axis that allow shifting the box up. At
350, the box is at the top. The font also has two glyphs for UPPER HALF BLOCK
and LOWER HALF BLOCK, which look identical to the respective variations of A.
-->
A <span class="a_up">A</span>
<script>
document.fonts.ready.then(
() => { document.documentElement.classList.remove("reftest-wait"); });
</script>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<style>
@font-face {
font-family: variabletest_box;
src: url(resources/variabletest_box.ttf);
}
body {
font-family: variabletest_box, sans-serif;
sans-serif;
font-size: 100px;
}
</style>
M&#x033B; N&#x033B; O&#x033B;
<script>
document.fonts.ready.then(
() => { document.documentElement.classList.remove("reftest-wait"); });
</script>
</html>

View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="variable-gpos-m2b-ref.html">
<meta charset="utf-8">
<style>
@font-face {
font-family: variabletest_box;
src: url(resources/variabletest_box.ttf);
}
body {
font-family: variabletest_box, sans-serif;
sans-serif;
font-size: 100px;
}
.gpos_m2b_left {
font-variation-settings: "VM2B" 0;
}
.gpos_m2b_middle {
font-variation-settings: "VM2B" 500;
}
.gpos_m2b_right {
font-variation-settings: "VM2B" 1000;
}
</style>
<!-- The variabletest_box font has an M glyph saying "m2b pos" that combines
with the combining box below. And it has a glyph for combining box below
whose mark anchor can be shifted horizontally using the VM2B axis. The font
also has N and O glyphs which have fixed shifted base anchor points at the
middle and at the right position. In this ref test we check whether
applying the VM2B axis works as expected and shifts the mark anchor point
left so that the combining mark is placed correctly at the middle and at
the right position. The VM2B rendering must be identical to the
conventional rendering with the fixed base anchor points. -->
<span class="gpos_m2b_left">M&#x033B;</span>
<span class="gpos_m2b_middle">M&#x033B;</span>
<span class="gpos_m2b_right">M&#x033B;</span>
<script>
document.fonts.ready.then(
() => { document.documentElement.classList.remove("reftest-wait"); });
</script>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<style>
@font-face {
font-family: variabletest_box;
src: url(resources/variabletest_box.ttf);
}
body {
font-family: variabletest_box, sans-serif;
sans-serif;
font-size: 100px;
}
</style>
r R
<script>
document.fonts.ready.then(
() => { document.documentElement.classList.remove("reftest-wait"); });
</script>
</html>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="match" href="variable-gsub-ref.html">
<meta charset="utf-8">
<style>
@font-face {
font-family: variabletest_box;
src: url(resources/variabletest_box.ttf);
}
body {
font-family: variabletest_box, sans-serif;
sans-serif;
font-size: 100px;
}
.rvrn_replaced {
font-variation-settings: "FVTT" 10;
}
</style>
<!-- The variabletest_box font has an r glyph that says "rvrn base" and has
this as a name as well. And it has a glyph for R that says "rvrn subst"
where rvrn stands for the required Required Variation Alternates
feature. The font has an 'FVTT' axis ranging from 0 to 10, where it uses
a single substitution glyph lookup table for axis values starting from
5, which then replaces the rvrn_base glyph with the rvrn_subst
glyph. So in this reftest the substituted glyph for lowercase r
should visually match the uppercase R glyph, both show "rvrn subst". -->
r <span class="rvrn_replaced">r</span>
<script>
document.fonts.ready.then(
() => { document.documentElement.classList.remove("reftest-wait"); });
</script>
</html>