Avoid panicking in the implementation of HTMLOptionElement#text for non-element, non-text children.

This commit is contained in:
Ms2ger 2015-10-07 10:52:44 +02:00
parent 409fbafe9c
commit 6e745b5a00
2 changed files with 17 additions and 1 deletions

View file

@ -74,4 +74,19 @@ test(function() {
option.appendChild(document.createTextNode("text"));
assert_equals(option.text, "text");
}, "option.text should work if the option is in a MathML script element");
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode("te"));
option.appendChild(document.createComment("comment"));
option.appendChild(document.createTextNode("xt"));
assert_equals(option.text, "text");
}, "option.text should ignore comment children");
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode("te"));
option.appendChild(document.createProcessingInstruction("target", "data"));
option.appendChild(document.createTextNode("xt"));
assert_equals(option.text, "text");
}, "option.text should ignore PI children");
</script>