mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 14:02:00 +00:00
LibWeb: Generate pseudo-element code from JSON
Initially, this generates the enum and to/from-string functions. The JSON itself contains more data than that, but it's unused for now.
This commit is contained in:
parent
0ed2e71801
commit
ffa1dba96a
Notes:
github-actions[bot]
2025-03-24 09:51:30 +00:00
Author: https://github.com/AtkinsSJ
Commit: ffa1dba96a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4021
14 changed files with 244 additions and 106 deletions
|
@ -28,7 +28,7 @@ WebIDL::ExceptionOr<Optional<CSS::Selector::PseudoElementSelector>> pseudo_eleme
|
|||
// 3. If value is one of the legacy Selectors Level 2 single-colon selectors (':before', ':after', ':first-letter', or ':first-line'),
|
||||
// then return the equivalent two-colon selector (e.g. '::before').
|
||||
if (value.has_value() && value->is_one_of(":before", ":after", ":first-letter", ":first-line")) {
|
||||
return CSS::Selector::PseudoElementSelector::from_string(MUST(value->substring_from_byte_offset(1)));
|
||||
return CSS::pseudo_element_from_string(MUST(value->substring_from_byte_offset(1)));
|
||||
}
|
||||
|
||||
// 4. Otherwise, return value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue