auto merge of #4003 : Ms2ger/servo/pre-insert, r=jdm

This commit is contained in:
bors-servo 2014-11-16 07:24:28 -07:00
commit 1a40a6bc82
2 changed files with 6 additions and 19 deletions

View file

@ -1216,17 +1216,15 @@ impl Node {
// Step 4-5.
match node.type_id() {
TextNodeTypeId => {
match node.parent_node().root() {
Some(ref parent) if parent.is_document() => return Err(HierarchyRequest),
_ => ()
if parent.is_document() {
return Err(HierarchyRequest);
}
}
},
DoctypeNodeTypeId => {
match node.parent_node().root() {
Some(ref parent) if !parent.is_document() => return Err(HierarchyRequest),
_ => ()
if !parent.is_document() {
return Err(HierarchyRequest);
}
}
},
DocumentFragmentNodeTypeId |
ElementNodeTypeId(_) |
ProcessingInstructionNodeTypeId |

View file

@ -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