mirror of
https://github.com/servo/servo
synced 2026-05-01 11:57:31 +02:00
Update CSS tests to revision 2baa72daab8bf37e3e910a9fd311a1eaa5b0f4a8
This commit is contained in:
54
tests/wpt/css-tests/cssom-1_dev/html/MediaList.htm
Normal file
54
tests/wpt/css-tests/cssom-1_dev/html/MediaList.htm
Normal file
@@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Test: the MediaList interface</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/cssom/#the-medialist-interface">
|
||||
<link rel="help" href="http://dev.w3.org/2006/webapi/WebIDL/#getownproperty">
|
||||
<style media="screen, print" id="test-style"></style>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script id="metadata_cache">/*
|
||||
{
|
||||
"MediaList": {},
|
||||
"MediaList.mediaText": {},
|
||||
"MediaList.length": {},
|
||||
"MediaList getter": {},
|
||||
"MediaList.item": {}
|
||||
}
|
||||
*/</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var ss = document.styleSheets[0];
|
||||
assert_equals(ss.ownerNode.id, "test-style", "Got the wrong style element");
|
||||
|
||||
var media = ss.media;
|
||||
test(function() {
|
||||
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=17526
|
||||
assert_equals(media.mediaText, "screen, print", "Serialization should be \"screen, print\"");
|
||||
}, "MediaList.mediaText");
|
||||
|
||||
test(function() {
|
||||
assert_equals(media.length, 2, "Got wrong number of media");
|
||||
}, "MediaList.length");
|
||||
|
||||
test(function() {
|
||||
assert_equals(media[-1], undefined, "media[-1] should return undefined");
|
||||
assert_equals(media[0], "screen", "media[0] should return \"screen\"");
|
||||
assert_equals(media[1], "print", "media[1] should return \"print\"");
|
||||
assert_equals(media[2], undefined, "media[2] should return undefined");
|
||||
}, "MediaList getter");
|
||||
|
||||
test(function() {
|
||||
assert_equals(media.item(-1), null, "media.item(-1) should return null");
|
||||
assert_equals(media.item(0), "screen", "media.item(0) should return \"screen\"");
|
||||
assert_equals(media.item(1), "print", "media.item(1) should return \"print\"");
|
||||
assert_equals(media.item(2), null, "media.item(2) should return null");
|
||||
}, "MediaList.item");
|
||||
}, "MediaList");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user