commit | 89e35fee17d9b8f9e85a1fc600ef97b9ee5638a3 | [log] [tgz] |
---|---|---|
author | Byungwoo Lee <blee@igalia.com> | Thu Jun 29 22:28:31 2023 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Jun 29 22:28:31 2023 |
tree | 86224831195eea0661e1006138a467fbe4fa9147 | |
parent | fc7c2f7c99524d6f5ed02f8bee99484b6f6e4382 [diff] |
Fix style invalidation bug of logical combinations inside :has(). A sibling change doesn't trigger style invalidation properly when a :has() contains a logical combination containing a sibling relationship: <style> .subject { color: green } .subject:has(:is(.sibling + .child)) { color: red } </style> <div id="subject" class="subject"> <div id="sibling" class="sibling"></div> <div class="child">Must be green</div> </div> <script> document.body.offsetLeft; sibling.classList.remove("sibling"); document.body.offsetLeft; // The text must be green but red </script> CheckPseudoHasArgumentContext extracts sibling relationship information from adjacent combinators inside ':has()' and provides the information to SelectorChecker so that SelectorChecker marks following flags: - AncestorsOrAncestorSiblingsAffectedByHas - SiblingsAffectedByHas But the extraction logic haven't considered the adjacent combinators or sibling relationships in the sub-selector of a logical combination inside ':has()'. (e.g. :has(:is(.a + .b)), :has(:not(:nth-child(2)))) This CL fixes the bug by extracting sibling relationship information from a sub-selector of :is(), :where() or :not() inside :has(). Bug: 1448531 Change-Id: Ifd5b0db33d357c530a5b8e467f2a7838e86f9528 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4576376 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Byungwoo Lee <blee@igalia.com> Cr-Commit-Position: refs/heads/main@{#1164385}
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.