Last Comment Bug 645768 - In quirks mode, tables constructed at the same time as the body's frame don't pick up the body color quirk
: In quirks mode, tables constructed at the same time as the body's frame don't...
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: mozilla7
Assigned To: Boris Zbarsky [:bz] (TPAC)
: 651028 (view as bug list)
Depends on: 655549
Blocks: 651028
  Show dependency treegraph
Reported: 2011-03-28 11:09 PDT by d.a.
Modified: 2011-08-26 02:52 PDT (History)
10 users (show)
bzbarsky: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

This is some weird table color quirk... (293 bytes, text/html)
2011-03-28 11:48 PDT, Boris Zbarsky [:bz] (TPAC)
no flags Details
Simpler and less magical testcase (278 bytes, text/html)
2011-03-28 12:07 PDT, Boris Zbarsky [:bz] (TPAC)
no flags Details

Description d.a. 2011-03-28 11:09:13 PDT
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.2a1pre) Gecko/20110328 Firefox/4.2a1pre
Build Identifier: 

The text on the FIA website renders the text in the table in white instead of the expected black until you right click on the page, then the text will become black.

Reproducible: Always

Steps to Reproduce:
1. Goto
2. Notice the text in the 3 tables are white (expect for the links to the individual GPs).
3. Right click on the page and the text will become black.
Comment 1 Boris Zbarsky [:bz] (TPAC) 2011-03-28 11:33:12 PDT
Interesting.  I see the text white (including in computed style) until I examine the CSS rules for that table cell.  Then it becomes black...
Comment 2 Boris Zbarsky [:bz] (TPAC) 2011-03-28 11:48:11 PDT
Created attachment 522418 [details]
This is some weird table color quirk...

Whatever causes that inner table to not have white text is not happening properly in this testcase.  If I take out the <link> or replace it with a <style> the problem goes away.... And if I put the white color on the <body> then the text is white in all browsers(!).
Comment 3 Boris Zbarsky [:bz] (TPAC) 2011-03-28 11:50:12 PDT
David, do you have any idea where this quirk is implemented?
Comment 4 Boris Zbarsky [:bz] (TPAC) 2011-03-28 12:01:58 PDT
Ok, found it.  So the problem here is that we're doing InitialReflow when the stylesheet finishes loading.  We're in the middle of frame construction and we end up resolving style for that inner table.  But nsHTMLStyleSheet::RulesMatching calls GetBodyColor() which looks for the <body>'s frame, which we don't have yet.  So we bail out and don't apply the quirk.
Comment 5 Boris Zbarsky [:bz] (TPAC) 2011-03-28 12:02:38 PDT
If we don't have a <body> frame we should consider just resolving a style for the body in this situation...
Comment 6 Boris Zbarsky [:bz] (TPAC) 2011-03-28 12:03:32 PDT
The other option is to restyle when the <body> gets a frame.  David, thoughts?
Comment 7 Boris Zbarsky [:bz] (TPAC) 2011-03-28 12:05:46 PDT
And another option is that when we resolve style for a <body> in the frame constructor we tell nsHTMLStyleSheet about the new style...
Comment 8 Boris Zbarsky [:bz] (TPAC) 2011-03-28 12:07:13 PDT
Created attachment 522421 [details]
Simpler and less magical testcase
Comment 9 Mounir Lamouri (:mounir) 2011-06-02 04:20:26 PDT has this bug in the summary. Should it be fixed?
Comment 10 Boris Zbarsky [:bz] (TPAC) 2011-06-02 05:38:18 PDT
Yes, this was fixed by bug 655549.
Comment 11 Boris Zbarsky [:bz] (TPAC) 2011-06-02 05:41:58 PDT
*** Bug 651028 has been marked as a duplicate of this bug. ***
Comment 12 Virgil Dicu [:virgil] [QA] 2011-08-26 02:52:22 PDT
Mozilla/5.0 (Windows NT 6.1; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (X11; Linux i686; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0) Gecko/20100101 Firefox/7.0
Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0

Verified fixed on Mac OS 10.6, Ubuntu 10.4, Windows XP and Windows 7. I have used the test case provided in comment 8.

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