aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/range.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/range.rs
parent18ae0fcbd6af223f978a527d7d5039633d3c22ed (diff)
downloadservo-4304ee28dceffa8ad66f5b088754705bc2bb3b4e.tar.gz
servo-4304ee28dceffa8ad66f5b088754705bc2bb3b4e.zip
Partial ShadowRoot implementation of DocumentOrShadowRoot
Diffstat (limited to 'components/script/dom/range.rs')
-rw-r--r--components/script/dom/range.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs
index 9a1bc5db7a6..96f276944bc 100644
--- a/components/script/dom/range.rs
+++ b/components/script/dom/range.rs
@@ -764,8 +764,11 @@ impl RangeMethods for Range {
// Step 11
let new_offset = new_offset +
- if node.type_id() == NodeTypeId::DocumentFragment(DocumentFragmentTypeId::DocumentFragment) ||
- node.type_id() == NodeTypeId::DocumentFragment(DocumentFragmentTypeId::ShadowRoot) {
+ if node.type_id() ==
+ NodeTypeId::DocumentFragment(DocumentFragmentTypeId::DocumentFragment) ||
+ node.type_id() ==
+ NodeTypeId::DocumentFragment(DocumentFragmentTypeId::ShadowRoot)
+ {
node.len()
} else {
1
@@ -880,7 +883,9 @@ impl RangeMethods for Range {
// Step 2.
match new_parent.type_id() {
- NodeTypeId::Document(_) | NodeTypeId::DocumentType | NodeTypeId::DocumentFragment(_) => {
+ NodeTypeId::Document(_) |
+ NodeTypeId::DocumentType |
+ NodeTypeId::DocumentFragment(_) => {
return Err(Error::InvalidNodeType);
},
_ => (),