mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb/CSS: Support legacy selector aliases for pseudo-classes
These are replaced with the pseudo-class they are an alias of, during parsing.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
36a9b653ae
commit
2b2e5a1db3
Notes:
github-actions[bot]
2025-12-18 13:52:04 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/2b2e5a1db31 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7177 Reviewed-by: https://github.com/gmta ✅
@@ -199,9 +199,12 @@ The generated code provides these for each enum, using "foo" as an example:
|
||||
This is a single JSON object, with selector pseudo-class names as keys and the values being objects with fields for the pseudo-class.
|
||||
This generates `PseudoClass.h` and `PseudoClass.cpp`.
|
||||
|
||||
Each entry has a single required property, `argument`, which is a string containing the grammar for the pseudo-class's
|
||||
function parameters - for identifier-style pseudo-classes it is left blank.
|
||||
The grammar is taken directly from the spec.
|
||||
Each entry has the following properties:
|
||||
|
||||
| Field | Required | Default | Description |
|
||||
|----------------------|----------------------------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `argument` | Unless `legacy-alias-for` is specified | Nothing | A string containing the grammar for the pseudo-class's function parameters - for identifier-style pseudo-classes it is left blank. The grammar is taken directly from the spec. |
|
||||
| `legacy-alias-for` | No | Nothing | Use to specify that this should be treated as a [legacy selector alias](https://drafts.csswg.org/selectors/#legacy-selector-alias) for the named pseudo-class. |
|
||||
|
||||
The generated code provides:
|
||||
- A `PseudoClass` enum listing every pseudo-class name
|
||||
|
||||
Reference in New Issue
Block a user