mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb/CSS: Return GC::Ref from style sheet parsing methods
These actually always return a value, despite the `CSSStyleSheet*` return type. So, make that clearer by returning `GC::Ref<CSSStyleSheet>` instead. This also means we can remove some ad-hoc error-checking code.
This commit is contained in:
parent
2a96a81e68
commit
9284530a9f
Notes:
github-actions[bot]
2025-04-15 08:41:33 +00:00
Author: https://github.com/AtkinsSJ
Commit: 9284530a9f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4352
7 changed files with 12 additions and 19 deletions
|
@ -207,7 +207,7 @@ GC::Ref<WebIDL::Promise> CSSStyleSheet::replace(String text)
|
|||
HTML::TemporaryExecutionContext execution_context { realm, HTML::TemporaryExecutionContext::CallbacksEnabled::Yes };
|
||||
|
||||
// 1. Let rules be the result of running parse a stylesheet’s contents from text.
|
||||
auto* parsed_stylesheet = parse_css_stylesheet(make_parsing_params(), text);
|
||||
auto parsed_stylesheet = parse_css_stylesheet(make_parsing_params(), text);
|
||||
auto& rules = parsed_stylesheet->rules();
|
||||
|
||||
// 2. If rules contains one or more @import rules, remove those rules from rules.
|
||||
|
@ -240,7 +240,7 @@ WebIDL::ExceptionOr<void> CSSStyleSheet::replace_sync(StringView text)
|
|||
return WebIDL::NotAllowedError::create(realm(), "Can't call replaceSync() on non-modifiable stylesheets"_string);
|
||||
|
||||
// 2. Let rules be the result of running parse a stylesheet’s contents from text.
|
||||
auto* parsed_stylesheet = parse_css_stylesheet(make_parsing_params(), text);
|
||||
auto parsed_stylesheet = parse_css_stylesheet(make_parsing_params(), text);
|
||||
auto& rules = parsed_stylesheet->rules();
|
||||
|
||||
// 3. If rules contains one or more @import rules, remove those rules from rules.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue