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:
Shannon Booth 2025-01-22 17:21:14 +13:00 committed by Sam Atkins
parent 228750a9d2
commit b81d6945dc
Notes: github-actions[bot] 2025-01-22 12:35:04 +00:00
3 changed files with 9 additions and 4 deletions

View file

@ -30,7 +30,7 @@ ErrorOr<String> add_entry_to_blob_url_store(GC::Ref<Blob> object);
bool check_for_same_partition_blob_url_usage(URL::BlobURLEntry const&, GC::Ref<HTML::Environment>);
struct NavigationEnvironment { };
Optional<URL::BlobURLEntry::Object> obtain_a_blob_object(URL::BlobURLEntry const&, Variant<GC::Ref<HTML::Environment>, NavigationEnvironment> environment);
void remove_entry_from_blob_url_store(StringView url);
void remove_entry_from_blob_url_store(URL::URL const& url);
Optional<BlobURLEntry const&> resolve_a_blob_url(URL::URL const&);
void run_unloading_cleanup_steps(GC::Ref<DOM::Document>);