Add tests for dynamic changes to @font-face. (Bug 457821) a=blocking1.9.1+

This commit is contained in:
L. David Baron 2008-11-25 13:27:54 -08:00
Родитель 29208d6cc4
Коммит 18242d30b8
30 изменённых файлов: 983 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,42 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
@font-face {
font-family: "MarkB";
src: url(../fonts/markB.ttf);
}
body { font-family: "MarkA", "MarkB"; }
</style>
<script type="application/ecmascript">
function run() {
var sheet = document.getElementsByTagName("style")[0].sheet;
for (var i = sheet.cssRules.length - 1; i >= 0; --i) {
if (sheet.cssRules[i].type == CSSRule.FONT_FACE_RULE) {
sheet.deleteRule(i);
}
}
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
body { font-family: "MarkA"; }
</style>
<script type="application/ecmascript">
function run() {
document.getElementsByTagName("style")[0].disabled = true;
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "Mark2A";
src: url(../fonts/mark2A.ttf);
}
</style>
<style type="text/css">
body { font-family: "Mark2A"; }
</style>
</head>
<body>
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/mark2A.ttf);
}
</style>
<style type="text/css">
body { font-family: "One"; }
</style>
<script type="application/ecmascript">
function run() {
// The restore-size-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm();
document.getElementsByTagName("style")[0].disabled = true;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="restore-size-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/mark2A.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
body { font-family: "One"; }
</style>
<script type="application/ecmascript">
function run() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm_for_wider();
document.getElementsByTagName("style")[1].disabled = true;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
body { font-family: "MarkA"; }
</style>
</head>
<body>
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,38 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
body { font-family: "MarkA"; }
</style>
<script type="application/ecmascript">
document.getElementsByTagName("style")[0].disabled = true;
function run() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm();
document.getElementsByTagName("style")[0].disabled = false;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "MarkB";
src: url(../fonts/markB.ttf);
}
</style>
<style type="text/css">
body { font-family: "MarkA", "MarkB"; }
</style>
<script type="application/ecmascript">
document.getElementsByTagName("style")[0].disabled = true;
function run() {
// The resize-detector iframe will remove the class attribute.
// Allow an intermediate state where we lose the special "B" glyph.
document.getElementsByTagName("iframe")[0].contentWindow.arm_for_wider();
document.getElementsByTagName("style")[0].disabled = false;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,47 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "MarkB";
src: url(../fonts/markB.ttf);
}
</style>
<style type="text/css">
body { font-family: "MarkA", "MarkB"; }
</style>
<script type="application/ecmascript">
document.getElementsByTagName("style")[1].disabled = true;
function run() {
// The resize-detector iframe will remove the class attribute.
// Allow an intermediate state where we lose the special "A" glyph.
document.getElementsByTagName("iframe")[0].contentWindow.arm_for_wider();
document.getElementsByTagName("style")[1].disabled = false;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "Mark2A";
src: url(../fonts/mark2A.ttf);
}
</style>
<style type="text/css">
body { font-family: "Mark2A"; }
</style>
</head>
<body>
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,46 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/mark2A.ttf);
}
</style>
<style type="text/css">
body { font-family: "One"; }
</style>
<script type="application/ecmascript">
document.getElementsByTagName("style")[0].disabled = true;
function run() {
// The restore-size-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm();
document.getElementsByTagName("style")[0].disabled = false;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="restore-size-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,46 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/mark2A.ttf);
}
</style>
<style type="text/css">
body { font-family: "One"; }
</style>
<script type="application/ecmascript">
document.getElementsByTagName("style")[1].disabled = true;
function run() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm_for_wider();
document.getElementsByTagName("style")[1].disabled = false;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,46 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/markB.ttf);
}
</style>
<style type="text/css">
body { font-family: "One"; }
</style>
<script type="application/ecmascript">
document.getElementsByTagName("style")[0].disabled = true;
function run() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm_for_wider();
document.getElementsByTagName("style")[0].disabled = false;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,46 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "One";
src: url(../fonts/markB.ttf);
}
</style>
<style type="text/css">
body { font-family: "One"; }
</style>
<script type="application/ecmascript">
document.getElementsByTagName("style")[1].disabled = true;
function run() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm_for_wider();
document.getElementsByTagName("style")[1].disabled = false;
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body { font-family: "MarkA", "MarkB"; }
@font-face { font-family: "MarkA"; src: url(../fonts/markA.ttf); }
@font-face { font-family: "MarkB"; src: url(../fonts/markB.ttf); }
</style>
</head>
<body>
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,30 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body { font-family: "MarkA", "MarkB"; }
</style>
<script type="application/ecmascript">
function run() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm();
var sheet = document.getElementsByTagName("style")[0].sheet;
sheet.insertRule("@font-face { font-family: 'MarkA'; src: url(../fonts/markA.ttf); }", sheet.cssRules.length);
sheet.insertRule("@font-face { font-family: 'MarkB'; src: url(../fonts/markB.ttf); }", 0);
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
body { font-family: "MarkA"; }
</style>
</head>
<body>
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
html, body, iframe { margin: 0; padding: 0; border: none; }
</style>
<script type="application/ecmascript">
function run() {
var iframe = document.getElementsByTagName("iframe")[0]
iframe.contentWindow.arm();
iframe.style.width = "300px";
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<iframe style="height: 5em; width: 100px" src="media-query-inner-1.html"></iframe>
</body>
</html>

Просмотреть файл

@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css" media="(min-width: 200px)">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css">
body { font-family: "MarkA"; }
</style>
<script type="application/ecmascript">
function arm() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm();
}
</script>
</head>
<body>
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body { font-family: "MarkA"; }
</style>
</head>
<body>
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
html, body, iframe { margin: 0; padding: 0; border: none; }
</style>
<script type="application/ecmascript">
function run() {
var iframe = document.getElementsByTagName("iframe")[0]
iframe.contentWindow.arm();
iframe.style.width = "100px";
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<iframe style="height: 5em; width: 300px" src="media-query-inner-1.html"></iframe>
</body>
</html>

Просмотреть файл

@ -30,3 +30,27 @@ random-if(MOZ_WIDGET_TOOLKIT=="windows") HTTP(..) == prop-order-over-rule-order-
random-if(MOZ_WIDGET_TOOLKIT=="windows") HTTP(..) == prop-order-over-rule-order-1b.html prop-order-over-rule-order-2b.html
random-if(MOZ_WIDGET_TOOLKIT=="windows") fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) != prop-order-over-rule-order-1a.html prop-order-over-rule-order-1b.html
fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == cross-iframe-1.html cross-iframe-1-ref.html
# Dynamic changes
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == enable-sheet-1.html enable-sheet-1-ref.html
# we need to skip these because of the bug that's causing order-2.html to fail
skip HTTP(..) == enable-sheet-2.html multiple-in-family-1-ref.html
skip HTTP(..) == enable-sheet-3.html multiple-in-family-1-ref.html
HTTP(..) == enable-sheet-4.html enable-sheet-4-ref.html
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == enable-sheet-5.html enable-sheet-4-ref.html
skip HTTP(..) == enable-sheet-6.html multiple-in-family-1-ref.html
skip HTTP(..) == enable-sheet-7.html multiple-in-family-1-ref.html
HTTP(..) == disable-sheet-1.html disable-sheet-1-ref.html
# We're missing disable-sheet-{2,3,6,7} (analogs to
# enable-sheet{2,3,6,7}) because I don't know how to detect test
# completion for those cases.
HTTP(..) == disable-sheet-4.html disable-sheet-4-ref.html
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == disable-sheet-5.html disable-sheet-4-ref.html
fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == sheet-set-base-1.html sheet-set-base-1-ref.html
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == sheet-set-switch-1.html sheet-set-switch-1-ref.html
# insert-rule-1-ref is sometimes right on Windows, always wrong on Mac
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") random-if(MOZ_WIDGET_TOOLKIT=="windows") HTTP(..) == insert-rule-1.html insert-rule-1-ref.html
HTTP(..) == delete-rule-1.html delete-rule-1-ref.html
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == media-query-add-1.html media-query-add-1-ref.html
skip-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) == media-query-remove-1.html media-query-remove-1-ref.html
fails-if(MOZ_WIDGET_TOOLKIT=="gtk2") HTTP(..) != media-query-add-1-ref.html media-query-remove-1-ref.html

Просмотреть файл

@ -0,0 +1,32 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Resize-notifying IFRAME</title>
<script type="application/ecmascript">
var gTarget;
/* the test is done after the next resize */
function arm() {
gTarget = -1;
window.addEventListener("resize", got_resize, false);
}
/* the test is done after the next resize to wider than the current width */
function arm_for_wider() {
gTarget = window.innerWidth;
window.addEventListener("resize", got_resize, false);
}
function got_resize() {
if (window.innerWidth > gTarget) {
// Remove the class="reftest-wait" from the top window
window.top.document.documentElement.removeAttribute("class");
}
}
</script>
</head>
<body>
</body>
</html>

Просмотреть файл

@ -0,0 +1,32 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Resize-notifying IFRAME</title>
<script type="application/ecmascript">
var gTarget;
/*
* the test is done after the width becomes narrower (immediately)
* and then comes back to the same size. However, the two things
* might happen at once.
*/
function arm() {
gTarget = window.innerWidth;
window.addEventListener("resize", got_resize, false);
setTimeout(got_resize, 200);
}
function got_resize() {
if (window.innerWidth == gTarget) {
gTarget = -1;
// Remove the class="reftest-wait" from the top window
window.top.document.documentElement.removeAttribute("class");
}
}
</script>
</head>
<body>
</body>
</html>

Просмотреть файл

@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "MarkD";
src: url(../fonts/markD.ttf);
}
</style>
<style type="text/css">
body { font-family: "MarkD"; }
</style>
</head>
<body>
<p>DBC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css" title="Set A">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css" title="Set B">
@font-face {
font-family: "MarkB";
src: url(../fonts/markB.ttf);
}
</style>
<style type="text/css">
body { font-family: "MarkA", "MarkB"; }
</style>
</head>
<body>
<p>ABC</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
@font-face {
font-family: "MarkXMark2Y";
src: url(../fonts/markXmark2Y.ttf);
}
body { font-family: "MarkXMark2Y"; }
</style>
</head>
<body>
<p>AYX</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US" class="reftest-wait">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css" title="Set A">
@font-face {
font-family: "MarkA";
src: url(../fonts/markA.ttf);
}
</style>
<style type="text/css" title="Set B">
@font-face {
font-family: "Mark2B";
src: url(../fonts/mark2B.ttf);
}
</style>
<style type="text/css">
@font-face {
font-family: "MarkC";
src: url(../fonts/markC.ttf);
}
body { font-family: "MarkA", "Mark2B", "MarkC"; }
</style>
<script type="application/ecmascript">
function run() {
// The resize-detector iframe will remove the class attribute.
document.getElementsByTagName("iframe")[0].contentWindow.arm_for_wider();
document.selectedStyleSheetSet = "Set B";
}
</script>
</head>
<body onload="setTimeout(run, 20)">
<p style="position:relative; width: -moz-max-content">ABC<iframe style="visibility:hidden;position:absolute;height:100%;width:100%" src="resize-detector-iframe.html"></iframe></p>
</body>
</html>