Include child rules when adding rules to RuleSetDiff When some style rule changes (e.g. its selector text), any inner style rules may also effectively change due to the &/:scope selector. We already accounted for this during RuleSet::AddFilteredRulesFrom- OtherBucket by traversing the chain of parent rules to see if any were marked for inclusion. However, we did this by searching for the '&' selector specifically, which means :scope cases did not invalidate properly. Unlike '&', :scope does not capture its parent style rule during parsing, and a StyleRule has no general way of reaching its parent (we don't store that pointer). Therefore, this CL traverses the child rules top-down instead, during RuleSetDiff::AddDiff. The end result should be the same, except that we now also include child rules of @scope rules. Note: There is little point in checking if inner style rules actually contain &/:scope in their selector or not; if omitted by the author, we insert them implicitly. Bug: 449542602 Change-Id: I9a42e61ede422f41e83200064f74bff6c164047a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7013292 Reviewed-by: Steinar H Gunderson <sesse@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1526740}
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.