mirror of
https://github.com/servo/servo.git
synced 2025-09-12 16:08:20 +01:00
Update web-platform-tests to revision 58b72393db0bd273bb93268c33666cf893feb985
This commit is contained in:
parent
43a4f01647
commit
64e0a52537
12717 changed files with 59835 additions and 59820 deletions
88
tests/wpt/web-platform-tests/css/cssom/cssimportrule.html
Normal file
88
tests/wpt/web-platform-tests/css/cssom/cssimportrule.html
Normal file
|
@ -0,0 +1,88 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CSSOM CSSRule CSSImportRule interface</title>
|
||||
<link rel="author" title="Letitia Lew" href="mailto:lew.letitia@gmail.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/cssom-1/#css-rules">
|
||||
<link rel="help" href="http://www.w3.org/TR/cssom-1/#the-cssrule-interface">
|
||||
<link rel="help" href="http://www.w3.org/TR/cssom-1/#the-cssimportrule-interface">
|
||||
<meta name="flags" content="dom">
|
||||
<meta name="assert" content="All properties for this CSSImportRule instance of CSSRule are initialized correctly">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<style id="styleElement" type="text/css">
|
||||
@import url("support/a-green.css");
|
||||
@import url("support/a-green.css") screen;
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var rule, ruleWithMedia;
|
||||
setup(function() {
|
||||
var styleSheet = document.getElementById("styleElement").sheet;
|
||||
var ruleList = styleSheet.cssRules;
|
||||
rule = ruleList[0];
|
||||
ruleWithMedia = ruleList[1];
|
||||
});
|
||||
|
||||
test(function() {
|
||||
assert_true(rule instanceof CSSRule);
|
||||
assert_true(rule instanceof CSSImportRule);
|
||||
assert_true(ruleWithMedia instanceof CSSRule);
|
||||
assert_true(ruleWithMedia instanceof CSSImportRule);
|
||||
}, "CSSRule and CSSImportRule types");
|
||||
|
||||
test(function() {
|
||||
assert_equals(rule.STYLE_RULE, 1);
|
||||
assert_equals(rule.IMPORT_RULE, 3);
|
||||
assert_equals(rule.MEDIA_RULE, 4);
|
||||
assert_equals(rule.FONT_FACE_RULE, 5);
|
||||
assert_equals(rule.PAGE_RULE, 6);
|
||||
assert_equals(rule.NAMESPACE_RULE, 10);
|
||||
assert_idl_attribute(rule, "type");
|
||||
assert_equals(typeof rule.type, "number");
|
||||
}, "Type of CSSRule#type and constant values");
|
||||
|
||||
test(function() {
|
||||
assert_true(rule instanceof CSSRule);
|
||||
assert_idl_attribute(rule, "cssText");
|
||||
assert_idl_attribute(rule, "parentRule");
|
||||
assert_idl_attribute(rule, "parentStyleSheet");
|
||||
|
||||
assert_readonly(rule, "type");
|
||||
assert_readonly(rule, "parentRule");
|
||||
assert_readonly(rule, "parentStyleSheet");
|
||||
}, "Existence and writability of CSSRule attributes");
|
||||
|
||||
test(function() {
|
||||
assert_equals(rule.type, rule.IMPORT_RULE);
|
||||
assert_equals(typeof rule.cssText, "string");
|
||||
assert_equals(rule.cssText, '@import url("support/a-green.css");');
|
||||
assert_equals(ruleWithMedia.cssText, '@import url("support/a-green.css") screen;');
|
||||
assert_equals(rule.parentRule, null);
|
||||
assert_true(rule.parentStyleSheet instanceof CSSStyleSheet);
|
||||
}, "Values of CSSRule attributes");
|
||||
|
||||
test(function() {
|
||||
assert_idl_attribute(rule, "href");
|
||||
assert_idl_attribute(rule, "media");
|
||||
assert_idl_attribute(rule, "styleSheet");
|
||||
|
||||
assert_readonly(rule, "href");
|
||||
assert_readonly(rule, "media");
|
||||
assert_readonly(rule, "styleSheet");
|
||||
}, "Existence and writability of CSSImportRule attributes");
|
||||
|
||||
test(function() {
|
||||
assert_equals(typeof rule.href, "string");
|
||||
assert_true(rule.media instanceof MediaList);
|
||||
assert_true(rule.styleSheet instanceof CSSStyleSheet);
|
||||
assert_true(ruleWithMedia.media.length > 0);
|
||||
assert_equals(ruleWithMedia.media.mediaText, "screen");
|
||||
}, "Values of CSSImportRule attributes");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue