| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Bug: 406566432Is there a `<select>`-related bug number I should add here?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Bug: 406566432Is there a `<select>`-related bug number I should add here?
nah i think its fine to just use the menu elements tracking bug
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Fix traversal errors in ElementListIterator::Retreat.
This fixes multiple traversal errors in ElementListIterator::Retreat,
which is used when iterating backwards:
* Prior to this change, multiple places in the function used
ElementTraversal::Previous. This was incorrect because (given that we
are doing the reverse of depth-first pre-order traversal)
ElementTraversal::Previous can take multiple steps from parent to
child in a single call, since when it moves to a previous sibling it
wants to start with the last child's last child's last child (all the
way down). In this code this is incorrect because each step needs to
call owner_.ShouldIgnoreDescendantsForElementTraversals. This is
tested by the added tests OptionListTest.RetreatExcluded and
OptionListTest.RetreatExcludedAtEnd.
* Additionally, the use of ElementTraversal::PreviousAbsoluteSibling was
incorrect, because, in the case where it needs to traverse from child
to parent, it goes to the parent's next sibling *without* entering
that sibling's descendants. This is tested by the added test
OptionListTest.RetreatNesting2.
* The condition for when to call PreviousAbsoluteSibling was also
incorrect since it was checking whether to traverse descendants of the
element that (when going backwards) has already had its descendants
traversed, not the one(s) that we should be considering. This is
tested by the added test OptionListTest.RetreatNesting3.
The first of these bugs is tested extensively by the work-in-progress
change to update the structure of menu elements to use DOM nesting. The
second and third were found only by code inspection while rewriting the
code to fix the first.
This also updates the DCHECK_EQ() to fire much closer to the bug occurs:
we check the ownership when we set current_ rather than when we traverse
away from it, and we check it in both directions rather than only when
iterating backwards.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |