Open Bug 1493878 Opened Last year Updated 13 days ago
.content Document is changed across loading even when it has no src or srcdoc
See the attached testcase. It shows that iframe.contentDocument is changed during the loading. This behavior is different from both Chrome and Edge. It's not clear to me where piece of spec is related, but it's something not interoperable. This difference causes some web-platform tests to fail in unexpected way, see for example some discussion in web-platform-tests/wpt#13102. Also it doesn't seem to be useful that we create two different documents in the process.
There is the initial about:blank created if .contentDocument is accessed early, and then a new about:blank is loaded (because no src is treated as src=about:blank). The usefulness comes from having consistent behavior. Initial about:blank is created always if .contentDocument is accessed early enough, and then new page is just loaded. Not having two about:blanks means special casing about:blank. hsivonen might recall some more details here regarding other implementations.
Per spec, there should be no about:blank load in the > Otherwise, if the element has no src attribute specified, and the user agent is processing the iframe's attributes for the "first time" case. I'm pretty sure we have existing bugs on the fact that we do have such a load... Fixing this would be a pretty good idea, i think.
Webcompat Priority: --- → ?
Webcompat Priority: P2 → P3
You need to log in before you can comment on or make changes to this bug.