mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: Styling</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#styling">
|
||||
<link id="style1" rel="text" title="Intel" href="./support/unmatch.css">
|
||||
<link id="style2" rel="alternate stylesheet" type="text/css" title="" href="./support/emptytitle.css">
|
||||
<link id="style3" rel="alternate stylesheet" type="text/css" href="./support/notitle.css">
|
||||
<link id="style5" rel="stylesheet" type="text/css" href="./support/normal.css">
|
||||
<link id="style6" rel="alternate stylesheet" type="text/css" href="./support/normal.css" title="./support/alternate.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style id="style4" type="text/html">
|
||||
#test {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<style id="style7" type="text/css" media="all" title="./support/alternate.css">
|
||||
#test {
|
||||
background-color: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test" style="display:none">STYLING TEST</div>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
var style = null,
|
||||
i;
|
||||
for (i = 1; i < 5; i++) {
|
||||
style = document.getElementById("style" + i);
|
||||
assert_equals(style.sheet, null, "The sheet attribute of style" + i + " should be null.");
|
||||
assert_false(style.disabled, "The disabled attribute of style" + i + " should be false.");
|
||||
}
|
||||
}, "The LinkStyle interface's sheet attribute must return null; the disabled attribute must be false");
|
||||
|
||||
test(function() {
|
||||
var style = document.createElement("style"),
|
||||
link = document.createElement("link");
|
||||
assert_equals(style.sheet, null, "The sheet attribute of the style element not in a document should be null.");
|
||||
assert_equals(link.sheet, null, "The sheet attribute of the link element not in a document should be null.");
|
||||
}, "The LinkStyle interface's sheet attribute must return null if the corresponding element is not in a Document");
|
||||
|
||||
test(function() {
|
||||
var style = null,
|
||||
i;
|
||||
for (i = 5; i < 8; i++) {
|
||||
style = document.getElementById("style" + i);
|
||||
assert_true(style.sheet instanceof StyleSheet, "The sheet attribute of style" + i + " should be a StyleSheet object.");
|
||||
assert_equals(style.disabled, style.sheet.disabled, "The disabled attribute of style" + i + " should equal to the same attribute of StyleSheet.");
|
||||
}
|
||||
}, "The LinkStyle interface's sheet attribute must return StyleSheet object; the disabled attribute must be same as the StyleSheet's disabled attribute");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("style2").title, "", "The title attribute of style2 is incorrect.");
|
||||
assert_equals(document.getElementById("style5").title, "", "The title attribute of style5 is incorrect.");
|
||||
assert_equals(document.getElementById("style6").title, "./support/alternate.css", "The title attribute of style6 is incorrect.");
|
||||
assert_equals(document.getElementById("style7").title, "./support/alternate.css", "The title attribute of style7 is incorrect.");
|
||||
}, "The title must be the same as the value of the element's title content attribute");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("style5").media, "", "The media attribute of style5 is incorrect.");
|
||||
assert_equals(document.getElementById("style7").media, "all", "The media attribute of style7 is incorrect.");
|
||||
}, "The media must be the same as the value of the element's media content attribute, or the empty string if it is omitted");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#test {
|
||||
color: yellow;
|
||||
background-color: blue;
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
font-size: .5em;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#test {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#test {
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#test {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#test {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>base element in about:blank document should resolve against its fallback base URI</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<iframe></iframe>
|
||||
<script>
|
||||
var t = async_test();
|
||||
addEventListener("load", t.step_func_done(function() {
|
||||
var doc = frames[0].document;
|
||||
var b = doc.createElement("base");
|
||||
b.setAttribute("href", "test");
|
||||
var newBaseValue = location.href.replace(/\/[^/]*$/, "/") + "test";
|
||||
assert_equals(b.href, newBaseValue);
|
||||
assert_equals(doc.baseURI, location.href);
|
||||
doc.head.appendChild(b);
|
||||
assert_equals(doc.baseURI, newBaseValue);
|
||||
}));
|
||||
</script>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: base_href_empty</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
|
||||
<base id="base" href="" target="_blank">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<img id="test" src="/images/blue-100x100.png" style="display:none">
|
||||
|
||||
<script>
|
||||
var testElement,
|
||||
baseElement;
|
||||
|
||||
setup(function() {
|
||||
testElement = document.getElementById("test");
|
||||
baseElement = document.getElementById("base");
|
||||
});
|
||||
|
||||
test(function() {
|
||||
assert_equals(baseElement.href, document.location.href, "The href of base element is incorrect.");
|
||||
}, "The value of the href attribute must be the document's address if it is empty");
|
||||
|
||||
test(function() {
|
||||
var exp = testElement.src.substring(0, testElement.src.lastIndexOf("/images/blue-100x100.png") + 1);
|
||||
assert_true(baseElement.href.indexOf(exp) != -1, "The src of img element is incorrect.");
|
||||
}, "The src attribute of the img element must relative to document's address");
|
||||
</script>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>base element with unparseable href should have .href getter return attr value</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
test(function() {
|
||||
var b = document.createElement("base");
|
||||
b.setAttribute("href", "//test:test");
|
||||
assert_equals(b.href, "//test:test");
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: base_href_specified</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<base id="base">
|
||||
<div id="log"></div>
|
||||
<img id="test" src="test.ico" style="display:none">
|
||||
|
||||
<script>
|
||||
var testElement;
|
||||
var baseElement;
|
||||
|
||||
var otherOrigin = get_host_info().HTTP_REMOTE_ORIGIN;
|
||||
|
||||
setup(function() {
|
||||
testElement = document.getElementById("test");
|
||||
baseElement = document.getElementById("base");
|
||||
|
||||
baseElement.setAttribute("href", otherOrigin);
|
||||
});
|
||||
|
||||
test(function() {
|
||||
assert_equals(baseElement.href, otherOrigin + "/", "The href attribute of the base element is incorrect.");
|
||||
}, "The href attribute of the base element is specified");
|
||||
|
||||
test(function() {
|
||||
assert_equals(testElement.src, otherOrigin + "/test.ico", "The src attribute of the img element is incorrect.");
|
||||
}, "The src attribute of the img element must relative to the href attribute of the base element");
|
||||
</script>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: base_href_unspecified</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
|
||||
<base id="base" target="_blank">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
<img id="test" src="/images/blue-100x100.png" style="display:none">
|
||||
|
||||
<script>
|
||||
var testElement,
|
||||
baseElement;
|
||||
|
||||
setup(function () {
|
||||
testElement = document.getElementById("test");
|
||||
baseElement = document.getElementById("base");
|
||||
});
|
||||
|
||||
test(function() {
|
||||
assert_equals(baseElement.href, document.location.href, "Return the document base URL if the base element has no href content attribute.");
|
||||
}, "The value of the href attribute must be the document's address if it is unspecified");
|
||||
|
||||
test(function() {
|
||||
var exp = testElement.src.substring(0, testElement.src.lastIndexOf("/images/blue-100x100.png") + 1);
|
||||
assert_true(baseElement.href.indexOf(exp) != -1, "The src attribute of the img element is incorrect.");
|
||||
}, "The src attribute of the img element must relative to document's address");
|
||||
</script>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: base_multiple</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<iframe id="test1" src="example.html" style="width:0;height:0" frameborder="0"></iframe>
|
||||
<iframe id="test2" src="example.html" name="targetWin" style="width:0;height:0" frameborder="0"></iframe>
|
||||
<script>
|
||||
async_test(function() {
|
||||
window.onload = this.step_func(function() {
|
||||
var fr1 = document.getElementById("test1");
|
||||
fr1.addEventListener("load", this.unreached_func("loaded in the wrong iframe"));
|
||||
|
||||
var fr2 = document.getElementById("test2");
|
||||
fr2.addEventListener("load", this.step_func_done(function () {
|
||||
var doc2 = fr2.contentDocument;
|
||||
assert_not_equals(doc2.location.href.indexOf("example2.html"), -1, "The target attribute does not impact the a element.");
|
||||
assert_equals(doc2.getElementById("d1").innerHTML, "PASS", "The opend page should be the example2.html.");
|
||||
}), true);
|
||||
|
||||
fr1.contentDocument.getElementById("a1").click();
|
||||
});
|
||||
}, "The attributes of the a element must be affected by the first base element");
|
||||
</script>
|
||||
</body>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>base element in srcdoc document should resolve against its fallback base URI</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<iframe srcdoc=""></iframe>
|
||||
<script>
|
||||
var t = async_test();
|
||||
addEventListener("load", t.step_func_done(function() {
|
||||
var doc = frames[0].document;
|
||||
var b = doc.createElement("base");
|
||||
b.setAttribute("href", "test");
|
||||
var newBaseValue = location.href.replace(/\/[^/]*$/, "/") + "test";
|
||||
assert_equals(b.href, newBaseValue);
|
||||
assert_equals(doc.baseURI, location.href);
|
||||
doc.head.appendChild(b);
|
||||
assert_equals(doc.baseURI, newBaseValue);
|
||||
}));
|
||||
</script>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Example</title>
|
||||
<base target="targetWin" href="">
|
||||
<base target="_self" href="http://www.example.com/">
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<a id="a1" href="example2.html" target="">click me</a>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Example</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<div id="d1">PASS</div>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Documents without browsing contexts should not load stylesheets</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/utils.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
function count(id, t) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', 'stylesheet.py?count=1&id=' + id);
|
||||
xhr.onload = t.step_func_done(function() {
|
||||
assert_equals(xhr.responseText, "1");
|
||||
});
|
||||
xhr.onerror = t.unreached_func();
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
async_test(function(t) {
|
||||
var id = token();
|
||||
var doc = (new DOMParser()).parseFromString('<link rel="stylesheet" href="stylesheet.py?id=' + id + '"></link>', 'text/html');
|
||||
var link = doc.querySelector('link');
|
||||
document.head.appendChild(link);
|
||||
t.step_timeout(function() { count(id, t) }, 500);
|
||||
}, 'Create a document, adopt the node');
|
||||
|
||||
async_test(function(t) {
|
||||
var id = token();
|
||||
var d = document.createElement('div');
|
||||
document.body.appendChild(d);
|
||||
d.innerHTML = '<link rel="stylesheet" href="stylesheet.py?id=' + id + '"></link>';
|
||||
t.step_timeout(function() { count(id, t) }, 500);
|
||||
}, 'Create a stylesheet in innerHTML document');
|
||||
</script>
|
||||
</body>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="author" title="Josh Matthews" href="mailto:josh@joshmatthews.net">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link href="style.css?pipe=trickle(d3)" rel="stylesheet" id="style_test"></link>
|
||||
<script>
|
||||
var saw_link_onload = false;
|
||||
var t = async_test("Check if the stylesheet's load event blocks the document load event");
|
||||
document.getElementById('style_test').onload = t.step_func(function() {
|
||||
saw_link_onload = true;
|
||||
});
|
||||
window.addEventListener('load', t.step_func_done(function() {
|
||||
assert_true(saw_link_onload);
|
||||
}));
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<title>link.relList: non-string contains</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#domtokenlist">
|
||||
<link rel="help" href="https://heycam.github.io/webidl/#ecmascript-binding">
|
||||
<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link id="link" rel="undefined null 0 NaN Infinity">
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var list = document.getElementById("link").relList;
|
||||
assert_equals(list.contains(undefined), true); //"undefined"
|
||||
assert_equals(list.contains(null), true); //"null"
|
||||
assert_equals(list.contains(-0), true); //"0"
|
||||
assert_equals(list.contains(+0), true); //"0"
|
||||
assert_equals(list.contains(NaN), true); //"NaN"
|
||||
assert_equals(list.contains(+Infinity), true); //"Infinity"
|
||||
assert_equals(list.contains(-Infinity), false); //"-Infinity"
|
||||
assert_equals(list.supports("stylesheet"), true);
|
||||
assert_equals(list.supports("nosuchrelvalueever"), false);
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<title>link: error events</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<script>
|
||||
var t404 = async_test("Should get an error event for a 404 error.")
|
||||
t404.step(function() {
|
||||
var elt = document.createElement("link");
|
||||
elt.onerror = t404.step_func(function() {
|
||||
assert_true(true, "Got error event for 404 error.")
|
||||
t404.step_timeout(function() { t404.done() }, 0);
|
||||
})
|
||||
elt.onload = t404.unreached_func("load event should not be fired");
|
||||
elt.rel = "stylesheet";
|
||||
elt.href = "nonexistent_stylesheet.css";
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
|
||||
var tUnsupported = async_test("Should get an error event for an unsupported URL.")
|
||||
tUnsupported.step(function() {
|
||||
var elt = document.createElement("link");
|
||||
elt.onerror = tUnsupported.step_func(function() {
|
||||
assert_true(true, "Got error event for unsupported URL.")
|
||||
tUnsupported.step_timeout(function() { tUnsupported.done() }, 0);
|
||||
})
|
||||
elt.onload = tUnsupported.unreached_func("load event should not be fired");
|
||||
elt.rel = "stylesheet";
|
||||
elt.href = "nonexistent:stylesheet.css";
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
|
||||
var tText = async_test("Should get an error event for a text/plain response.")
|
||||
tText.step(function() {
|
||||
var elt = document.createElement("link");
|
||||
elt.onerror = tText.step_func(function() {
|
||||
assert_true(true, "Got error event for 404 error.")
|
||||
tText.done()
|
||||
})
|
||||
elt.onload = tText.unreached_func("load event should not be fired");
|
||||
elt.rel = "stylesheet";
|
||||
elt.href = "../../../../../common/css-red.txt";
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
body {
|
||||
background-color: green;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
body {
|
||||
background-color: white;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Stylesheet Without Base Tag</title>
|
||||
<style>
|
||||
body { background-color: green; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Stylesheet With Base Tag</title>
|
||||
<link rel="match" href="stylesheet-with-base-ref.html">
|
||||
<base href="resources/">
|
||||
<link rel="stylesheet" href="stylesheet.css">
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
body {
|
||||
background-color: red;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
def main(request, response):
|
||||
try:
|
||||
count = int(request.server.stash.take(request.GET["id"]))
|
||||
except:
|
||||
count = 0
|
||||
if "count" in request.GET:
|
||||
return str(count)
|
||||
request.server.stash.put(request.GET["id"], str(count + 1))
|
||||
return 'body { color: red }'
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
[
|
||||
{
|
||||
"id": "standard-metadata-names",
|
||||
"original_id": "standard-metadata-names"
|
||||
},
|
||||
{
|
||||
"id": "other-metadata-names",
|
||||
"original_id": "other-metadata-names"
|
||||
},
|
||||
{
|
||||
"id": "pragma-directives",
|
||||
"original_id": "pragma-directives"
|
||||
},
|
||||
{
|
||||
"id": "other-pragma-directives",
|
||||
"original_id": "other-pragma-directives"
|
||||
},
|
||||
{
|
||||
"id": "charset",
|
||||
"original_id": "charset"
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Parsing of meta refresh</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<style>
|
||||
iframe { display:none }
|
||||
</style>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
// failure to parse is []
|
||||
// success to parse is [time, url] where url is unresolved
|
||||
|
||||
var tests_arr = [
|
||||
{input: '', expected: []},
|
||||
{input: '1', expected: [1, 'refresh.sub.html']},
|
||||
{input: '1 ', expected: [1, 'refresh.sub.html']},
|
||||
{input: '1\t', expected: [1, 'refresh.sub.html']},
|
||||
{input: '1\r', expected: [1, 'refresh.sub.html']},
|
||||
{input: '1\n', expected: [1, 'refresh.sub.html']},
|
||||
{input: '1\f', expected: [1, 'refresh.sub.html']},
|
||||
{input: '1;', expected: [1, 'refresh.sub.html']},
|
||||
{input: '1,', expected: [1, 'refresh.sub.html']},
|
||||
{input: '1; url=foo', expected: [1, 'foo']},
|
||||
{input: '1, url=foo', expected: [1, 'foo']},
|
||||
{input: '1 url=foo', expected: [1, 'foo']},
|
||||
{input: '1;\turl=foo', expected: [1, 'foo']},
|
||||
{input: '1,\turl=foo', expected: [1, 'foo']},
|
||||
{input: '1\turl=foo', expected: [1, 'foo']},
|
||||
{input: '1;\rurl=foo', expected: [1, 'foo']},
|
||||
{input: '1,\rurl=foo', expected: [1, 'foo']},
|
||||
{input: '1\rurl=foo', expected: [1, 'foo']},
|
||||
{input: '1;\nurl=foo', expected: [1, 'foo']},
|
||||
{input: '1,\nurl=foo', expected: [1, 'foo']},
|
||||
{input: '1\nurl=foo', expected: [1, 'foo']},
|
||||
{input: '1;\furl=foo', expected: [1, 'foo']},
|
||||
{input: '1,\furl=foo', expected: [1, 'foo']},
|
||||
{input: '1\furl=foo', expected: [1, 'foo']},
|
||||
{input: '1url=foo', expected: []},
|
||||
{input: '1x;url=foo', expected: []},
|
||||
{input: '1 x;url=foo', expected: [1, 'x;url=foo']},
|
||||
{input: '1;;url=foo', expected: [1, ';url=foo']},
|
||||
{input: ' 1 ; url = foo', expected: [1, 'foo']},
|
||||
{input: ' 1 , url = foo', expected: [1, 'foo']},
|
||||
{input: ' 1 ; foo', expected: [1, 'foo']},
|
||||
{input: ' 1 , foo', expected: [1, 'foo']},
|
||||
{input: ' 1 url = foo', expected: [1, 'foo']},
|
||||
{input: '1; url=foo ', expected: [1, 'foo']},
|
||||
{input: '1; url=f\to\no', expected: [1, 'foo']},
|
||||
{input: '1; url="foo"bar', expected: [1, 'foo']},
|
||||
{input: '1; url=\'foo\'bar', expected: [1, 'foo']},
|
||||
{input: '1; url="foo\'bar', expected: [1, 'foo\'bar']},
|
||||
{input: '1; url foo', expected: [1, 'url foo']},
|
||||
{input: '1; urlfoo', expected: [1, 'urlfoo']},
|
||||
{input: '1; urfoo', expected: [1, 'urfoo']},
|
||||
{input: '1; ufoo', expected: [1, 'ufoo']},
|
||||
{input: '1; "foo"bar', expected: [1, 'foo']},
|
||||
{input: '; foo', expected: []},
|
||||
{input: ', foo', expected: []},
|
||||
{input: 'foo', expected: []},
|
||||
{input: '+1; url=foo', expected: []},
|
||||
{input: '-1; url=foo', expected: []},
|
||||
{input: '+0; url=foo', expected: []},
|
||||
{input: '-0; url=foo', expected: []},
|
||||
{input: '0; url=foo', expected: [0, 'foo']},
|
||||
{input: '+1; foo', expected: []},
|
||||
{input: '-1; foo', expected: []},
|
||||
{input: '+0; foo', expected: []},
|
||||
{input: '-0; foo', expected: []},
|
||||
{input: '0; foo', expected: [0, 'foo']},
|
||||
{input: '+1', expected: []},
|
||||
{input: '-1', expected: []},
|
||||
{input: '+0', expected: []},
|
||||
{input: '-0', expected: []},
|
||||
{input: '0', expected: [0, 'refresh.sub.html']},
|
||||
{input: '1.9; url=foo', expected: [1, 'foo']},
|
||||
{input: '1.9..5.; url=foo', expected: [1, 'foo']},
|
||||
{input: '.9; url=foo', expected: []},
|
||||
];
|
||||
|
||||
tests_arr.forEach(function(test_obj) {
|
||||
async_test(function(t) {
|
||||
var iframe = document.createElement('iframe');
|
||||
t.add_cleanup(function() {
|
||||
document.body.removeChild(iframe);
|
||||
});
|
||||
iframe.src = 'support/refresh.sub.html?input=' + encodeURIComponent(test_obj.input);
|
||||
document.body.appendChild(iframe);
|
||||
var loadCount = 0;
|
||||
iframe.onload = t.step_func(function() {
|
||||
loadCount++;
|
||||
var got = iframe.contentDocument.body.textContent.trim();
|
||||
if (test_obj.expected.length === 0) {
|
||||
assert_equals(got, 'refresh.sub.html');
|
||||
if (loadCount === 1) {
|
||||
setTimeout(function() {
|
||||
t.done();
|
||||
}, 3000); // want to make sure it doesn't redirect when it shouldn't
|
||||
} else {
|
||||
assert_unreached('Got > 1 load events');
|
||||
}
|
||||
} else {
|
||||
if (loadCount === 2) {
|
||||
assert_equals(got, test_obj.expected[1]);
|
||||
t.done();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, format_value(test_obj.input));
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1 @@
|
|||
;url=foo
|
||||
|
|
@ -0,0 +1 @@
|
|||
Content-Type: text/html
|
||||
|
|
@ -0,0 +1 @@
|
|||
foo
|
||||
|
|
@ -0,0 +1 @@
|
|||
foo'bar
|
||||
|
|
@ -0,0 +1 @@
|
|||
<!doctype html><meta http-equiv=refresh content="{{GET[input]}}">refresh.sub.html
|
||||
|
|
@ -0,0 +1 @@
|
|||
ufoo
|
||||
|
|
@ -0,0 +1 @@
|
|||
urfoo
|
||||
|
|
@ -0,0 +1 @@
|
|||
url foo
|
||||
|
|
@ -0,0 +1 @@
|
|||
urlfoo
|
||||
|
|
@ -0,0 +1 @@
|
|||
x;url=foo
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html >
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="Content-Language" content="ko,zh,ja" >
|
||||
<title>Multiple languages in Content-Language meta element</title>
|
||||
<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
|
||||
<link rel='help' href='https://html.spec.whatwg.org/multipage/#pragma-directives'>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<meta name='flags' content='dom'>
|
||||
<style type='text/css'>
|
||||
#colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
|
||||
#colonlangcontroltest:lang(xx) { display:none; }
|
||||
.test div { width: 50px; }
|
||||
|
||||
#box:lang(ko) { width: 100px; }
|
||||
#box:lang(zh) { width: 100px; }
|
||||
#box:lang(ja) { width: 100px; }
|
||||
|
||||
/* styling for debugging related notes */
|
||||
.notes span:lang(ko) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
.notes span:lang(zh) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
.notes span:lang(ja) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div class="test"><div id="box"> </div></div>
|
||||
<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
|
||||
|
||||
|
||||
<!--Notes:
|
||||
|
||||
This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
|
||||
|
||||
-->
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
|
||||
assert_equals(document.getElementById('box').offsetWidth, 50);
|
||||
}, "The UA will not recognize a language declaration in the Content-Language meta element when more than one language is declared.");
|
||||
</script>
|
||||
|
||||
<div id='log'></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<!doctype html>
|
||||
<title>Historical style element features should not be supported</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
function t(property) {
|
||||
test(function() {
|
||||
assert_false(property in document.createElement('style'));
|
||||
}, 'style.' + property + ' should not be supported');
|
||||
}
|
||||
// added in https://github.com/whatwg/html/commit/29cf39d2163cfc85b67409f4e10390619ffb2b40
|
||||
// removed in https://github.com/whatwg/html/commit/c2a3b2a2e3db49c14b486a5e99acf7d10cfe8443
|
||||
t('scoped');
|
||||
</script>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>[style] Reference file</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<style>
|
||||
h4 {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<p>
|
||||
This page tests that Style written inside HTML comment is not applied
|
||||
</p>
|
||||
This test passes if the text below is <b>Green. NOT Red.</b>
|
||||
<h4>
|
||||
This is some text.
|
||||
</h4>
|
||||
</body>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<link rel="match" href="html_style_in_comment-ref.html"/>
|
||||
<style type="text/css">
|
||||
h4 {color: green}
|
||||
<!--
|
||||
h4 {color: red}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p> This page tests that Style written inside HTML comment is not applied</p>
|
||||
This test passes if the text below is <b>Green. NOT Red.</b>
|
||||
<h4>
|
||||
This is some text.
|
||||
</h4>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<title>style: error events</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<script>
|
||||
//var t404 = async_test("Should get an error event for a 404 error.")
|
||||
//t404.step(function() {
|
||||
// var elt = document.createElement("style");
|
||||
// elt.onerror = t404.step_func(function() {
|
||||
// assert_true(true, "Got error event for 404 error.")
|
||||
// t404.done()
|
||||
// })
|
||||
// elt.appendChild(
|
||||
// document.createTextNode('@import 404 error;'));
|
||||
// document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
//})
|
||||
var tText = async_test("Should get an error event for a text/plain response.")
|
||||
tText.step(function() {
|
||||
var elt = document.createElement("style");
|
||||
elt.onerror = tText.step_func(function() {
|
||||
assert_true(true, "Got error event for 404 error.")
|
||||
tText.done()
|
||||
})
|
||||
elt.appendChild(
|
||||
document.createTextNode('@import "../../../../common/css-red.txt";'));
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: The style should not be applied if it is disabled</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#test {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<style id="style">
|
||||
#test {
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var testElement = document.getElementById("test");
|
||||
var style = document.getElementById("style");
|
||||
var width1, width2;
|
||||
|
||||
width1 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width1, "50px", "The style should be applied.");
|
||||
|
||||
style.disabled = true;
|
||||
width2 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width2, "100px", "The style should not be applied.");
|
||||
}, "The style is not applied when it is disabled");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: The style events</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var tLoad = async_test("If the style is loaded successfully, the 'load' event must be fired");
|
||||
var tError = async_test("If the style is loaded unsuccessfully, the 'error' event must be fired");
|
||||
|
||||
function onstyleload(e) {
|
||||
tLoad.done();
|
||||
}
|
||||
|
||||
function onstyleerror(e) {
|
||||
tError.done();
|
||||
}
|
||||
</script>
|
||||
<style onload="onstyleload()">
|
||||
#test {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<style onerror="onstyleerror()">
|
||||
@import url(nonexistent.css);
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: The style information must be applied to the environment specified by the media attribute</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-style-media">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#test {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<style id="style">
|
||||
#test {
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var testElement = document.getElementById("test");
|
||||
var style = document.getElementById("style");
|
||||
var width1, width2;
|
||||
|
||||
width1 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width1, "50px", "The style should be applied.");
|
||||
|
||||
style.media = "print";
|
||||
width2 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width2, "100px", "The style should not be applied.");
|
||||
}, "The style information must be applied to the environment specified by the media attribute");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<title>title.text with comment and element children.</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
try {
|
||||
var title = document.getElementsByTagName("title")[0];
|
||||
while (title.childNodes.length)
|
||||
title.removeChild(title.childNodes[0]);
|
||||
title.appendChild(document.createComment("COMMENT"));
|
||||
title.appendChild(document.createTextNode("TEXT"));
|
||||
title.appendChild(document.createElement("a"))
|
||||
.appendChild(document.createTextNode("ELEMENT"))
|
||||
} catch (e) {
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(title.text, "TEXT");
|
||||
assert_equals(title.textContent, "TEXTELEMENT");
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>title.text with comment and element children.</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
try {
|
||||
var title = document.getElementsByTagName("title")[0];
|
||||
while (title.childNodes.length)
|
||||
title.removeChild(title.childNodes[0]);
|
||||
title.appendChild(document.createComment("COMMENT"));
|
||||
title.appendChild(document.createTextNode("TEXT"));
|
||||
title.appendChild(document.createElement("a"))
|
||||
.appendChild(document.createTextNode("ELEMENT"))
|
||||
} catch (e) {
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(title.text, "TEXT");
|
||||
assert_equals(title.textContent, "TEXTELEMENT");
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<title> title.text and space normalization </title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByTagName("title")[0].text,
|
||||
" title.text and space normalization ");
|
||||
assert_equals(document.getElementsByTagName("title")[0].textContent,
|
||||
" title.text and space normalization ");
|
||||
assert_equals(document.getElementsByTagName("title")[0].firstChild.nodeValue,
|
||||
" title.text and space normalization ");
|
||||
}, "title.text and space normalization (markup)");
|
||||
[
|
||||
"one space", "two spaces",
|
||||
"one\ttab", "two\t\ttabs",
|
||||
"one\nnewline", "two\n\nnewlines",
|
||||
"one\fform feed", "two\f\fform feeds",
|
||||
"one\rcarriage return", "two\r\rcarriage returns"
|
||||
].forEach(function(str) {
|
||||
test(function() {
|
||||
document.title = str;
|
||||
var title = document.getElementsByTagName("title")[0];
|
||||
assert_equals(title.text, str);
|
||||
assert_equals(title.textContent, str);
|
||||
assert_equals(title.firstChild.nodeValue, str);
|
||||
}, "title.text and space normalization: " + format_value(str))
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title> title.text and space normalization </title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByTagName("title")[0].text,
|
||||
" title.text and space normalization ");
|
||||
assert_equals(document.getElementsByTagName("title")[0].textContent,
|
||||
" title.text and space normalization ");
|
||||
assert_equals(document.getElementsByTagName("title")[0].firstChild.nodeValue,
|
||||
" title.text and space normalization ");
|
||||
}, "title.text and space normalization (markup)");
|
||||
[
|
||||
"one space", "two spaces",
|
||||
"one\ttab", "two\t\ttabs",
|
||||
"one\nnewline", "two\n\nnewlines",
|
||||
"one\fform feed", "two\f\fform feeds",
|
||||
"one\rcarriage return", "two\r\rcarriage returns"
|
||||
].forEach(function(str) {
|
||||
test(function() {
|
||||
document.title = str;
|
||||
var title = document.getElementsByTagName("title")[0];
|
||||
assert_equals(title.text, str);
|
||||
assert_equals(title.textContent, str);
|
||||
assert_equals(title.firstChild.nodeValue, str);
|
||||
}, "title.text and space normalization: " + format_value(str))
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue