style: Distinguish between the tree structures used for traversal and selector matching.

This patch renames TNode::parent_element to traversal_parent, since it returns
the parent from the perspective of traversal (which in Gecko uses the
flattened tree).  It also renames TNode::children to traversal_children
for the saem reason.

We keep parent_element and children functions on TNode to use for selector
matching, which must be done on the real DOM tree structure.
This commit is contained in:
Cameron McCormack 2017-06-09 12:05:39 +08:00
parent c465dd0375
commit c533097e20
11 changed files with 102 additions and 67 deletions

View file

@ -166,7 +166,7 @@ impl StylesheetInvalidationSet {
let mut any_children_invalid = false;
for child in element.as_node().children() {
for child in element.as_node().traversal_children() {
let child = match child.as_element() {
Some(e) => e,
None => continue,