Fix attribute selectors.
There was a return missing in SelectorChecker, we were also making the attribute names lowercase which is not neccesary in Sky. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/815613002
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
Running 5 tests
|
||||
Running 7 tests
|
||||
ok 1 querySelector should find elements by class name
|
||||
ok 2 querySelector should find elements by id
|
||||
ok 3 querySelector should find elements by tag name
|
||||
ok 4 querySelector should find an element by compound selector
|
||||
ok 5 querySelector should find all elements by compound selector
|
||||
5 tests
|
||||
5 pass
|
||||
ok 6 querySelector should find all elements by attribute presence selector
|
||||
ok 7 querySelector should find all elements by attribute value selector
|
||||
7 tests
|
||||
7 pass
|
||||
0 fail
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
<tag-name-3 class="class7" id="tag1"></tag-name-3>
|
||||
<tag-name-3 class="class7" id="tag2"></tag-name-3>
|
||||
<span class="class2">
|
||||
<span class="class5" id="id5"></span>
|
||||
<span class="class5" id="id5" testAttr></span>
|
||||
</span>
|
||||
<div id="id5"></div>
|
||||
<tag-name-6 class="class6" id="id6">
|
||||
<tag-name-6 class="class6" id="id6" testAttr="the value">
|
||||
<tag-name-3 class="class7" id="tag2"></tag-name-3>
|
||||
</tag-name-6>
|
||||
</div>
|
||||
@@ -57,6 +57,17 @@ describe("querySelector", function() {
|
||||
assert.equal(queryAll("tag-name-3.class7")[0].id, "tag1");
|
||||
assert.equal(queryAll("tag-name-3.class7")[1].id, "tag2");
|
||||
});
|
||||
it("should find all elements by attribute presence selector", function() {
|
||||
assert.ok(queryAll("[testAttr]"));
|
||||
assert.equal(queryAll("[testAttr]").length, 2);
|
||||
assert.equal(queryAll("[testAttr]")[0].id, "id5");
|
||||
assert.equal(queryAll("[testAttr]")[1].id, "id6");
|
||||
});
|
||||
it("should find all elements by attribute value selector", function() {
|
||||
assert.ok(queryAll("[testAttr='the value']"));
|
||||
assert.equal(queryAll("[testAttr='the value']").length, 1);
|
||||
assert.equal(queryAll("[testAttr='the value']")[0].id, "id6");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user