Skip to content

Support CSS attribute selectors in src/client/cssom (e.g. link[rel="modulepreload"]): parsing & matching #270

@yorkie

Description

@yorkie

Feature Request

Implement support for CSS attribute selectors in the CSSOM engine, specifically for selectors such as link[rel="modulepreload"], including both parsing and matching logic.

Requirements

  • Extend the CSSOM parser to recognize and correctly handle attribute selectors (e.g. [attr=value], [attr], [attr^=val], etc.)
  • Ensure the matching engine can test DOM elements against attribute selectors as per the CSS spec
  • Demonstrate with examples such as link[rel="modulepreload"] in both parser and matcher tests
  • Update/fix affected unit tests and add new coverage for edge cases

Related Areas

  • src/client/cssom (core implementation)
  • Associated test cases and documentation

Acceptance Criteria

  • CSS attribute selector parsing and matching is correctly implemented according to the CSS standard
  • Example selectors like link[rel="modulepreload"] match elements as expected
  • All relevant unit tests pass and new tests cover edge cases
  • Documentation updated (if needed)

This task will improve standard compliance for DOM/CSS integration and enable use cases such as modulepreload and other advanced resource hints.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions