mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
LibWeb: Implement functional pseudo-element parsing
"Functional" as in "it's a function token" and not "it works", because the behaviour for these is unimplemented. :^) This is modeled after the pseudo-class parsing, but with some changes based on things I don't like about that implementation. I've implemented the `<pt-name-selector>` parameter used by view-transitions for now, but nothing else.
This commit is contained in:
parent
5cf04a33ad
commit
88e11eea2d
Notes:
github-actions[bot]
2025-03-25 07:56:12 +00:00
Author: https://github.com/AtkinsSJ
Commit: 88e11eea2d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4063
8 changed files with 237 additions and 43 deletions
|
@ -127,13 +127,15 @@ This generated `PsuedoElement.h` and `PseudoElement.cpp`.
|
|||
|
||||
Each entry has the following properties:
|
||||
|
||||
| Field | Required | Default | Description |
|
||||
|----------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `spec` | No | Nothing | Link to the spec definition, for reference. Not used in generated code. |
|
||||
| `alias-for` | No | Nothing | Use to specify that this should be treated as an alias for the named pseudo-element. |
|
||||
| `is-generated` | No | `false` | Whether this is a [generated pseudo-element.](https://drafts.csswg.org/css-pseudo-4/#generated-content) |
|
||||
| `is-allowed-in-has` | No | `false` | Whether this is a [`:has`-allowed pseudo-element.](https://drafts.csswg.org/selectors/#has-allowed-pseudo-element) |
|
||||
| `property-whitelist` | No | Nothing | Some pseudo-elements only permit certain properties. If so, name them in an array here. Some special values are allowed here for categories of properties - see below. |
|
||||
| Field | Required | Default | Description |
|
||||
|----------------------|----------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `alias-for` | No | Nothing | Use to specify that this should be treated as an alias for the named pseudo-element. |
|
||||
| `function-syntax` | No | Nothing | Syntax for the function arguments if this is a function-type pseudo-element. Copied directly from the spec. |
|
||||
| `is-generated` | No | `false` | Whether this is a [generated pseudo-element.](https://drafts.csswg.org/css-pseudo-4/#generated-content) |
|
||||
| `is-allowed-in-has` | No | `false` | Whether this is a [`:has`-allowed pseudo-element.](https://drafts.csswg.org/selectors/#has-allowed-pseudo-element) |
|
||||
| `property-whitelist` | No | Nothing | Some pseudo-elements only permit certain properties. If so, name them in an array here. Some special values are allowed here for categories of properties - see below. |
|
||||
| `spec` | No | Nothing | Link to the spec definition, for reference. Not used in generated code. |
|
||||
| `type` | No | `"identifier"` | What type of pseudo-element is this. Either "identifier", "function", or "both". |
|
||||
|
||||
The generated code provides:
|
||||
- A `PseudoElement` enum listing every pseudo-element name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue