diff options
-rw-r--r-- | components/script/dom/range.rs | 6 | ||||
-rw-r--r-- | components/script/dom/text.rs | 9 |
2 files changed, 3 insertions, 12 deletions
diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs index 8a6de0bc4e6..b5521e93d55 100644 --- a/components/script/dom/range.rs +++ b/components/script/dom/range.rs @@ -1214,12 +1214,6 @@ impl WeakRangeVec { } } - /// Used for steps 9.1-2. when splitting a text node. - /// https://dom.spec.whatwg.org/#concept-text-split - pub fn clamp_above(&self, node: &Node, offset: u32) { - self.map_offset_above(node, offset, |_| offset); - } - fn map_offset_above<F: FnMut(u32) -> u32>(&self, node: &Node, offset: u32, mut f: F) { unsafe { (*self.cell.get()).update(|entry| { diff --git a/components/script/dom/text.rs b/components/script/dom/text.rs index dd2a85ec63f..0343b373931 100644 --- a/components/script/dom/text.rs +++ b/components/script/dom/text.rs @@ -43,7 +43,8 @@ impl Text { } impl TextMethods for Text { - // https://dom.spec.whatwg.org/#dom-text-splittextoffset + // https://dom.spec.whatwg.org/#dom-text-splittext + // https://dom.spec.whatwg.org/#concept-text-split fn SplitText(&self, offset: u32) -> Fallible<Root<Text>> { let cdata = self.upcast::<CharacterData>(); // Step 1. @@ -72,11 +73,7 @@ impl TextMethods for Text { } // Step 8. cdata.DeleteData(offset, count).unwrap(); - if parent.is_none() { - // Step 9. - node.ranges().clamp_above(&node, offset); - } - // Step 10. + // Step 9. Ok(new_node) } |