1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:47:34 +00:00

LibWeb: Change Document::parse_url to accept a StringView

There's no need for this to require a DeprecatedString - the method it
wraps around already only expects a StringView. This allows passing a
String instance without any conversion.
This commit is contained in:
Timothy Flynn 2023-05-12 14:09:05 -04:00 committed by Andreas Kling
parent 7fa8fae786
commit 5bc386cc96
2 changed files with 2 additions and 2 deletions

View file

@ -811,7 +811,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(DeprecatedString const& url) const
AK::URL Document::parse_url(StringView url) const
{
// FIXME: Pass in document's character encoding.
return base_url().complete_url(url);

View file

@ -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(DeprecatedString const&) const;
AK::URL parse_url(StringView) const;
CSS::StyleComputer& style_computer() { return *m_style_computer; }
const CSS::StyleComputer& style_computer() const { return *m_style_computer; }