mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Refactor children handling.
Moving traversal_children away from TNode I can make TNode trivial enough, in order to share a QuerySelector implementation between Servo and Gecko.
This commit is contained in:
parent
7c2265360f
commit
a11d268468
9 changed files with 149 additions and 158 deletions
|
@ -841,7 +841,7 @@ where
|
|||
let is_initial_style = context.thread_local.is_initial_style();
|
||||
|
||||
// Loop over all the traversal children.
|
||||
for child_node in element.as_node().traversal_children() {
|
||||
for child_node in element.traversal_children() {
|
||||
let child = match child_node.as_element() {
|
||||
Some(el) => el,
|
||||
None => {
|
||||
|
@ -933,7 +933,7 @@ where
|
|||
let mut parents = SmallVec::<[E; 32]>::new();
|
||||
parents.push(root);
|
||||
while let Some(p) = parents.pop() {
|
||||
for kid in p.as_node().traversal_children() {
|
||||
for kid in p.traversal_children() {
|
||||
if let Some(kid) = kid.as_element() {
|
||||
// We maintain an invariant that, if an element has data, all its
|
||||
// ancestors have data as well.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue