Skip to content

Conversation

@dmsnell
Copy link
Owner

@dmsnell dmsnell commented Jan 16, 2026

Trac ticket:


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

sirreal and others added 24 commits December 13, 2024 20:08
This is a more appropriate name for the type of match.

> `[att|=val]` Represents an element with the att attribute, its value
> either being exactly "val" or beginning with "val" immediately
> followed by "-" (U+002D). This is primarily intended to allow language
> subcode matches (e.g., the hreflang attribute on the a element in
> HTML) as described in BCP 47 ([BCP47]) or its successor.
Matches the calling interface for the other HTML API classes, avoids
creating the `Generator`, using a static var to avoid re-parsing the
selector string instead.
@github-actions
Copy link

github-actions bot commented Jan 16, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jonsurrell, dmsnell.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@dmsnell
Copy link
Owner Author

dmsnell commented Jan 16, 2026

@copilot perform senior-level architectural review over this PR. there is a lot involved so pay attention to a few important aspects:

  • start by reviewing the goals of this change so that you don’t include misleading, inaccurate, or irrelevant commentary.
  • this should properly parse CSS selectors. review the spec at https://www.w3.org/TR/css-syntax-3/ and look for any omissions or defects, no matter how small.
  • this runs in a hot-path of performance-critical code. think about ways that user-space PHP code can be written to take advantage of abstraction leaks from the CPU; consider cache-line use and reuse, speculative execution, out-of-order processing (OOP) and instruction-level-parallellism (ILP), and memory layout dynamics.

Task

  • Look for defects in the CSS selector parsing and note them.
  • Look for inefficiencies or opportunities for performance improvements.

Leave helpful comments with illustrative examples of how something is wrong or could be better. Cut out the cheekiness and don’t speak cordially. Be machine-like since you are a machine.

Before leaving any comment, compute a confidence score in your response. If your response is less than 90% confident then perform a check before answering to confirm some detail. For example, you can imagine the code you want to write, then run sample data through that code and see if it matches your assertion. If it’s less than 60% confident then keep your mouth shut.

Copy link

Copilot AI commented Jan 16, 2026

@dmsnell I've opened a new pull request, #26, to work on those changes. Once the pull request is ready, I'll request review from you.

@dmsnell dmsnell closed this Jan 17, 2026
@dmsnell dmsnell deleted the html-api/add-css-selector-parser branch January 17, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants