Firefox 48 changes xhr cache timing or iframe document availability timing

RESOLVED INCOMPLETE

Status

()

Core
General
RESOLVED INCOMPLETE
2 years ago
6 months ago

People

(Reporter: Andy Earnshaw, Unassigned, NeedInfo)

Tracking

48 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2816.4 Safari/537.36

Steps to reproduce:

We have an implementation of a custom iframe that loads the document over XHR so that we can modify it and ensure our APIs are present in the content window before any scripts are run.  The code looks a little something like this:

    var ifr = document.createElement('iframe'),
        xhr = new XMLHttpRequest();

    targetParent.appendChild(ifr);
    xhr.open('GET', src, true);
    xhr.onload = function () {
        ifr.contentDocument.open();
        ifr.contentDocument.write(xhr.responseText);
        ifr.contentDocument.close();
    };
    xhr.send();

There's other stuff going on in our code, but this the the gist of the problematic part.


Actual results:

On first load of the host page, everything works fine and dandy.  However, on subsequent loads where the XHR is fetching the resource from cache, the iframe appears blank.  It looks like Firefox overwrites the iframe document with a fresh document after the `onload` callback is run.


Expected results:

I'd expect the XHR fetch to be guaranteed to complete _after_ the document in the iframe is available for editing, but this is not the case in Firefox 48 and later.  We've had the code running like this for a while but only had reports of failings recently, and I've had reports from our testers that it works fine in Firefox 47 and lower.

No other vendors exhibit this behaviour.
(Reporter)

Updated

2 years ago
Summary: Firefox 48 breaks → Firefox 48 breaks xhr cache timing or iframe document availability timing
(Reporter)

Updated

2 years ago
Summary: Firefox 48 breaks xhr cache timing or iframe document availability timing → Firefox 48 changes xhr cache timing or iframe document availability timing

Comment 1

2 years ago
Hi Andy,
I have difficult time testing this. Can you provide live test account of your system or attach a test case ? If this is a regression issue, can you give regression window? Installation and usage information about mozregression tool is available here:
http://mozilla.github.io/mozregression/

Thanks
Flags: needinfo?(andyearnshaw)

Comment 2

2 years ago
Closing this as incomplete due to inactivity and lack of response from the reporter.
If anyone can still reproduce it on latest versions, feel free to reopen the bug and provide more information.
Thanks
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INCOMPLETE
(Reporter)

Comment 3

2 years ago
Sorry about the late response.  I'm having difficulty slimming this down into a reproducible example (my basic example from the initial post doesn't reproduce the bug), but can still reliably reproduce the full issue on Firefox 50.

Unfortunately, my time is short. I have a lot on, but I will try and free up some time to get to the bottom of the issue soon.
Moving from Core::Untriaged to Core::General https://bugzilla.mozilla.org/show_bug.cgi?id=1407598
Component: Untriaged → General
You need to log in before you can comment on or make changes to this bug.