mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'
This commit is contained in:
parent
35e95f55a1
commit
58e8ee674b
9438 changed files with 266112 additions and 106976 deletions
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Tests that the ascentOverride, descentOverride and lineGapOverride attributes of FontFace work</title>
|
||||
<link rel="stylesheet" herf="/fonts/ahem.css">
|
||||
<link rel="stylesheet" href="/fonts/ahem.css">
|
||||
<style>
|
||||
#target {
|
||||
position: absolute;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<link rel="match" href="fontface-override-descriptors-ref.html">
|
||||
<script>
|
||||
const face = new FontFace(
|
||||
'ahem-overridden',
|
||||
'Ahem',
|
||||
'local("Ahem"), url("/fonts/Ahem.ttf")',
|
||||
{ascentOverride: '100%', descentOverride: '100%', lineGapOverride: '100%'});
|
||||
document.fonts.add(face);
|
||||
|
@ -18,7 +18,7 @@ document.fonts.add(face);
|
|||
<style>
|
||||
#target {
|
||||
position: absolute;
|
||||
font-family: ahem-overridden;
|
||||
font-family: Ahem;
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Tests that the sizeAdjust attribute of FontFace works</title>
|
||||
<script>
|
||||
/* Load Ahem similarly to the testcase so that Gecko gives it the
|
||||
same antialiasing treatment. */
|
||||
const ahem = new FontFace(
|
||||
'Ahem-normal',
|
||||
'local("Ahem"), url("/fonts/Ahem.ttf")');
|
||||
document.fonts.add(ahem);
|
||||
</script>
|
||||
<style>
|
||||
#target {
|
||||
font-family: "Ahem-normal";
|
||||
font-size: 40px;
|
||||
letter-spacing: 10px;
|
||||
}
|
||||
span {
|
||||
font-size: 50%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>The first and fourth characters should be double-sized:</p>
|
||||
<div id="target">
|
||||
F<span>oo</span>B<span>ar</span>
|
||||
</div>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Tests that the sizeAdjust attribute of FontFace works</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" href="mailto:jkew@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading/#fontface-interface">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-size-adjust-desc">
|
||||
<link rel="match" href="fontface-size-adjust-descriptor-ref.html">
|
||||
<script>
|
||||
const ahem = new FontFace(
|
||||
'Ahem-normal',
|
||||
'local("Ahem"), url("/fonts/Ahem.ttf")');
|
||||
document.fonts.add(ahem);
|
||||
const large = new FontFace(
|
||||
'Ahem-large',
|
||||
'local("Ahem"), url("/fonts/Ahem.ttf")',
|
||||
{sizeAdjust: "200%", unicodeRange: "U+20,U+41-5A"});
|
||||
document.fonts.add(large);
|
||||
</script>
|
||||
<style>
|
||||
#target {
|
||||
font-family: "Ahem-large", "Ahem-normal";
|
||||
font-size: 20px;
|
||||
letter-spacing: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>The first and fourth characters should be double-sized:</p>
|
||||
<div id="target">
|
||||
FooBar
|
||||
</div>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#dom-fontfaceset-add">
|
||||
<meta name="assert" content="Ensure that calling add() with a CSS-connected FontFace throws." />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("resources/Rochester.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
test(function(t) {
|
||||
let font = document.fonts.keys().next().value;
|
||||
let fontFaceSet = new FontFaceSet([]);
|
||||
assert_equals(fontFaceSet.size, 0);
|
||||
assert_throws_dom("InvalidModificationError", function() { fontFaceSet.add(font); });
|
||||
assert_equals(fontFaceSet.size, 0);
|
||||
let newFont = new FontFace("MyFont", "url('resources/Rochester.otf')");
|
||||
fontFaceSet.add(newFont);
|
||||
assert_equals(fontFaceSet.size, 1);
|
||||
fontFaceSet.add(newFont);
|
||||
assert_equals(fontFaceSet.size, 1);
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#dom-fontfaceset-clear">
|
||||
<meta name="assert" content="Ensure that calling clear() does not remove CSS-connected FontFaces." />
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("resources/Rochester.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
<div style="font: 48px 'WebFont';">Hi</div>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#dom-fontfaceset-clear">
|
||||
<meta name="assert" content="Ensure that calling clear() does not remove CSS-connected FontFaces." />
|
||||
<link rel="match" href="fontfaceset-clear-css-connected-2-ref.html">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("resources/Rochester.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
<div style="font: 48px 'WebFont';">Hi</div>
|
||||
<script>
|
||||
document.fonts.clear();
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#dom-fontfaceset-clear">
|
||||
<meta name="assert" content="Ensure that calling clear() does not remove CSS-connected FontFaces." />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("resources/Rochester.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
test(function(t) {
|
||||
let fonts = document.fonts;
|
||||
let font = fonts.keys().next().value;
|
||||
assert_equals(fonts.size, 1);
|
||||
fonts.clear();
|
||||
assert_equals(fonts.size, 1);
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#dom-fontfaceset-delete">
|
||||
<meta name="assert" content="Ensure that calling delete() with a CSS-connected FontFace has no effect." />
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("resources/Rochester.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
<div style="font: 48px 'WebFont';">Hi</div>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#dom-fontfaceset-delete">
|
||||
<meta name="assert" content="Ensure that calling delete() with a CSS-connected FontFace has no effect." />
|
||||
<link rel="match" href="fontfaceset-delete-css-connected-2-ref.html">
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("resources/Rochester.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
<div style="font: 48px 'WebFont';">Hi</div>
|
||||
<script>
|
||||
let fonts = document.fonts;
|
||||
let font = fonts.keys().next().value;
|
||||
fonts.delete(font);
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#dom-fontfaceset-delete">
|
||||
<meta name="assert" content="Ensure that calling delete() on a CSS-connected FontFace has no effect." />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("resources/Rochester.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
test(function(t) {
|
||||
let fonts = document.fonts;
|
||||
let font = fonts.keys().next().value;
|
||||
assert_equals(fonts.size, 1);
|
||||
fonts.delete(font);
|
||||
assert_equals(fonts.size, 1);
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head id="head">
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#dom-fontfaceset-has">
|
||||
<meta name="assert" content="Ensure that calling FontFaceSet.has() works properly." />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style id="style">
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("resources/Rochester.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test(function(t) {
|
||||
let fonts = document.fonts;
|
||||
let font = [...fonts.keys()][0];
|
||||
let font2 = new FontFace("WebFont2", "url('resources/GenR102.woff2') format('woff2')");
|
||||
assert_true(fonts.has(font));
|
||||
assert_false(fonts.has(font2));
|
||||
fonts.add(font2);
|
||||
assert_true(fonts.has(font));
|
||||
assert_true(fonts.has(font2));
|
||||
document.getElementById("head").removeChild(document.getElementById("style"));
|
||||
assert_false(fonts.has(font));
|
||||
assert_true(fonts.has(font2));
|
||||
fonts.delete(font2);
|
||||
assert_false(fonts.has(font));
|
||||
assert_false(fonts.has(font2));
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head id="head">
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#document-font-face-set">
|
||||
<meta name="assert" content="Ensure that stylesheet changes are reflected in document.fonts." />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style id="style">
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("resources/Rochester.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test(function(t) {
|
||||
let fonts = document.fonts;
|
||||
assert_equals(fonts.size, 1);
|
||||
document.getElementById("head").removeChild(document.getElementById("style"));
|
||||
assert_equals(fonts.size, 0);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="author" title="Myles C. Maxfield" href="mmaxfield@apple.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading-3/#font-face-css-connection">
|
||||
<meta name="assert" content="Ensure that a file URL in a font-face block appears in document.fonts." />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "WebFont";
|
||||
src: url("file://ThisIsNotARealFile.otf") format("opentype");
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
test(function(t) {
|
||||
assert_equals(document.fonts.size, 1, "A nonexistent file URL should appear in document.fonts.");
|
||||
});
|
||||
</script>
|
||||
</html>
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue