diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-03-07 13:31:22 +0100 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-03-07 13:31:22 +0100 |
commit | 57291e56094c13c0ccdd02fc126ca04f4abfea9f (patch) | |
tree | 41fa928fd158063e0c8523253c93f9905209c520 | |
parent | b66839367c40bf2557c721cd964feb91d5cf3287 (diff) | |
download | servo-57291e56094c13c0ccdd02fc126ca04f4abfea9f.tar.gz servo-57291e56094c13c0ccdd02fc126ca04f4abfea9f.zip |
Remove obsolete step from Text::SplitText
https://github.com/whatwg/dom/pull/419
-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) } |