Make the SelectorFilter stack a bit more consistent. Require that we never get into a situation with inconsistent SelectorFilter parent stacks during traversal; we now explicitly DCHECK for that instead of just pausing traversal. This also means we need to be slightly more lenient; whereas we'd previously accept only the flat-tree parent, we'll now also accept the slightly more efficient (and still correct) ParentOrShadowHost(). (The flat-tree parent is used because that's the traversal order, but it will have a few false positives in the Bloom filter.) Unfortunately, we can still _start_ the ElementRuleCollector in an inconsistent state; for instance, when calculating style for pseudo-elements, when calculating style for SVG elements, or (I think) in some shadow-root cases. Thus, we still need to maintain the parent stack for the sole purpose of testing can_use_fast_reject_ at the start of the traversal. We fix a few cases related to invalidation and shadow DOM, making invalidating those elements marginally faster. Change-Id: I6200b734de4d7b52a9bb15682959d59815926f96 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4853747 Commit-Queue: Steinar H Gunderson <sesse@chromium.org> Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1220183}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.