Closed Bug 961711 Opened 10 years ago Closed 10 years ago

Investigate whether disabling the onload inline attribute for sandboxed iframes make sense

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bruant.d, Unassigned)

Details

      No description provided.
Why does this matter?
Flags: needinfo?(bruant.d)
I'm not entirely sure yet (hence "investigate").
My current understanding is that HTML parsing is blocked on iframe loading. The only reason this is the case is the onload attribute which has to run before any other JS (like a <script> right after the iframe for instance).
Maybe sandboxed iframes are an occasion to clean up that mess (on* attributes are a bad practice and disabled by CSP by default anyway) and allow better performance because the document can keep being parsed and later JS execute in parallel of the iframe loading (here parallel mostly means "download iframe resources in parallel", not necessarily JS execution).

Now that I think about it, it's probably not blocking bug 961689.
Now that I think about it, I wonder if CSP isn't just enough to continue parsing a document while loading an iframe.

Tell me if I didn't say something completely false here in which case, I'll move this discussion to WHATWG.
Flags: needinfo?(bruant.d)
> My current understanding is that HTML parsing is blocked on iframe loading.

It's not that I know of.  What gave you the idea that it is?

> The only reason this is the case is the onload attribute which has to run before any
> other JS (like a <script> right after the iframe for instance).

Not at all.  The onload attribute runs async, whenever the iframe finishes loading.  This can be before or after a <script> after the iframe, depeding on how the various network bits race.
(In reply to Boris Zbarsky [:bz] from comment #3)
> > My current understanding is that HTML parsing is blocked on iframe loading.
> 
> It's not that I know of.  What gave you the idea that it is?
My confused memory, I guess.

There appears to be no benefit in disabling onload anymore, so I'm closing this bug.

Thanks for the clarifications, Boris!
No longer blocks: 961689
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.