mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Correct the checks in step 5 of Node::pre_insert.
This commit is contained in:
parent
561fab57d6
commit
859f14f38b
2 changed files with 6 additions and 19 deletions
|
@ -1216,17 +1216,15 @@ impl Node {
|
||||||
// Step 4-5.
|
// Step 4-5.
|
||||||
match node.type_id() {
|
match node.type_id() {
|
||||||
TextNodeTypeId => {
|
TextNodeTypeId => {
|
||||||
match node.parent_node().root() {
|
if parent.is_document() {
|
||||||
Some(ref parent) if parent.is_document() => return Err(HierarchyRequest),
|
return Err(HierarchyRequest);
|
||||||
_ => ()
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
DoctypeNodeTypeId => {
|
DoctypeNodeTypeId => {
|
||||||
match node.parent_node().root() {
|
if !parent.is_document() {
|
||||||
Some(ref parent) if !parent.is_document() => return Err(HierarchyRequest),
|
return Err(HierarchyRequest);
|
||||||
_ => ()
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
DocumentFragmentNodeTypeId |
|
DocumentFragmentNodeTypeId |
|
||||||
ElementNodeTypeId(_) |
|
ElementNodeTypeId(_) |
|
||||||
ProcessingInstructionNodeTypeId |
|
ProcessingInstructionNodeTypeId |
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
[Node-insertBefore.html]
|
|
||||||
type: testharness
|
|
||||||
[If the context node is a document, inserting a document or text node should throw a HierarchyRequestError.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[If the context node is a DocumentFragment, inserting a document or a doctype should throw a HierarchyRequestError.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[If the context node is an element, inserting a document or a doctype should throw a HierarchyRequestError.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue