mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibURL+LibWeb: Port URL::complete_url to Optional
Removing one more source of the URL::is_valid API.
This commit is contained in:
parent
356728b1e0
commit
53826995f6
Notes:
github-actions[bot]
2025-02-15 17:07:12 +00:00
Author: https://github.com/shannonbooth
Commit: 53826995f6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3586
Reviewed-by: https://github.com/tcl3 ✅
14 changed files with 57 additions and 52 deletions
|
@ -1761,7 +1761,7 @@ bool Parser::is_parsing_svg_presentation_attribute() const
|
|||
|
||||
// https://www.w3.org/TR/css-values-4/#relative-urls
|
||||
// FIXME: URLs shouldn't be completed during parsing, but when used.
|
||||
URL::URL Parser::complete_url(StringView relative_url) const
|
||||
Optional<URL::URL> Parser::complete_url(StringView relative_url) const
|
||||
{
|
||||
return m_url.complete_url(relative_url);
|
||||
}
|
||||
|
|
|
@ -460,7 +460,7 @@ private:
|
|||
JS::Realm& realm() const;
|
||||
bool in_quirks_mode() const;
|
||||
bool is_parsing_svg_presentation_attribute() const;
|
||||
URL::URL complete_url(StringView) const;
|
||||
Optional<URL::URL> complete_url(StringView) const;
|
||||
|
||||
GC::Ptr<DOM::Document const> m_document;
|
||||
GC::Ptr<JS::Realm> m_realm;
|
||||
|
|
|
@ -2470,7 +2470,7 @@ Optional<URL::URL> Parser::parse_url_function(TokenStream<ComponentValue>& token
|
|||
|
||||
auto convert_string_to_url = [&](StringView url_string) -> Optional<URL::URL> {
|
||||
auto url = complete_url(url_string);
|
||||
if (url.is_valid()) {
|
||||
if (url.has_value()) {
|
||||
transaction.commit();
|
||||
return url;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue