Open Bug 2011558 Opened 9 months ago Updated 9 months ago

Iframe srcdoc fails to load on page refresh given onload script setting its hash

Categories

(Core :: DOM: Navigation, defect, P3)

Firefox 147
defect

Tracking

()

Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- wontfix
firefox147 --- wontfix
firefox148 --- wontfix
firefox149 --- fix-optional

People

(Reporter: alyssa, Unassigned)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0

Steps to reproduce:

  1. Open an HTML file, from local hard drive, with the following source code:

<!DOCTYPE html>
<html lang="en">
<head>
<title>Iframe Refresh Demo</title>
</head>
<body>
<iframe id="frame" srcdoc="<!DOCTYPE html><html><head></head><body><p id="1">First paragraph.</p><p id="2">Second paragraph.</p></body></html>"></iframe>
<!-- iframe srcdoc: <!DOCTYPE html><html><head></head><body><p id="1">First paragraph.</p><p id="2">Second paragraph.</p></body></html> -->
<script>
"use strict";
function pass_window_hash_to_iframe() {
let section_iframe = document.getElementById("frame");
section_iframe.contentWindow.location.hash = window.location.hash;
}
window.onload = pass_window_hash_to_iframe;
</script>
</body>
</html>

  1. refresh the page a few times, including a mix of ordinary refresh and shift-refresh.

I did the above in Firefox 147.0.1, on Windows 11.

Actual results:

On all reloads with shift-refresh, and some-although-not-all reloads with non-shift refresh, the iframe contents failed to display, with Firefox instead displaying an error-page with this message: "Hmm. That address doesn’t look right. Please check that the URL is correct and try again."

Expected results:

The reloads should have consistently loaded the iframe contents into display.

...whoops. Apparently the Bugzilla text-input-interface eats the encoding of the srcdoc element. As a clarification, then: the srcdoc attribute value, in the example code, should be run through appropriate encoding so that everything is well-formed.

Attached file test.html —
Severity: -- → S3
Priority: -- → P3
See Also: → 1751439
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: