mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 17:28:30 +00:00
LibWeb: Update revokeObjectURL for reported spec bugs
The spec intends to pass through a URL record object as it needs to be serialized on removal. This has no functional impact on our implementation other than the double parsing of every URL being revoked. It is also missing an error check for an invalid URL being passed through. This does not impact our implementation currently as we just end up using an empty URL which is not part of the blob entry map. This will cause problems once DOMURL::parse is updated to return an Optional<URL::URL> however.
This commit is contained in:
committed by
Sam Atkins
parent
228750a9d2
commit
b81d6945dc
@@ -115,13 +115,13 @@ Optional<URL::BlobURLEntry::Object> obtain_a_blob_object(URL::BlobURLEntry const
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#removeTheEntry
|
||||
void remove_entry_from_blob_url_store(StringView url)
|
||||
void remove_entry_from_blob_url_store(URL::URL const& url)
|
||||
{
|
||||
// 1. Let store be the user agent’s blob URL store;
|
||||
auto& store = blob_url_store();
|
||||
|
||||
// 2. Let url string be the result of serializing url.
|
||||
auto url_string = URL::URL { url }.to_string();
|
||||
auto url_string = url.serialize();
|
||||
|
||||
// 3. Remove store[url string].
|
||||
store.remove(url_string);
|
||||
|
||||
Reference in New Issue
Block a user