mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 06:29:43 +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
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <AK/HashTable.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibURL/Parser.h>
|
||||
#include <LibWeb/DOMURL/DOMURL.h>
|
||||
#include <LibWeb/Fetch/Fetching/Fetching.h>
|
||||
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
|
||||
#include <LibWeb/Fetch/Infrastructure/FetchController.h>
|
||||
|
@ -71,8 +71,9 @@ void ImageRequest::set_state(State state)
|
|||
void ImageRequest::set_current_url(JS::Realm& realm, String url)
|
||||
{
|
||||
m_current_url = move(url);
|
||||
if (auto url = URL::Parser::basic_parse(m_current_url); url.has_value())
|
||||
m_shared_resource_request = SharedResourceRequest::get_or_create(realm, m_page, url.release_value());
|
||||
|
||||
if (auto parsed_url = DOMURL::parse(m_current_url); parsed_url.has_value())
|
||||
m_shared_resource_request = SharedResourceRequest::get_or_create(realm, m_page, parsed_url.release_value());
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/images.html#abort-the-image-request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue