mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb/CSS: Refactor contains_single_none_ident()
to actually parse it
The new method is Parser::parse_all_as_single_none_value(), which has a few advantages: 1. There's no need for user code to manually create a StyleValue. 2. It consumes tokens so that doesn't have to be done manually. 3. Whitespace before or after the `none` is consumed correctly. It does mean we create and then discard a `none` StyleValue in a couple of places, namely parsing for `grid-*` properties. We may or may not want to migrate those to returning the IdentifierStyleValue instead.
This commit is contained in:
parent
6f2f91d1f5
commit
ca10fb4129
Notes:
github-actions[bot]
2024-07-26 10:05:50 +00:00
Author: https://github.com/AtkinsSJ
Commit: ca10fb4129
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/720
Reviewed-by: https://github.com/tcl3
2 changed files with 30 additions and 35 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2024, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -303,6 +303,7 @@ private:
|
|||
template<typename ParseFunction>
|
||||
RefPtr<StyleValue> parse_comma_separated_value_list(TokenStream<ComponentValue>&, ParseFunction);
|
||||
RefPtr<StyleValue> parse_simple_comma_separated_value_list(PropertyID, TokenStream<ComponentValue>&);
|
||||
RefPtr<StyleValue> parse_all_as_single_none_value(TokenStream<ComponentValue>&);
|
||||
|
||||
RefPtr<StyleValue> parse_aspect_ratio_value(TokenStream<ComponentValue>&);
|
||||
RefPtr<StyleValue> parse_background_value(TokenStream<ComponentValue>&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue