[pseudo&] Implement DynamicPseudoExtractor [chromium/src : main]

0 views
Skip to first unread message

Anders Hartvoll Ruud (Gerrit)

unread,
Sep 16, 2025, 1:33:09 PMSep 16
to Daniil Sakhapov, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Daniil Sakhapov

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib1f4441e97fe91b7c4e8958a5d3778226f53003b
Gerrit-Change-Number: 6949167
Gerrit-PatchSet: 2
Gerrit-Owner: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Sep 2025 17:32:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniil Sakhapov (Gerrit)

unread,
Sep 17, 2025, 4:50:55 AM (14 days ago) Sep 17
to Anders Hartvoll Ruud, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Anders Hartvoll Ruud

Daniil Sakhapov added 2 comments

File third_party/blink/renderer/core/css/dynamic_pseudo_extractor.h
Line 20, Patchset 2 (Latest):// .foo::before {}
// .baz::after {}
Daniil Sakhapov . unresolved

Could you just add an example with nested pseudo element as well, please?

File third_party/blink/renderer/core/css/dynamic_pseudo_extractor.cc
Line 40, Patchset 2 (Latest): // The originating compound didn't match; reset the flags and keep
// on going in case this is nested pseudo-element.
Daniil Sakhapov . unresolved

Suggestion:
```
// The originating compound didn't match; reset the flags and keep
// on going in case this is nested pseudo-element, e.g., when
// matching 'div::before::marker' against a <div>, the check for
// '::marker' fails because its originating part ('div::before')
// does not match the <div>. We reset flags and continue, eventually
// checking '::before', which will succeed.
```

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib1f4441e97fe91b7c4e8958a5d3778226f53003b
    Gerrit-Change-Number: 6949167
    Gerrit-PatchSet: 2
    Gerrit-Owner: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Comment-Date: Wed, 17 Sep 2025 08:50:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniil Sakhapov (Gerrit)

    unread,
    Sep 17, 2025, 4:51:01 AM (14 days ago) Sep 17
    to Anders Hartvoll Ruud, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
    Attention needed from Anders Hartvoll Ruud

    Daniil Sakhapov voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Anders Hartvoll Ruud
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib1f4441e97fe91b7c4e8958a5d3778226f53003b
      Gerrit-Change-Number: 6949167
      Gerrit-PatchSet: 2
      Gerrit-Owner: Anders Hartvoll Ruud <and...@chromium.org>
      Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
      Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 08:50:50 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Anders Hartvoll Ruud (Gerrit)

      unread,
      Sep 17, 2025, 7:33:48 AM (14 days ago) Sep 17
      to Daniil Sakhapov, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

      Anders Hartvoll Ruud voted and added 2 comments

      Votes added by Anders Hartvoll Ruud

      Commit-Queue+2

      2 comments

      File third_party/blink/renderer/core/css/dynamic_pseudo_extractor.h
      Line 20, Patchset 2:// .foo::before {}
      // .baz::after {}
      Daniil Sakhapov . resolved

      Could you just add an example with nested pseudo element as well, please?

      Anders Hartvoll Ruud

      Done

      File third_party/blink/renderer/core/css/dynamic_pseudo_extractor.cc
      Line 40, Patchset 2: // The originating compound didn't match; reset the flags and keep

      // on going in case this is nested pseudo-element.
      Daniil Sakhapov . resolved

      Suggestion:
      ```
      // The originating compound didn't match; reset the flags and keep
      // on going in case this is nested pseudo-element, e.g., when
      // matching 'div::before::marker' against a <div>, the check for
      // '::marker' fails because its originating part ('div::before')
      // does not match the <div>. We reset flags and continue, eventually
      // checking '::before', which will succeed.
      ```

      Anders Hartvoll Ruud

      Yeah, that's better. Done.

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib1f4441e97fe91b7c4e8958a5d3778226f53003b
      Gerrit-Change-Number: 6949167
      Gerrit-PatchSet: 3
      Gerrit-Owner: Anders Hartvoll Ruud <and...@chromium.org>
      Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
      Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 11:33:34 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Daniil Sakhapov <sakh...@chromium.org>
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Sep 17, 2025, 8:24:00 AM (14 days ago) Sep 17
      to Anders Hartvoll Ruud, Daniil Sakhapov, Alexis Menard, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

      2 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: third_party/blink/renderer/core/css/dynamic_pseudo_extractor.h
      Insertions: 6, Deletions: 2.

      The diff is too large to show. Please review the diff.
      ```
      ```
      The name of the file: third_party/blink/renderer/core/css/dynamic_pseudo_extractor.cc
      Insertions: 6, Deletions: 1.

      The diff is too large to show. Please review the diff.
      ```

      Change information

      Commit message:
      [pseudo&] Implement DynamicPseudoExtractor

      With selector evaluation order changed to start with the pseudo-element
      compounds (CL:6940215), our old approach for creating dynamic
      pseudo flags no longer works; it's completely dependent on evaluating
      the originating element compound of the selector first, and then
      "descending" into the pseudo element parts.

      The new plan is as follows:

      1. Mark selectors that can possibly trigger dynamic pseudo flags
      as "pseudo-tainted" during parse-time. (Not done in this CL.)
      2. In ElementRuleCollector, a pseudo-tainted rule is considered twice:
      a) By the SelectorMatcher (as normal).
      b) By the DynamicPseudoExtractor, to look for dynamic pseudo flags.

      This CL implements the DynamicPseudoExtractor itself (needed for 2b),
      but does not actually integrate it with ElementRuleCollector; it is only
      by unit tests for now.
      Bug: 444386484
      Change-Id: Ib1f4441e97fe91b7c4e8958a5d3778226f53003b
      Reviewed-by: Daniil Sakhapov <sakh...@chromium.org>
      Commit-Queue: Anders Hartvoll Ruud <and...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1516573}
      Files:
      • M third_party/blink/renderer/core/css/build.gni
      • M third_party/blink/renderer/core/css/css_test_helpers.cc
      • M third_party/blink/renderer/core/css/css_test_helpers.h
      • A third_party/blink/renderer/core/css/dynamic_pseudo_extractor.cc
      • A third_party/blink/renderer/core/css/dynamic_pseudo_extractor.h
      • A third_party/blink/renderer/core/css/dynamic_pseudo_extractor_test.cc
      • M third_party/blink/renderer/core/style/computed_style_constants.h
      Change size: L
      Delta: 7 files changed, 572 insertions(+), 0 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Daniil Sakhapov
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib1f4441e97fe91b7c4e8958a5d3778226f53003b
      Gerrit-Change-Number: 6949167
      Gerrit-PatchSet: 4
      Gerrit-Owner: Anders Hartvoll Ruud <and...@chromium.org>
      Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages