mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Avoid panicking in the implementation of HTMLOptionElement#text for non-element, non-text children.
This commit is contained in:
parent
409fbafe9c
commit
6e745b5a00
2 changed files with 17 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue