mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 23:29:52 +00:00
LibWeb: Parse CSS/image URLs using DOMURL::parse
DOMURL::parse handles blob URLs.
This commit is contained in:
parent
9e474a4eb0
commit
4a8c70b3a5
Notes:
github-actions[bot]
2025-08-08 16:48:55 +00:00
Author: https://github.com/trflynn89
Commit: 4a8c70b3a5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5780
Reviewed-by: https://github.com/tcl3 ✅
6 changed files with 60 additions and 7 deletions
|
@ -4,10 +4,10 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibURL/Parser.h>
|
||||
#include <LibWeb/CSS/CSSStyleSheet.h>
|
||||
#include <LibWeb/CSS/Fetch.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOMURL/DOMURL.h>
|
||||
#include <LibWeb/Fetch/Fetching/Fetching.h>
|
||||
#include <LibWeb/HTML/SharedResourceRequest.h>
|
||||
|
||||
|
@ -38,7 +38,8 @@ static WebIDL::ExceptionOr<GC::Ref<Fetch::Infrastructure::Request>> fetch_a_styl
|
|||
auto url_string = url_value.visit(
|
||||
[](::URL::URL const& url) { return url.to_string(); },
|
||||
[](CSS::URL const& url) { return url.url(); });
|
||||
auto parsed_url = ::URL::Parser::basic_parse(url_string, base);
|
||||
|
||||
auto parsed_url = DOMURL::parse(url_string, base);
|
||||
if (!parsed_url.has_value())
|
||||
return WebIDL::SimpleException { WebIDL::SimpleExceptionType::URIError, "Failed to parse URL"sv };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue