Skip to content

Commit bd87f5f

Browse files
committed
Make default implementation for same_home_subtree and associate_with_form
1 parent e6110ef commit bd87f5f

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

examples/noop-tree-builder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ impl TreeSink for Sink {
9393
fn add_attrs_if_missing(&mut self, target: usize, _attrs: Vec<Attribute>) {
9494
assert!(self.names.contains_key(&target), "not an element");
9595
}
96-
fn associate_with_form(&mut self, _target: usize, _form: usize) { }
9796
fn remove_from_parent(&mut self, _target: usize) { }
9897
fn reparent_children(&mut self, _node: usize, _new_parent: usize) { }
9998
fn mark_script_already_started(&mut self, _node: usize) { }

examples/print-tree-actions.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ impl TreeSink for Sink {
6565
x == y
6666
}
6767

68-
fn same_home_subtree(&self, _x: usize, _y: usize) -> bool {
69-
true
70-
}
71-
7268
fn elem_name(&self, target: usize) -> QualName {
7369
self.names.get(&target).expect("not an element").clone()
7470
}

src/rcdom.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,6 @@ impl TreeSink for RcDom {
223223
new_node(Comment(text))
224224
}
225225

226-
fn same_home_subtree(&self, _x: Handle, _y: Handle) -> bool {
227-
true
228-
}
229-
230-
fn associate_with_form(&mut self, _target: Handle, _form: Handle) {}
231-
232226
fn has_parent_node(&self, node: Handle) -> bool {
233227
let node = node.borrow();
234228
node.parent.is_some()

src/tree_builder/interface.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ pub trait TreeSink {
7474

7575
/// Are two handles present in the same tree
7676
/// https://html.spec.whatwg.org/multipage/infrastructure.html#home-subtree
77-
fn same_home_subtree(&self, x: Self::Handle, y: Self::Handle) -> bool;
77+
fn same_home_subtree(&self, x: Self::Handle, y: Self::Handle) -> bool {
78+
true
79+
}
7880

7981
/// What is the name of this element?
8082
///
@@ -132,7 +134,7 @@ pub trait TreeSink {
132134
fn add_attrs_if_missing(&mut self, target: Self::Handle, attrs: Vec<Attribute>);
133135

134136
/// Associate the given form-associatable element with the form element
135-
fn associate_with_form(&mut self, target: Self::Handle, form: Self::Handle);
137+
fn associate_with_form(&mut self, target: Self::Handle, form: Self::Handle) {}
136138

137139
/// Detach the given node from its parent.
138140
fn remove_from_parent(&mut self, target: Self::Handle);

0 commit comments

Comments
 (0)