Skip to content

Commit

Permalink
Avoid panicking in the implementation of HTMLOptionElement#text for n…
Browse files Browse the repository at this point in the history
…on-element, non-text children.
  • Loading branch information
Ms2ger committed Oct 12, 2015
1 parent edfcc50 commit 116d489
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions html/semantics/forms/the-option-element/option-text-recurse.html
Expand Up @@ -74,4 +74,19 @@
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>

0 comments on commit 116d489

Please sign in to comment.