diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-10-20 08:49:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-20 08:49:09 -0500 |
commit | 91077ee4185b4917f5f67bf7ebe7ea03ca3e7241 (patch) | |
tree | 304ffc8b4c7a28d620d96342db7b123fe535c352 /components/script/dom | |
parent | 041bd626ace013f93fa7fe101c70f36543fc9b0d (diff) | |
parent | 07e7e670985442c4eef7dd33a3a204dbec46f914 (diff) | |
download | servo-91077ee4185b4917f5f67bf7ebe7ea03ca3e7241.tar.gz servo-91077ee4185b4917f5f67bf7ebe7ea03ca3e7241.zip |
Auto merge of #18946 - cynicaldevil:update-h5e, r=nox
Update h5e version
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18946)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/servoparser/async_html.rs | 8 | ||||
-rw-r--r-- | components/script/dom/servoparser/mod.rs | 24 |
2 files changed, 13 insertions, 19 deletions
diff --git a/components/script/dom/servoparser/async_html.rs b/components/script/dom/servoparser/async_html.rs index bbfa1da0a93..d8ae85efe9c 100644 --- a/components/script/dom/servoparser/async_html.rs +++ b/components/script/dom/servoparser/async_html.rs @@ -586,10 +586,6 @@ impl TreeSink for Sink { target.qual_name.as_ref().expect("Expected qual name of node!").expanded() } - fn same_tree(&self, _: &Self::Handle, _: &Self::Handle) -> bool { - unreachable!(); - } - fn create_element(&mut self, name: QualName, html_attrs: Vec<HtmlAttribute>, _flags: ElementFlags) -> Self::Handle { let mut node = self.new_parse_node(); @@ -632,10 +628,6 @@ impl TreeSink for Sink { node } - fn has_parent_node(&self, _: &Self::Handle) -> bool { - unreachable!(); - } - fn associate_with_form( &mut self, target: &Self::Handle, diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 08310326716..c9e82e0ac14 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -751,6 +751,19 @@ pub struct Sink { script: MutNullableDom<HTMLScriptElement>, } +impl Sink { + fn same_tree(&self, x: &Dom<Node>, y: &Dom<Node>) -> bool { + let x = x.downcast::<Element>().expect("Element node expected"); + let y = y.downcast::<Element>().expect("Element node expected"); + + x.is_in_same_home_subtree(y) + } + + fn has_parent_node(&self, node: &Dom<Node>) -> bool { + node.GetParentNode().is_some() + } +} + #[allow(unrooted_must_root)] // FIXME: really? impl TreeSink for Sink { type Output = Self; @@ -781,13 +794,6 @@ impl TreeSink for Sink { } } - fn same_tree(&self, x: &Dom<Node>, y: &Dom<Node>) -> bool { - let x = x.downcast::<Element>().expect("Element node expected"); - let y = y.downcast::<Element>().expect("Element node expected"); - - x.is_in_same_home_subtree(y) - } - fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>, _flags: ElementFlags) -> Dom<Node> { let is = attrs.iter() @@ -820,10 +826,6 @@ impl TreeSink for Sink { Dom::from_ref(pi.upcast()) } - fn has_parent_node(&self, node: &Dom<Node>) -> bool { - node.GetParentNode().is_some() - } - fn associate_with_form(&mut self, target: &Dom<Node>, form: &Dom<Node>, nodes: (&Dom<Node>, Option<&Dom<Node>>)) { let (element, prev_element) = nodes; let tree_node = prev_element.map_or(element, |prev| { |