Open Bug 1493878 Opened Last year Updated 13 days ago

iframe.contentDocument is changed across loading even when it has no src or srcdoc

Categories

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

defect

Tracking

()

Webcompat Priority P3
Tracking Status
firefox64 --- affected

People

(Reporter: xidorn, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file testcase
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.
I suspect bug 543435 is the bug tracking this.
Depends on: sync-about-blank
Blocks: 1494236
Blocks: 1494237
No longer blocks: 1494237
Priority: -- → P3

This is affecting hterm over in bug 1503241.

Webcompat Priority: --- → ?
Type: enhancement → defect
Priority: P3 → P2
Webcompat Priority: ? → P2
Blocks: 1503241

(Lowering webcompat priority because Google fixed the GCP console bug on their end)

Webcompat Priority: P2 → P3
You need to log in before you can comment on or make changes to this bug.