mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Upgrade rust-selectors, pass ':empty' tests
https://github.com/servo/rust-selectors/pull/36
This commit is contained in:
parent
406be7accf
commit
b1b03a32db
10 changed files with 110 additions and 10 deletions
|
@ -1,8 +1,5 @@
|
|||
[Element-closest.html]
|
||||
type: testharness
|
||||
[Element.closest with context node 'test10' and selector ':empty']
|
||||
expected: FAIL
|
||||
|
||||
[Element.closest with context node 'test11' and selector ':invalid']
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -63,6 +63,18 @@
|
|||
"url": "/_mozilla/css/absolute_hypothetical_float.html"
|
||||
}
|
||||
],
|
||||
"css/empty_pseudo_selector.html": [
|
||||
{
|
||||
"path": "css/empty_pseudo_selector.html",
|
||||
"references": [
|
||||
[
|
||||
"/_mozilla/css/empty_pseudo_selector_ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
"url": "/_mozilla/css/empty_pseudo_selector.html"
|
||||
}
|
||||
],
|
||||
"css/class-namespaces.html": [
|
||||
{
|
||||
"path": "css/class-namespaces.html",
|
||||
|
@ -455,6 +467,12 @@
|
|||
"url": "/_mozilla/mozilla/element_matches.html"
|
||||
}
|
||||
],
|
||||
"mozilla/element_matches_empty.html": [
|
||||
{
|
||||
"path": "mozilla/element_matches_empty.html",
|
||||
"url": "/_mozilla/mozilla/element_matches_empty.html"
|
||||
}
|
||||
],
|
||||
"mozilla/empty_clientrect.html": [
|
||||
{
|
||||
"path": "mozilla/empty_clientrect.html",
|
||||
|
|
17
tests/wpt/mozilla/tests/css/empty_pseudo_selector.html
Normal file
17
tests/wpt/mozilla/tests/css/empty_pseudo_selector.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<style>
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: purple;
|
||||
}
|
||||
|
||||
div:empty {
|
||||
background-color: orange;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div></div>
|
||||
<div><!-- hello world --></div>
|
||||
<div><span></span></div>
|
||||
<div> </div>
|
||||
<div>foo</div>
|
20
tests/wpt/mozilla/tests/css/empty_pseudo_selector_ref.html
Normal file
20
tests/wpt/mozilla/tests/css/empty_pseudo_selector_ref.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<style>
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.purple {
|
||||
background-color: purple;
|
||||
}
|
||||
|
||||
.orange {
|
||||
background-color: orange;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div class="orange"></div>
|
||||
<div class="orange"></div>
|
||||
<div class="purple"></div>
|
||||
<div class="purple"></div>
|
||||
<div class="purple">foo</div>
|
26
tests/wpt/mozilla/tests/mozilla/element_matches_empty.html
Normal file
26
tests/wpt/mozilla/tests/mozilla/element_matches_empty.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="empty"></div>
|
||||
<div class="empty"><!-- hello world --></div>
|
||||
<div><span></span></div>
|
||||
<div> </div>
|
||||
<div>foo</div>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
var testCount = 0;
|
||||
for (var elem of document.getElementsByTagName("div")) {
|
||||
var actual = elem.matches(":empty");
|
||||
var expected = elem.className === "empty";
|
||||
var testName = "test-matches-empty-" + testCount;
|
||||
assert_equals(actual, expected, testName);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue