aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-01-21 20:58:52 +0100
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-04-26 10:17:44 +0200
commit4304ee28dceffa8ad66f5b088754705bc2bb3b4e (patch)
tree57045d149bab44e0c6fe38e02c75f5762807ed25 /components/script/dom/node.rs
parent18ae0fcbd6af223f978a527d7d5039633d3c22ed (diff)
downloadservo-4304ee28dceffa8ad66f5b088754705bc2bb3b4e.tar.gz
servo-4304ee28dceffa8ad66f5b088754705bc2bb3b4e.zip
Partial ShadowRoot implementation of DocumentOrShadowRoot
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index a015324b449..33c05aa2a5a 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -1560,7 +1560,9 @@ impl Node {
) -> ErrorResult {
// Step 1.
match parent.type_id() {
- NodeTypeId::Document(_) | NodeTypeId::DocumentFragment(_) | NodeTypeId::Element(..) => (),
+ NodeTypeId::Document(_) | NodeTypeId::DocumentFragment(_) | NodeTypeId::Element(..) => {
+ ()
+ },
_ => return Err(Error::HierarchyRequest),
}
@@ -2248,7 +2250,9 @@ impl NodeMethods for Node {
fn ReplaceChild(&self, node: &Node, child: &Node) -> Fallible<DomRoot<Node>> {
// Step 1.
match self.type_id() {
- NodeTypeId::Document(_) | NodeTypeId::DocumentFragment(_) | NodeTypeId::Element(..) => (),
+ NodeTypeId::Document(_) | NodeTypeId::DocumentFragment(_) | NodeTypeId::Element(..) => {
+ ()
+ },
_ => return Err(Error::HierarchyRequest),
}
@@ -2351,8 +2355,10 @@ impl NodeMethods for Node {
// Step 12.
rooted_vec!(let mut nodes);
- let nodes = if node.type_id() == NodeTypeId::DocumentFragment(DocumentFragmentTypeId::DocumentFragment) ||
- node.type_id() == NodeTypeId::DocumentFragment(DocumentFragmentTypeId::ShadowRoot) {
+ let nodes = if node.type_id() ==
+ NodeTypeId::DocumentFragment(DocumentFragmentTypeId::DocumentFragment) ||
+ node.type_id() == NodeTypeId::DocumentFragment(DocumentFragmentTypeId::ShadowRoot)
+ {
nodes.extend(node.children().map(|node| Dom::from_ref(&*node)));
nodes.r()
} else {