66
77use crate :: context:: { ElementCascadeInputs , SharedStyleContext , StyleContext } ;
88use crate :: data:: { ElementData , ElementStyles , RestyleKind } ;
9- use crate :: dom:: { NodeInfo , OpaqueNode , TElement , TNode } ;
9+ use crate :: dom:: { OpaqueNode , TElement , TNode } ;
1010use crate :: invalidation:: element:: restyle_hints:: RestyleHint ;
1111use crate :: matching:: MatchMethods ;
1212use crate :: selector_parser:: PseudoElement ;
@@ -179,14 +179,6 @@ pub trait DomTraversal<E: TElement>: Sync {
179179 PreTraverseToken ( if should_traverse { Some ( root) } else { None } )
180180 }
181181
182- /// Returns true if traversal should visit a text node. The style system
183- /// never processes text nodes, but Servo overrides this to visit them for
184- /// flow construction when necessary.
185- fn text_node_needs_traversal ( node : E :: ConcreteNode , _parent_data : & ElementData ) -> bool {
186- debug_assert ! ( node. is_text_node( ) ) ;
187- false
188- }
189-
190182 /// Returns true if traversal is needed for the given element and subtree.
191183 fn element_needs_traversal (
192184 el : E ,
@@ -472,7 +464,6 @@ pub fn recalc_style_at<E, D, F>(
472464 note_children :: < E , D , F > (
473465 context,
474466 element,
475- data,
476467 propagated_hint,
477468 is_initial_style,
478469 note_child,
@@ -687,7 +678,6 @@ where
687678fn note_children < E , D , F > (
688679 context : & mut StyleContext < E > ,
689680 element : E ,
690- data : & ElementData ,
691681 propagated_hint : RestyleHint ,
692682 is_initial_style : bool ,
693683 mut note_child : F ,
@@ -701,14 +691,8 @@ fn note_children<E, D, F>(
701691
702692 // Loop over all the traversal children.
703693 for child_node in element. traversal_children ( ) {
704- let child = match child_node. as_element ( ) {
705- Some ( el) => el,
706- None => {
707- if D :: text_node_needs_traversal ( child_node, data) {
708- note_child ( child_node) ;
709- }
710- continue ;
711- } ,
694+ let Some ( child) = child_node. as_element ( ) else {
695+ continue ;
712696 } ;
713697
714698 let mut child_data = child. mutate_data ( ) ;
0 commit comments