Skip to content

Commit

Permalink
Dom: Fixed unit test for IE7 for ancestors method
Browse files Browse the repository at this point in the history
  • Loading branch information
Frances Berriman committed Sep 4, 2009
1 parent 7341326 commit 169f2e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/dom/dom.js
Expand Up @@ -2098,13 +2098,14 @@
length = this.length,
elm;

for (; i < length; i++) {
elm = this[i];
while (i < length) {
elm = this[i].parentNode;

while (elm = elm.parentNode) {
while (elm && elm.nodeType == 1) {
ret[ri++] = elm;
elm = elm.parentNode;
}

i++;
}

return r.get(unique(ret));
Expand Down
1 change: 1 addition & 0 deletions test/glow/dom/dom.js
Expand Up @@ -1028,6 +1028,7 @@ t.test("glow.dom.NodeList.ancestors()", function() {

var nodes = glow.dom.get("#simon1, #foo").ancestors();
var expectedNodes = glow.dom.get("#firstp, #main, dl, body, html");


t.isSet(nodes, expectedNodes, "Gets only unique ancestors");

Expand Down

0 comments on commit 169f2e8

Please sign in to comment.