diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs index ab7f9027d5e..6be6695bb35 100644 --- a/components/script/dom/range.rs +++ b/components/script/dom/range.rs @@ -52,7 +52,7 @@ pub struct Range { associated_selections: DomRefCell>>, } -pub struct ContainedChildren { +struct ContainedChildren { first_partially_contained_child: Option>, last_partially_contained_child: Option>, contained_children: Vec>, @@ -161,7 +161,7 @@ impl Range { // Steps 5-6. let common_ancestor = self.CommonAncestorContainer(); - let first_contained_child = if start_node.is_inclusive_ancestor_of(&end_node) { + let first_partially_contained_child = if start_node.is_inclusive_ancestor_of(&end_node) { // Step 7. None } else { @@ -171,7 +171,7 @@ impl Range { .find(|node| Range::partially_contains(self, node)) }; - let last_contained_child = if end_node.is_inclusive_ancestor_of(&start_node) { + let last_partially_contained_child = if end_node.is_inclusive_ancestor_of(&start_node) { // Step 9. None } else { @@ -193,8 +193,8 @@ impl Range { } Ok(ContainedChildren { - first_partially_contained_child: first_contained_child, - last_partially_contained_child: last_contained_child, + first_partially_contained_child, + last_partially_contained_child, contained_children, }) } @@ -584,12 +584,12 @@ impl RangeMethods for Range { // Steps 5-12. let ContainedChildren { - first_partially_contained_child: first_contained_child, - last_partially_contained_child: last_contained_child, + first_partially_contained_child, + last_partially_contained_child, contained_children, } = self.contained_children()?; - if let Some(child) = first_contained_child { + if let Some(child) = first_partially_contained_child { // Step 13. if let Some(cdata) = child.downcast::() { assert!(child == start_node); @@ -629,7 +629,7 @@ impl RangeMethods for Range { fragment.upcast::().AppendChild(&clone)?; } - if let Some(child) = last_contained_child { + if let Some(child) = last_partially_contained_child { // Step 16. if let Some(cdata) = child.downcast::() { assert!(child == end_node); @@ -701,8 +701,8 @@ impl RangeMethods for Range { // Steps 5-12. let ContainedChildren { - first_partially_contained_child: first_contained_child, - last_partially_contained_child: last_contained_child, + first_partially_contained_child, + last_partially_contained_child, contained_children, } = self.contained_children()?; @@ -723,7 +723,7 @@ impl RangeMethods for Range { ) }; - if let Some(child) = first_contained_child { + if let Some(child) = first_partially_contained_child { if let Some(start_data) = child.downcast::() { assert!(child == start_node); // Step 15.1. @@ -768,7 +768,7 @@ impl RangeMethods for Range { fragment.upcast::().AppendChild(&child)?; } - if let Some(child) = last_contained_child { + if let Some(child) = last_partially_contained_child { if let Some(end_data) = child.downcast::() { assert!(child == end_node); // Step 18.1.