mirror of
https://github.com/servo/servo.git
synced 2025-09-04 20:18:21 +01:00
Update web-platform-tests to revision e426a6933a05bf144eba06a1d4c47ba876a4e2d1
This commit is contained in:
parent
415b26e4f1
commit
5e5eccabf8
495 changed files with 14920 additions and 784 deletions
|
@ -38,6 +38,32 @@
|
|||
assert_equals(styleSheet.cssRules[2], undefined, "CSSStyleSheet cssRules attribute after deleteRule function");
|
||||
assert_equals(styleSheet.cssRules[0].randomProperty, 1, "[SameObject] cssRules attribute after deleteRule function");
|
||||
assert_equals(styleSheet.cssRules[1].randomProperty, 2, "[SameObject] cssRules attribute after deleteRule function");
|
||||
|
||||
styleSheet.removeRule();
|
||||
assert_equals(styleSheet.cssRules.length, 1, "CSSStyleSheet cssRules attribute after removeRule function");
|
||||
assert_equals(styleSheet.cssRules[0].cssText, "#foo { height: 100px; }", "CSSStyleSheet cssRules attribute after removeRule function");
|
||||
|
||||
assert_equals(styleSheet.addRule("@media all", "#foo { color: red }"), -1);
|
||||
assert_equals(styleSheet.cssRules.length, 2, "CSSStyleSheet cssRules attribute after addRule function");
|
||||
assert_true(styleSheet.cssRules[1] instanceof CSSMediaRule, "CSSStyleSheet addRule does some silly string concatenation");
|
||||
|
||||
styleSheet.removeRule(1);
|
||||
assert_equals(styleSheet.cssRules.length, 1, "CSSStyleSheet cssRules attribute after removeRule function with index");
|
||||
assert_equals(styleSheet.cssRules[0].cssText, "#foo { height: 100px; }", "CSSStyleSheet cssRules attribute after deleteRule function with index");
|
||||
|
||||
assert_equals(styleSheet.addRule("#foo", "color: red"), -1);
|
||||
assert_equals(styleSheet.cssRules.length, 2, "CSSStyleSheet cssRules attribute after addRule function with simple selector");
|
||||
assert_equals(styleSheet.cssRules[1].cssText, "#foo { color: red; }", "CSSStyleSheet cssRules attribute after addRule function without index appends to the end");
|
||||
|
||||
assert_equals(styleSheet.addRule("#foo", "color: blue", 0), -1);
|
||||
assert_equals(styleSheet.cssRules.length, 3, "CSSStyleSheet cssRules attribute after addRule function with simple selector with index");
|
||||
assert_equals(styleSheet.cssRules[0].cssText, "#foo { color: blue; }", "addRule function with index performs an insertion");
|
||||
|
||||
assert_equals(styleSheet.addRule(), -1);
|
||||
assert_equals(styleSheet.cssRules.length, 4, "CSSStyleSheet cssRules attribute after addRule function without arguments");
|
||||
assert_equals(styleSheet.cssRules[3].cssText, "undefined { }", "addRule arguments default to undefined");
|
||||
|
||||
assert_equals(styleSheet.cssRules, styleSheet.rules, "CSSStyleSheet.rules returns the same object as CSSStyleSheet.cssRules");
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>CSS Test: CSSStyleDeclaration properties are defined as WebIDL attributes, not using getOwnPropertyNames()</title>
|
||||
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
|
||||
<link rel="author" href="https://mozilla.org" title="Mozilla">
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-_camel_cased_attribute">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
test(function() {
|
||||
let declaration = document.documentElement.style;
|
||||
assert_true(declaration instanceof CSSStyleDeclaration, "Should be a CSStyleDeclaration");
|
||||
assert_true("color" in declaration, "Should support the color property");
|
||||
assert_false(declaration.hasOwnProperty("color"), "shouldn't have an own property for WebIDL attributes");
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSSOM: resolved values of the width and height when the element generates no box or are a non-replaced inline aren't clamped by min-width / max-width</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-value">
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
<link rel="author" title="Mozilla" href="https://mozilla.org">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<span id="non-replaced-inline"></span>
|
||||
<div id="display-none" style="display: none"></div>
|
||||
<div id="display-contents" style="display: contents"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
for (const e of document.querySelectorAll("[id]")) {
|
||||
const cs = getComputedStyle(e);
|
||||
for (const prop of ["width", "height"]) {
|
||||
e.style.setProperty("min-" + prop, "10px");
|
||||
e.style.setProperty("max-" + prop, "50px");
|
||||
|
||||
e.style.setProperty(prop, "10%");
|
||||
assert_equals(cs[prop], "10%", `${e.id}: ${prop} with percentages returns percentages`);
|
||||
|
||||
e.style.setProperty(prop, "15px");
|
||||
assert_equals(cs[prop], "15px", `${e.id}: ${prop} with value in range returns computed value`);
|
||||
|
||||
e.style.setProperty(prop, "1px");
|
||||
assert_equals(cs[prop], "1px", `${e.id}: ${prop} with value out of range isn't clamped by min-${prop}`);
|
||||
|
||||
e.style.setProperty(prop, "60px");
|
||||
assert_equals(cs[prop], "60px", `${e.id}: ${prop} with value out of range isn't clamped by max-${prop}`);
|
||||
|
||||
e.style.removeProperty(prop);
|
||||
e.style.removeProperty("min-" + prop);
|
||||
e.style.removeProperty("max-" + prop);
|
||||
}
|
||||
}
|
||||
}, "Resolved value of width / height when there's no used value isn't clamped by min/max properties");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue