mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-22 19:12:53 +00:00
LibWeb/CSS: Qualify uses of LibURL
To prepare for introducing a CSS::URL type, we need to qualify any use of LibURL as `::URL::foo` instead of `URL::foo` so the compiler doesn't get confused. Many of these uses will be replaced, but I don't want to mix this in with what will likely already be a large change.
This commit is contained in:
parent
da1ff1ba40
commit
c82f4b46a2
Notes:
github-actions[bot]
2025-04-09 17:48:07 +00:00
Author: https://github.com/AtkinsSJ
Commit: c82f4b46a2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4285
Reviewed-by: https://github.com/tcl3 ✅
24 changed files with 77 additions and 76 deletions
|
@ -24,7 +24,7 @@ namespace Web::CSS {
|
|||
|
||||
GC_DEFINE_ALLOCATOR(CSSStyleSheet);
|
||||
|
||||
GC::Ref<CSSStyleSheet> CSSStyleSheet::create(JS::Realm& realm, CSSRuleList& rules, MediaList& media, Optional<URL::URL> location)
|
||||
GC::Ref<CSSStyleSheet> CSSStyleSheet::create(JS::Realm& realm, CSSRuleList& rules, MediaList& media, Optional<::URL::URL> location)
|
||||
{
|
||||
return realm.create<CSSStyleSheet>(realm, rules, media, move(location));
|
||||
}
|
||||
|
@ -41,12 +41,12 @@ WebIDL::ExceptionOr<GC::Ref<CSSStyleSheet>> CSSStyleSheet::construct_impl(JS::Re
|
|||
|
||||
// 3. Set sheet’s stylesheet base URL to the baseURL attribute value from options.
|
||||
if (options.has_value() && options->base_url.has_value()) {
|
||||
Optional<URL::URL> sheet_location_url;
|
||||
Optional<::URL::URL> sheet_location_url;
|
||||
if (sheet->location().has_value())
|
||||
sheet_location_url = sheet->location().release_value();
|
||||
|
||||
// AD-HOC: This isn't explicitly mentioned in the specification, but multiple modern browsers do this.
|
||||
Optional<URL::URL> url = sheet->location().has_value() ? sheet_location_url->complete_url(options->base_url.value()) : URL::Parser::basic_parse(options->base_url.value());
|
||||
Optional<::URL::URL> url = sheet->location().has_value() ? sheet_location_url->complete_url(options->base_url.value()) : ::URL::Parser::basic_parse(options->base_url.value());
|
||||
if (!url.has_value())
|
||||
return WebIDL::NotAllowedError::create(realm, "Constructed style sheets must have a valid base URL"_string);
|
||||
|
||||
|
@ -95,7 +95,7 @@ WebIDL::ExceptionOr<GC::Ref<CSSStyleSheet>> CSSStyleSheet::construct_impl(JS::Re
|
|||
return sheet;
|
||||
}
|
||||
|
||||
CSSStyleSheet::CSSStyleSheet(JS::Realm& realm, CSSRuleList& rules, MediaList& media, Optional<URL::URL> location)
|
||||
CSSStyleSheet::CSSStyleSheet(JS::Realm& realm, CSSRuleList& rules, MediaList& media, Optional<::URL::URL> location)
|
||||
: StyleSheet(realm, media)
|
||||
, m_rules(&rules)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue