1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

Everywhere: Use unqualified AK::URL

Now possible in LibWeb now that there is no longer a Web::URL.
This commit is contained in:
Shannon Booth 2024-02-11 20:15:39 +13:00 committed by Andreas Kling
parent f9e5b43b7a
commit 9ce8189f21
156 changed files with 471 additions and 471 deletions

View file

@ -312,8 +312,8 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> Document::create_and_initialize(
auto const& referrer = navigation_params.request->referrer();
// 3. If referrer is a URL record, then set document's referrer to the serialization of referrer.
if (referrer.has<AK::URL>()) {
document->m_referrer = MUST(String::from_byte_string(referrer.get<AK::URL>().serialize()));
if (referrer.has<URL>()) {
document->m_referrer = MUST(String::from_byte_string(referrer.get<URL>().serialize()));
}
}
@ -337,12 +337,12 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> Document::construct_impl(JS::Rea
return Document::create(realm);
}
JS::NonnullGCPtr<Document> Document::create(JS::Realm& realm, AK::URL const& url)
JS::NonnullGCPtr<Document> Document::create(JS::Realm& realm, URL const& url)
{
return realm.heap().allocate<Document>(realm, realm, url);
}
Document::Document(JS::Realm& realm, const AK::URL& url)
Document::Document(JS::Realm& realm, const URL& url)
: ParentNode(realm, *this, NodeType::DOCUMENT_NODE)
, m_page(Bindings::host_defined_page(realm))
, m_style_computer(make<CSS::StyleComputer>(*this))
@ -938,7 +938,7 @@ JS::GCPtr<HTML::HTMLBaseElement const> Document::first_base_element_with_href_in
}
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fallback-base-url
AK::URL Document::fallback_base_url() const
URL Document::fallback_base_url() const
{
// 1. If document is an iframe srcdoc document, then:
if (HTML::url_matches_about_srcdoc(m_url)) {
@ -958,7 +958,7 @@ AK::URL Document::fallback_base_url() const
}
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#document-base-url
AK::URL Document::base_url() const
URL Document::base_url() const
{
// 1. If there is no base element that has an href attribute in the Document, then return the Document's fallback base URL.
auto base_element = first_base_element_with_href_in_tree_order();
@ -970,7 +970,7 @@ AK::URL Document::base_url() const
}
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#parse-a-url
AK::URL Document::parse_url(StringView url) const
URL Document::parse_url(StringView url) const
{
// FIXME: Pass in document's character encoding.
return base_url().complete_url(url);
@ -1855,7 +1855,7 @@ Document::IndicatedPart Document::determine_the_indicated_part() const
// 5. Let fragmentBytes be the result of percent-decoding fragment.
// 6. Let decodedFragment be the result of running UTF-8 decode without BOM on fragmentBytes.
auto decoded_fragment = AK::URL::percent_decode(*fragment);
auto decoded_fragment = URL::percent_decode(*fragment);
// 7. Set potentialIndicatedElement to the result of finding a potential indicated element given document and decodedFragment.
potential_indicated_element = find_a_potential_indicated_element(MUST(FlyString::from_deprecated_fly_string(decoded_fragment)));
@ -3768,7 +3768,7 @@ void Document::update_for_history_step_application(JS::NonnullGCPtr<HTML::Sessio
// The doNotReactivate argument distinguishes between these two cases.
if (documents_entry_changed) {
// 1. Let oldURL be document's latest entry's URL.
auto old_url = m_latest_entry ? m_latest_entry->url : AK::URL {};
auto old_url = m_latest_entry ? m_latest_entry->url : URL {};
// 2. Set document's latest entry to entry.
m_latest_entry = entry;
@ -3831,7 +3831,7 @@ void Document::update_for_history_step_application(JS::NonnullGCPtr<HTML::Sessio
}
}
HashMap<AK::URL, JS::GCPtr<HTML::SharedImageRequest>>& Document::shared_image_requests()
HashMap<URL, JS::GCPtr<HTML::SharedImageRequest>>& Document::shared_image_requests()
{
return m_shared_image_requests;
}

View file

@ -92,7 +92,7 @@ public:
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> create_and_initialize(Type, String content_type, HTML::NavigationParams&);
[[nodiscard]] static JS::NonnullGCPtr<Document> create(JS::Realm&, AK::URL const& url = "about:blank"sv);
[[nodiscard]] static JS::NonnullGCPtr<Document> create(JS::Realm&, URL const& url = "about:blank"sv);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> construct_impl(JS::Realm&);
virtual ~Document() override;
@ -106,10 +106,10 @@ public:
String referrer() const;
void set_referrer(String);
void set_url(const AK::URL& url) { m_url = url; }
AK::URL url() const { return m_url; }
AK::URL fallback_base_url() const;
AK::URL base_url() const;
void set_url(const URL& url) { m_url = url; }
URL url() const { return m_url; }
URL fallback_base_url() const;
URL base_url() const;
void update_base_element(Badge<HTML::HTMLBaseElement>);
JS::GCPtr<HTML::HTMLBaseElement const> first_base_element_with_href_in_tree_order() const;
@ -123,7 +123,7 @@ public:
HTML::CrossOriginOpenerPolicy const& cross_origin_opener_policy() const { return m_cross_origin_opener_policy; }
void set_cross_origin_opener_policy(HTML::CrossOriginOpenerPolicy policy) { m_cross_origin_opener_policy = move(policy); }
AK::URL parse_url(StringView) const;
URL parse_url(StringView) const;
CSS::StyleComputer& style_computer() { return *m_style_computer; }
const CSS::StyleComputer& style_computer() const { return *m_style_computer; }
@ -451,8 +451,8 @@ public:
void set_is_initial_about_blank(bool b) { m_is_initial_about_blank = b; }
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-about-base-url
Optional<AK::URL> about_base_url() const { return m_about_base_url; }
void set_about_base_url(Optional<AK::URL> url) { m_about_base_url = url; }
Optional<URL> about_base_url() const { return m_about_base_url; }
void set_about_base_url(Optional<URL> url) { m_about_base_url = url; }
String domain() const;
void set_domain(String const&);
@ -544,7 +544,7 @@ public:
void update_for_history_step_application(JS::NonnullGCPtr<HTML::SessionHistoryEntry>, bool do_not_reactivate, size_t script_history_length, size_t script_history_index, Optional<Vector<JS::NonnullGCPtr<HTML::SessionHistoryEntry>>> entries_for_navigation_api = {}, bool update_navigation_api = true);
HashMap<AK::URL, JS::GCPtr<HTML::SharedImageRequest>>& shared_image_requests();
HashMap<URL, JS::GCPtr<HTML::SharedImageRequest>>& shared_image_requests();
void restore_the_history_object_state(JS::NonnullGCPtr<HTML::SessionHistoryEntry> entry);
@ -602,7 +602,7 @@ protected:
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
Document(JS::Realm&, AK::URL const&);
Document(JS::Realm&, URL const&);
private:
// ^HTML::GlobalEventHandlers
@ -631,7 +631,7 @@ private:
Optional<CSS::Selector::PseudoElement::Type> m_inspected_pseudo_element;
JS::GCPtr<Node> m_active_favicon;
WeakPtr<HTML::BrowsingContext> m_browsing_context;
AK::URL m_url;
URL m_url;
JS::GCPtr<HTML::Window> m_window;
@ -732,7 +732,7 @@ private:
bool m_is_initial_about_blank { false };
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-about-base-url
Optional<AK::URL> m_about_base_url;
Optional<URL> m_about_base_url;
// https://html.spec.whatwg.org/multipage/dom.html#concept-document-coop
HTML::CrossOriginOpenerPolicy m_cross_origin_opener_policy;
@ -808,7 +808,7 @@ private:
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#latest-entry
JS::GCPtr<HTML::SessionHistoryEntry> m_latest_entry;
HashMap<AK::URL, JS::GCPtr<HTML::SharedImageRequest>> m_shared_image_requests;
HashMap<URL, JS::GCPtr<HTML::SharedImageRequest>> m_shared_image_requests;
// https://www.w3.org/TR/web-animations-1/#timeline-associated-with-a-document
HashTable<JS::NonnullGCPtr<Animations::AnimationTimeline>> m_associated_animation_timelines;

View file

@ -31,7 +31,7 @@ JS::NonnullGCPtr<DOM::Document> create_document_for_inline_content(JS::GCPtr<HTM
// origin: origin
// cross-origin opener policy: coop
HTML::CrossOriginOpenerPolicyEnforcementResult coop_enforcement_result {
.url = AK::URL("about:error"), // AD-HOC
.url = URL("about:error"), // AD-HOC
.origin = origin,
.cross_origin_opener_policy = coop
};
@ -52,7 +52,7 @@ JS::NonnullGCPtr<DOM::Document> create_document_for_inline_content(JS::GCPtr<HTM
// FIXME: navigation timing type: navTimingType
// about base URL: null
auto response = Fetch::Infrastructure::Response::create(vm);
response->url_list().append(AK::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
HTML::NavigationParams navigation_params {
.id = navigation_id,
.navigable = navigable,

View file

@ -11,12 +11,12 @@ namespace Web::DOM {
JS_DEFINE_ALLOCATOR(XMLDocument);
JS::NonnullGCPtr<XMLDocument> XMLDocument::create(JS::Realm& realm, AK::URL const& url)
JS::NonnullGCPtr<XMLDocument> XMLDocument::create(JS::Realm& realm, URL const& url)
{
return realm.heap().allocate<XMLDocument>(realm, realm, url);
}
XMLDocument::XMLDocument(JS::Realm& realm, AK::URL const& url)
XMLDocument::XMLDocument(JS::Realm& realm, URL const& url)
: Document(realm, url)
{
}

View file

@ -15,11 +15,11 @@ class XMLDocument final : public Document {
JS_DECLARE_ALLOCATOR(XMLDocument);
public:
static JS::NonnullGCPtr<XMLDocument> create(JS::Realm&, AK::URL const& url = "about:blank"sv);
static JS::NonnullGCPtr<XMLDocument> create(JS::Realm&, URL const& url = "about:blank"sv);
virtual ~XMLDocument() override = default;
private:
XMLDocument(JS::Realm& realm, AK::URL const& url);
XMLDocument(JS::Realm& realm, URL const& url);
virtual void initialize(JS::Realm&) override;
};