mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
LibWeb: Handle blob URLs in Document::parse_url
Implement this function to the spec, and use the full blown URL parser that handles blob URLs, instead of the basic-url-parser. Also clean up a FIXME that does not seem relevant any more.
This commit is contained in:
parent
95c6fdf401
commit
c071720430
Notes:
sideshowbarker
2024-07-16 22:11:09 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/c071720430 Pull-request: https://github.com/SerenityOS/serenity/pull/24220 Reviewed-by: https://github.com/kennethmyhra
|
@ -53,6 +53,7 @@
|
|||
#include <LibWeb/DOM/ShadowRoot.h>
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/DOM/TreeWalker.h>
|
||||
#include <LibWeb/DOMURL/DOMURL.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
#include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h>
|
||||
#include <LibWeb/FileAPI/BlobURLStore.h>
|
||||
|
@ -982,8 +983,11 @@ URL::URL Document::base_url() const
|
|||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#parse-a-url
|
||||
URL::URL Document::parse_url(StringView url) const
|
||||
{
|
||||
// FIXME: Pass in document's character encoding.
|
||||
return base_url().complete_url(url);
|
||||
// 1. Let baseURL be environment's base URL, if environment is a Document object; otherwise environment's API base URL.
|
||||
auto base_url = this->base_url();
|
||||
|
||||
// 2. Return the result of applying the URL parser to url, with baseURL.
|
||||
return DOMURL::parse(url, base_url);
|
||||
}
|
||||
|
||||
void Document::set_needs_layout()
|
||||
|
|
Loading…
Reference in a new issue