Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure getElementById always returns the first element with the gi…
…ven ID in tree order.(fixes #1822)
- Loading branch information
Showing
3 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/test/content/test_document_getElementById_tree_order.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<html> | ||
<head> | ||
<script src="harness.js"></script> | ||
</head> | ||
<body> | ||
<div id="a"> | ||
</div> | ||
<div id="b"> | ||
<p id="b">P</p> | ||
<input id="b" type="submit" value="Submit"> | ||
</div> | ||
<script> | ||
{ | ||
var b = document.getElementById("b"); | ||
is_a(b, HTMLDivElement); | ||
var a = document.getElementById("a"); | ||
var p = document.createElement("p"); | ||
p.id = "b"; | ||
a.appendChild(p); | ||
var newB = document.getElementById("b"); | ||
is_a(newB, HTMLParagraphElement); | ||
} | ||
{ | ||
var gbody = document.getElementsByTagName("body")[0]; | ||
var div = document.createElement("div"); | ||
div.setAttribute("id", "c"); | ||
var h1 = document.createElement("h1"); | ||
h1.setAttribute("id", "c"); | ||
gbody.appendChild(div); | ||
gbody.appendChild(h1); | ||
var c = document.getElementById("c"); | ||
is_a(c, HTMLDivElement); | ||
gbody.removeChild(div); | ||
var newC = document.getElementById("c"); | ||
is_a(newC, HTMLHeadingElement); | ||
} | ||
finish(); | ||
</script> | ||
</body> | ||
</html> |
50aea70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from jdm
at https://github.com/lpy/servo/commit/50aea70f98915345169e8f0f55db7f78b39b9552
50aea70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging lpy/servo/issue1822 = 50aea70 into auto
50aea70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lpy/servo/issue1822 = 50aea70 merged ok, testing candidate = 51ff762
50aea70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://servo-buildbot.pub.build.mozilla.org/builders/linux/builds/1176
success: http://servo-buildbot.pub.build.mozilla.org/builders/mac/builds/1131
50aea70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 51ff762