LibWeb/CSS: Return StringStyleValue from parse_string_value()
Callers already relied on this being true, so let's make it contractual.
This commit is contained in:
parent
c22a2d8f2b
commit
2516297c86
Notes:
github-actions[bot]
2024-10-02 15:38:11 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/2516297c865 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1599
2 changed files with 5 additions and 5 deletions
|
@ -3352,7 +3352,7 @@ RefPtr<CSSStyleValue> Parser::parse_counter_value(TokenStream<ComponentValue>& t
|
|||
|
||||
TokenStream string_tokens { function_values[1] };
|
||||
string_tokens.skip_whitespace();
|
||||
RefPtr<CSSStyleValue> join_string = parse_string_value(string_tokens);
|
||||
auto join_string = parse_string_value(string_tokens);
|
||||
string_tokens.skip_whitespace();
|
||||
if (!join_string || string_tokens.has_next_token())
|
||||
return nullptr;
|
||||
|
@ -3369,7 +3369,7 @@ RefPtr<CSSStyleValue> Parser::parse_counter_value(TokenStream<ComponentValue>& t
|
|||
}
|
||||
|
||||
transaction.commit();
|
||||
return CounterStyleValue::create_counters(counter_name.release_value(), join_string->as_string().string_value(), counter_style.release_nonnull());
|
||||
return CounterStyleValue::create_counters(counter_name.release_value(), join_string->string_value(), counter_style.release_nonnull());
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
@ -3439,7 +3439,7 @@ RefPtr<CSSStyleValue> Parser::parse_ratio_value(TokenStream<ComponentValue>& tok
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<CSSStyleValue> Parser::parse_string_value(TokenStream<ComponentValue>& tokens)
|
||||
RefPtr<StringStyleValue> Parser::parse_string_value(TokenStream<ComponentValue>& tokens)
|
||||
{
|
||||
auto peek = tokens.peek_token();
|
||||
if (peek.is(Token::Type::String)) {
|
||||
|
@ -5471,7 +5471,7 @@ RefPtr<CSSStyleValue> Parser::parse_font_language_override_value(TokenStream<Com
|
|||
auto transaction = tokens.begin_transaction();
|
||||
tokens.skip_whitespace();
|
||||
if (auto string = parse_string_value(tokens)) {
|
||||
auto string_value = string->as_string().string_value();
|
||||
auto string_value = string->string_value();
|
||||
tokens.skip_whitespace();
|
||||
if (tokens.has_next_token()) {
|
||||
dbgln_if(CSS_PARSER_DEBUG, "CSSParser: Failed to parse font-language-override: unexpected trailing tokens");
|
||||
|
|
|
@ -256,7 +256,7 @@ private:
|
|||
RefPtr<CSSStyleValue> parse_counter_definitions_value(TokenStream<ComponentValue>&, AllowReversed, i32 default_value_if_not_reversed);
|
||||
RefPtr<CSSStyleValue> parse_rect_value(TokenStream<ComponentValue>&);
|
||||
RefPtr<CSSStyleValue> parse_ratio_value(TokenStream<ComponentValue>&);
|
||||
RefPtr<CSSStyleValue> parse_string_value(TokenStream<ComponentValue>&);
|
||||
RefPtr<StringStyleValue> parse_string_value(TokenStream<ComponentValue>&);
|
||||
RefPtr<CSSStyleValue> parse_image_value(TokenStream<ComponentValue>&);
|
||||
RefPtr<CSSStyleValue> parse_paint_value(TokenStream<ComponentValue>&);
|
||||
enum class PositionParsingMode {
|
||||
|
|
Loading…
Add table
Reference in a new issue