Skip to content

Commit

Permalink
Merge 927420c into 3a82efd
Browse files Browse the repository at this point in the history
  • Loading branch information
dy committed Jan 31, 2015
2 parents 3a82efd + 927420c commit 57b888c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -266,7 +266,7 @@ extend(HTMLElement, Node, {
for (var i = 0, key = tag === 1 ? "nodeType" : "nodeName"; (el = next); ) {
if (el[key] === tag) els[i++] = el
next = el.firstChild || el.nextSibling
while (!next && (el = el.parentNode)) next = el.nextSibling
while (!next && ((el = el.parentNode) !== this)) next = el.nextSibling
}
return els
},
Expand Down
4 changes: 4 additions & 0 deletions tests/index.js
Expand Up @@ -331,6 +331,10 @@ test("getElementById, getElementsByTagName, querySelector", function (assert) {
assert.equal(document.querySelectorAll("div").length, 8)
assert.equal(document.querySelectorAll(".findme").length, 2)
assert.equal(document.querySelectorAll("span.findme").length, 1)

assert.equal(el1.querySelectorAll("div").length, 2);
// assert.equal(document.querySelectorAll("body").length, 1)

assert.end()
})

0 comments on commit 57b888c

Please sign in to comment.