Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255

This commit is contained in:
James Graham 2015-03-27 09:15:38 +00:00
parent b2a5225831
commit 1a81b18b9f
12321 changed files with 544385 additions and 6 deletions

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Test: The scoped attribute must apply the style information only to its parent element</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-style-scoped">
<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: 50px;
}
</style>
</head>
<body>
<div id="log"></div>
<div id="test"></div>
<div>
<style id="style">
#test {
width: 100px;
}
</style>
<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, "100px", "The style 'width' should be applied.");
style.scoped = true;
width2 = window.getComputedStyle(testElement, false)["width"];
assert_equals(width2, "50px", "The width should not be applied.");
}, "The scoped attribute is present, the style information must be applied only to its parent element");
</script>
</body>
</html>