File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Libraries/LibWeb/CSS/Parser Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,7 @@ class Parser {
354
354
RefPtr<CSSStyleValue const > parse_calculated_value (ComponentValue const &);
355
355
Optional<FlyString> parse_custom_ident (TokenStream<ComponentValue>&, ReadonlySpan<StringView> blacklist);
356
356
RefPtr<CustomIdentStyleValue const > parse_custom_ident_value (TokenStream<ComponentValue>&, ReadonlySpan<StringView> blacklist);
357
+ Optional<FlyString> parse_dashed_ident (TokenStream<ComponentValue>&);
357
358
// NOTE: Implemented in generated code. (GenerateCSSMathFunctions.cpp)
358
359
RefPtr<CalculationNode const > parse_math_function (Function const &, CalculationContext const &);
359
360
RefPtr<CalculationNode const > parse_a_calc_function_node (Function const &, CalculationContext const &);
Original file line number Diff line number Diff line change @@ -3307,6 +3307,19 @@ RefPtr<CustomIdentStyleValue const> Parser::parse_custom_ident_value(TokenStream
3307
3307
return nullptr ;
3308
3308
}
3309
3309
3310
+ // https://drafts.csswg.org/css-values-4/#typedef-dashed-ident
3311
+ Optional<FlyString> Parser::parse_dashed_ident (TokenStream<ComponentValue>& tokens)
3312
+ {
3313
+ // The <dashed-ident> production is a <custom-ident>, with all the case-sensitivity that implies, with the
3314
+ // additional restriction that it must start with two dashes (U+002D HYPHEN-MINUS).
3315
+ auto transaction = tokens.begin_transaction ();
3316
+ auto custom_ident = parse_custom_ident (tokens, {});
3317
+ if (!custom_ident.has_value () || !custom_ident->starts_with_bytes (" --" sv))
3318
+ return {};
3319
+ transaction.commit ();
3320
+ return custom_ident;
3321
+ }
3322
+
3310
3323
// https://www.w3.org/TR/css-grid-2/#typedef-track-breadth
3311
3324
Optional<GridSize> Parser::parse_grid_track_breadth (TokenStream<ComponentValue>& tokens)
3312
3325
{
You can’t perform that action at this time.
0 commit comments