Open Bug 1550838 Opened 5 years ago Updated 1 year ago

Firefox does not render certain web page ($(body).fadeIn() with body { display: none } rule)


(Core :: DOM: CSS Object Model, defect, P3)

Windows 10



Tracking Status
firefox-esr60 --- wontfix
firefox66 --- wontfix
firefox67 --- wontfix
firefox67.0.1 --- wontfix
firefox68 --- wontfix
firefox69 --- wontfix


(Reporter: alice0775, Unassigned)


(Depends on 1 open bug, )


(4 keywords)


(1 file, 1 obsolete file)

Chrome, Edge(EdgeHTML) anf IE11 works as expected.
Firefox only fails. UA spoofing does not help.

Workaround(userContent.css or stylus(needs reload)):

@-moz-document domain("") {
body { display: block !important; }

Reproducible: always

Steps to reproduce:

  1. Open

Actual results:
Blank page

Expected Results:
Page should be displayed

Emilio, is this something for you to look at?

Flags: needinfo?(emilio)
Attached file Reduced test-case. (obsolete) —

I'm happy to take a look. Here's a test-case. I haven't dug into what jquery is doing yet.

So this is a tough one to fix. This is because css_defaultDisplay("body") in the jquery source in:

returns "none". More analysis coming.

Flags: needinfo?(emilio)
Comment on attachment 9064227 [details]
Test-case that shows the difference.

><!doctype html>
>  body { display: none }
>// Try to determine the default display value of an element
>function css_defaultDisplay( nodeName ) {
>  let iframe = document.body.appendChild(document.createElement("iframe"));
>  let iframeDoc = (iframe.contentWindow || iframe.contentDocument).document;
>  iframeDoc.write("<!doctype html><html><body>");
>  iframeDoc.close();
>  let elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );
>  display = getComputedStyle(elem).display;
>  iframe.remove();
>  return display;
Attachment #9064227 - Attachment mime type: text/plain → text/html

So basically, css_defaultDisplay there is what's going wrong. It's going wrong because jquery is appending the <iframe> to the body to ensure it's displayed, but it's not (since the body is display: none).

That means we have nowhere to grab the style from (see the longstanding bug 548397 and the cousin bug 1483798), and thus we do the next-thing-we-can-do which is returning the style from the outer document.

This site is using an ancient jQuery btw.

Anyhow, fixing bug 1483798 would fix this (we'd return the style from the display: none iframe).

We're in a somewhat better position to do it now.

Component: Untriaged → DOM: CSS Object Model
Depends on: 1483798
Priority: -- → P3
Product: Firefox → Core
See Also: → 1483798, 548397
Summary: Firefox does not render certain web page → Firefox does not render certain web page ($(body).fadeIn() with body { display: none } rule)

Err, I meant bug 1471231 above.

Depends on: 1471231
No longer depends on: 1483798
See Also: → 1471231
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.