mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 07:09:41 +00:00
LibWeb: Add CSS::Parser::parse_dashed_ident()
This commit is contained in:
parent
ae3bda993a
commit
02598040ad
Notes:
github-actions[bot]
2025-07-30 17:15:16 +00:00
Author: https://github.com/gmta
Commit: 02598040ad
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5655
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 14 additions and 0 deletions
|
@ -3307,6 +3307,19 @@ RefPtr<CustomIdentStyleValue const> Parser::parse_custom_ident_value(TokenStream
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-values-4/#typedef-dashed-ident
|
||||
Optional<FlyString> Parser::parse_dashed_ident(TokenStream<ComponentValue>& tokens)
|
||||
{
|
||||
// The <dashed-ident> production is a <custom-ident>, with all the case-sensitivity that implies, with the
|
||||
// additional restriction that it must start with two dashes (U+002D HYPHEN-MINUS).
|
||||
auto transaction = tokens.begin_transaction();
|
||||
auto custom_ident = parse_custom_ident(tokens, {});
|
||||
if (!custom_ident.has_value() || !custom_ident->starts_with_bytes("--"sv))
|
||||
return {};
|
||||
transaction.commit();
|
||||
return custom_ident;
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/css-grid-2/#typedef-track-breadth
|
||||
Optional<GridSize> Parser::parse_grid_track_breadth(TokenStream<ComponentValue>& tokens)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue