Upgrade rust-selectors, pass ':empty' tests

https://github.com/servo/rust-selectors/pull/36
This commit is contained in:
Corey Farwell 2015-07-13 09:10:50 +09:00
parent 406be7accf
commit b1b03a32db
10 changed files with 110 additions and 10 deletions

View file

@ -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

View file

@ -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",

View 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>

View 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>

View 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>