mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
LibWeb/CSS: Make CSS Parser::create() infallible
Now that `Tokenizer::tokenize()` just returns a String, there are no errors to propagate, and we can simplify the user code a bit.
This commit is contained in:
parent
89c5f25016
commit
59778d2b36
Notes:
github-actions[bot]
2024-07-26 15:30:15 +00:00
Author: https://github.com/AtkinsSJ
Commit: 59778d2b36
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/846
8 changed files with 33 additions and 64 deletions
|
@ -540,11 +540,9 @@ static WebIDL::ExceptionOr<Vector<BaseKeyframe>> process_a_keyframes_argument(JS
|
|||
if (!property_id.has_value())
|
||||
continue;
|
||||
|
||||
auto maybe_parser = CSS::Parser::Parser::create(CSS::Parser::ParsingContext(realm), value_string);
|
||||
if (maybe_parser.is_error())
|
||||
continue;
|
||||
auto parser = CSS::Parser::Parser::create(CSS::Parser::ParsingContext(realm), value_string);
|
||||
|
||||
if (auto style_value = maybe_parser.release_value().parse_as_css_value(*property_id)) {
|
||||
if (auto style_value = parser.parse_as_css_value(*property_id)) {
|
||||
// Handle 'initial' here so we don't have to get the default value of the property every frame in StyleComputer
|
||||
if (style_value->is_initial())
|
||||
style_value = CSS::property_initial_value(realm, *property_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue