Closed Bug 773132 Opened 8 years ago Closed 3 years ago

Implement auto-revoking blob URIs


(Core :: DOM: Core & HTML, defect)

Not set





(Reporter: emk, Unassigned)




Per latest spec, blob URIs are automatically revoked by default after providing a stable state.
Depends on: 587251
I'd prefer not using HTML spec's stable state for anything.
Then what should be used?
I filed
Looks like there can be also other problems in the spec.
I'm testing auto-revoke blob URI patch and I found it broke img-blobURI-2.html.
I think this is expected because the outer SVG-as-an-image will not even start loading before a stable state (or a microtask checkpoint, it doesn't matter for this problem). But is it acceptable to potentially break existing contents which use blob URIs inside SVG-as-an-image?
Yeah, loading the data-url source will definitely happen asynchronously, which means that the blob-url will be revoked by the time it's supposed to be parsed.

I think that's ok. At least I think it's at least worth trying, defaulting to auto-revoking definitely has a risk that it'll break too much content, but we won't know until we try.
(In reply to Olli Pettay [:smaug] from comment #3)
> I filed
> Looks like there can be also other problems in the spec.

Olli: I'm not sure your problems with stable state are solved with microtasks -- that's equally vague, if not more so.

Can you look at that bug again?  I left a comment for you regarding "await..." versus "present..."

Moreover, there are now *two bugs* that I think legitimately address the problem of autoRevoke:

1. (and


I think the above two bugs are the correct bugs with the specification, and NOT the microtask bug.  Thoughts?
Script (event listener etc) can't know what all scripts will run before the next stable state.
Microtask doesn't really have that problem.
I agree, we should definitely use microtasks
(In reply to Jonas Sicking (:sicking) from comment #8)
> I agree, we should definitely use microtasks

But microtasks aren't a real concept!  There's only the "magic words" which are "Perform a microtask checkpoint."  That's what this is all about:

We could:

1. Bolster up the existing stable state requirements.
2. Go back to and do a better job of defining what a microtask is.
Microtask is the outermost script execution.
MutationObserver callbacks get called at the end of the microtask or end of task, whichever is first.
Please don't fragment the discussion:
  var fileurl = URL.createObjectURL(file);
  audio.src = fileurl;
failed to load because the resource selection algorithm is awaiting a stable state before reading a src attribute.
that seems like a bigger problem!
Blocks: 794386
No longer blocks: 794386
Auto-revoking Blobs are now harnessed to "post-script cleanup steps."  


And in spec., see:
Autorevoke is not a thing in the latest version of the spec. I'm right? We should close this bug.
Flags: needinfo?(annevk)
Closed: 3 years ago
Flags: needinfo?(annevk)
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.