mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Implement getComputedStyle
This commit is contained in:
parent
416931f4be
commit
e484d6b5e3
24 changed files with 886 additions and 152 deletions
|
@ -1,9 +1,8 @@
|
|||
[events-006.htm]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[transition padding-left on :before / events]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[transition padding-left on :after / events]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
[pseudo-elements-001.htm]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[transition padding-left on :before / values]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[transition padding-left on :after / values]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[transition padding-left on :before, changing content / values]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[transition padding-left on :after, changing content / values]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
[Element-classlist.html]
|
||||
type: testharness
|
||||
[CSS .foo selectors must not match elements without any class]
|
||||
expected: FAIL
|
||||
|
||||
[computed style must update when setting .className]
|
||||
expected: FAIL
|
||||
|
||||
[classList.add must not cause the CSS selector to stop matching]
|
||||
expected: FAIL
|
||||
|
||||
[classList.remove must not break case-sensitive CSS selector matching]
|
||||
expected: FAIL
|
||||
|
||||
[classList.toggle must not break case-sensitive CSS selector matching]
|
||||
expected: FAIL
|
||||
|
||||
[CSS class selectors must stop matching when all classes have been removed]
|
||||
expected: FAIL
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
[id-attribute.html]
|
||||
type: testharness
|
||||
[User agents must associate the element with an id value for purposes of CSS.]
|
||||
expected: FAIL
|
||||
|
||||
[Association for CSS is exact and therefore case-sensitive.]
|
||||
expected: FAIL
|
||||
|
||||
[Spaces are allowed in an id and still make an association.]
|
||||
expected: FAIL
|
||||
|
||||
[Non-ASCII is allowed in an id and still make an association for CSS.]
|
||||
expected: FAIL
|
||||
|
||||
[After setting id via id attribute, CSS association is via the new ID.]
|
||||
expected: FAIL
|
||||
|
||||
[After setting id via setAttribute attribute, CSS association is via the new ID.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[del_effect.html]
|
||||
type: testharness
|
||||
[HTML Test: Text in the del element should be 'line-through']
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[ins_effect.html]
|
||||
type: testharness
|
||||
[HTML Test: Text in the ins element should be 'underline']
|
||||
expected: FAIL
|
||||
|
|
@ -533,6 +533,12 @@
|
|||
"url": "/_mozilla/mozilla/getBoundingClientRect.html"
|
||||
}
|
||||
],
|
||||
"mozilla/getComputedStyle.html": [
|
||||
{
|
||||
"path": "mozilla/getComputedStyle.html",
|
||||
"url": "/_mozilla/mozilla/getComputedStyle.html"
|
||||
}
|
||||
],
|
||||
"mozilla/getPropertyPriority.html": [
|
||||
{
|
||||
"path": "mozilla/getPropertyPriority.html",
|
||||
|
@ -974,4 +980,4 @@
|
|||
"rev": null,
|
||||
"url_base": "/_mozilla/",
|
||||
"version": 2
|
||||
}
|
||||
}
|
||||
|
|
45
tests/wpt/mozilla/tests/mozilla/getComputedStyle.html
Normal file
45
tests/wpt/mozilla/tests/mozilla/getComputedStyle.html
Normal file
|
@ -0,0 +1,45 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#foo:before {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#foo {
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="foo"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var div = document.getElementById("foo");
|
||||
var cs = getComputedStyle(div);
|
||||
assert_equals(cs.getPropertyValue("left"), "auto");
|
||||
assert_equals(cs.getPropertyValue("right"), "auto");
|
||||
assert_equals(cs.getPropertyValue("top"), "auto");
|
||||
assert_equals(cs.getPropertyValue("bottom"), "auto");
|
||||
assert_equals(cs.getPropertyValue("width"), "50px");
|
||||
assert_equals(cs.getPropertyValue("height"), "auto");
|
||||
assert_equals(cs.getPropertyValue("color"), "rgb(0, 0, 0)");
|
||||
}, "Element's resolved values");
|
||||
|
||||
test(function() {
|
||||
var div = document.getElementById("foo");
|
||||
assert_equals(getComputedStyle(div, ':before').getPropertyValue("color"), "rgb(255, 0, 0)");
|
||||
assert_equals(getComputedStyle(div, '::before').getPropertyValue("color"), "rgb(255, 0, 0)");
|
||||
}, "Existing :before pseudoelement");
|
||||
|
||||
test(function() {
|
||||
var div = document.getElementById("foo");
|
||||
assert_equals(getComputedStyle(div, ':after').getPropertyValue("color"), "");
|
||||
assert_equals(getComputedStyle(div, '::after').getPropertyValue("color"), "");
|
||||
}, "Missing :after pseudoelement");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue