"mute iframe load" flag doesn't seem to accurately capture what UAs do
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 9.4k
- Forks
- 3.2k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 38
Description
I don't quite know how to reconcile this with https://github.com/whatwg/html/issues/4291 but...
Consider the following testcase:
<script>
function doIt() {
log.textContent += "called";
var doc = frames[0].document;
doc.open();
doc.defaultView.addEventListener("load", () => console.log('load'));
doc.write("testing");
doc.close();
}
</script>
<div id=log></div>
<iframe onload="doIt()"> </iframe>
Per spec as written, it should log "load" at some point, but it does not. The spec's "mute iframe load" flag prevents doIt being called a second time, but what UAs are doing is more than that: they're not firing the load event at all on the window in the iframe in this case after the close() call, as far as I can see. And that's even true if I add an <img src> to that DOM...
I haven't tested what happens if I call doIt from the load event firing on the window in the subframe instead of from the load event firing on the iframe element, by the way. At least in Gecko I expect that to also suppress the load event for the written document.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the iframe testcase included in the issue and comparing its behavior with the specification's "mute iframe load" handling. Review the relationship to whatwg/html#4291 and determine whether the specification should describe suppression of the iframe window's load event. Done means reaching agreement on the intended behavior and identifying the required specification change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100