Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
2 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
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,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="harness.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
// test1: Node.normalize | ||
var parent1 = document.createElement("div"); | ||
var child1 = document.createTextNode("aaa"); | ||
var child2 = document.createTextNode(""); | ||
var child3 = document.createTextNode("bb"); | ||
|
||
var parent2 = document.createElement("div"); | ||
|
||
parent1.appendChild(child1); | ||
parent1.appendChild(child2); | ||
parent1.appendChild(child3); | ||
|
||
parent2.appendChild(document.createTextNode("")); | ||
|
||
parent1.normalize(); | ||
parent2.normalize(); | ||
|
||
is(Array.prototype.map.call(parent1.childNodes, function(el) {return el.length}).indexOf(0), -1, "Node.normalize removes empty text nodes"); | ||
is(parent1.childNodes.length, 1, "Node.normalize merges text nodes in one"); | ||
is(parent1.childNodes[0].length, 5, "test 1-2, Node.normalize merges text nodes values"); | ||
is(parent2.childNodes.length, 0, "Node.normalize removes empty text nodes even if there is only one text node"); | ||
is(child2.textContent, "", "Node.normalize doesn't change removed children original content") | ||
is(child3.textContent, "bb", "Node.normalize doesn't change removed children original content") | ||
|
||
finish(); | ||
</script> | ||
</body> | ||
</html> |
574fba3
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 Ms2ger
at khodzha@574fba3
574fba3
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 khodzha/servo/node_normalize = 574fba3 into auto
574fba3
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.
khodzha/servo/node_normalize = 574fba3 merged ok, testing candidate = 2d2fae5
574fba3
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/1090
success: http://servo-buildbot.pub.build.mozilla.org/builders/mac/builds/1045
574fba3
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 = 2d2fae5