Open Bug 1942944 Opened 28 days ago Updated 14 days ago

CSS file is not loading in time (race condition) and it is only happening in Firefox and not other browsers

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 132
defect

Tracking

()

UNCONFIRMED

People

(Reporter: john.britzke, Unassigned, NeedInfo)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Steps to reproduce:

Our parent page loads CSS from our CDN, and an iframe loads data that then uses styles from that CSS. This works fine on all browsers except Firefox 132+

Actual results:

We are getting errors that css values not defined as if the css file is not loaded from our CDN, which is only happening in Firefox and not other browsers that we support.

We confirmed something changed in Firefox that is triggering this around FF version 132.
With the ESR (currently 128.5) and the page is working correctly.
When we switched back to latest 133, the bug is there

In the situations it happens, sometimes our css is NOT being loaded. In others, it is loaded and doesn't work but I see things trying to render before the file shows up in the console network logs.
When it works...it is coming up cached. So this feels like a race condition of some type

If this is a Firefox bug that isn't in an esr yet, we want to get it filed against firefox and fixed before the next esr.

We even tried a hacky patch on our code's method that is in question, as well as tried putting the expected css font-family style into a <style> tag in our index.html.
The patch worked on Windows.
It did not work on Mac. Stepping through the code, we see undefined / null.
This definitely implies that the css styles simply have not been applied when the first component asking for the theme is routing through this code.

So again: our Firefox > 132. ESR up to 131 doesn't produce this issue, so something changed in Firefox 132.

If we tried loading our css file in a parent page (just loading, not using) to get it into the mix sooner, it doesn't help. An iframe is still loading faster than its parent frame is loading that css file from the CDN.

Expected results:

CSS file should already be loaded by the time the iframe uses the styles.

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

Thanks for reporting! To help diagnose this issue better, please can you:

  1. Type "about:support" in Firefox and copy-paste its contents here
  2. Please do a bisection to find the exact change that caused this (https://mozilla.github.io/mozregression/). The "Good" version should be V128.5. The "Bad" version would be V133.
  3. Share a reduced testcase that repros this issue for you. OR share a link to a portal/page on which the issue can be reproduced.
    Thanks!

cc :emilio.

Flags: needinfo?(john.britzke)

Yeah if you can provide a repro or so I'd be happy to look into it. Thanks!

Hi John - just a reminder since it's been a couple weeks: we'd love to look into this, but for the time being we're blocked without the ability to look at a site or testcase that reproduces the issue.

If it's possible to stand up some sort of public demo site that you've confirmed shows the bug, or privately share some test credentials that give access to some deployment that hits the bug, that would be great.

Alternately/also: if you're willing, you can use mozregression on your side (which Mayank linked above) to bisect nightlies to find a narrow range of commits that are responsible for the change-in-behavior.

Thanks!

You need to log in before you can comment on or make changes to this bug.