Everywhere: Use URL::about_XXX factory functions

This commit is contained in:
Shannon Booth 2025-02-15 23:51:45 +13:00 committed by Tim Ledbetter
commit 9072a7caef
Notes: github-actions[bot] 2025-02-15 17:06:59 +00:00
18 changed files with 28 additions and 28 deletions

View file

@ -422,7 +422,7 @@ GC::Ref<Document> Document::create(JS::Realm& realm, URL::URL const& url)
GC::Ref<Document> Document::create_for_fragment_parsing(JS::Realm& realm)
{
return realm.create<Document>(realm, "about:blank"sv, TemporaryDocumentForFragmentParsing::Yes);
return realm.create<Document>(realm, URL::about_blank(), TemporaryDocumentForFragmentParsing::Yes);
}
Document::Document(JS::Realm& realm, const URL::URL& url, TemporaryDocumentForFragmentParsing temporary_document_for_fragment_parsing)

View file

@ -103,7 +103,7 @@ public:
static WebIDL::ExceptionOr<GC::Ref<Document>> create_and_initialize(Type, String content_type, HTML::NavigationParams const&);
[[nodiscard]] static GC::Ref<Document> create(JS::Realm&, URL::URL const& url = "about:blank"sv);
[[nodiscard]] static GC::Ref<Document> create(JS::Realm&, URL::URL const& url = URL::about_blank());
[[nodiscard]] static GC::Ref<Document> create_for_fragment_parsing(JS::Realm&);
static WebIDL::ExceptionOr<GC::Ref<Document>> construct_impl(JS::Realm&);
virtual ~Document() override;

View file

@ -33,7 +33,7 @@ GC::Ref<DOM::Document> create_document_for_inline_content(GC::Ptr<HTML::Navigabl
// origin: origin
// opener policy: coop
HTML::OpenerPolicyEnforcementResult coop_enforcement_result {
.url = URL::URL("about:error"), // AD-HOC
.url = URL::about_error(), // AD-HOC
.origin = origin,
.opener_policy = coop
};
@ -55,7 +55,7 @@ GC::Ref<DOM::Document> create_document_for_inline_content(GC::Ptr<HTML::Navigabl
// about base URL: null
// user involvement: userInvolvement
auto response = Fetch::Infrastructure::Response::create(vm);
response->url_list().append(URL::URL("about:error")); // AD-HOC: https://github.com/whatwg/html/issues/9122
response->url_list().append(URL::about_error()); // AD-HOC: https://github.com/whatwg/html/issues/9122
auto navigation_params = vm.heap().allocate<HTML::NavigationParams>();
navigation_params->id = navigation_id;
navigation_params->navigable = navigable;

View file

@ -15,7 +15,7 @@ class XMLDocument final : public Document {
GC_DECLARE_ALLOCATOR(XMLDocument);
public:
static GC::Ref<XMLDocument> create(JS::Realm&, URL::URL const& url = "about:blank"sv);
static GC::Ref<XMLDocument> create(JS::Realm&, URL::URL const& url = URL::about_blank());
virtual ~XMLDocument() override = default;
private: