aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-11-16 12:38:46 +0100
committerMs2ger <ms2ger@gmail.com>2014-11-16 12:40:42 +0100
commit859f14f38be753d20b7cf926af81e26dc22d3a31 (patch)
treec14f823f43f55114dc8eafaa3ac4033ad4f4dd30 /components/script/dom/node.rs
parent561fab57d6ac23758f0150e043be28adda12c772 (diff)
downloadservo-859f14f38be753d20b7cf926af81e26dc22d3a31.tar.gz
servo-859f14f38be753d20b7cf926af81e26dc22d3a31.zip
Correct the checks in step 5 of Node::pre_insert.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 4c7d24f8f4f..0242363dbf7 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -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 |