Closed Bug 711 Opened 27 years ago Closed 25 years ago

CSS color: statement ignored.

Categories

(Core :: Layout, defect, P3)

x86
Windows 95
defect

Tracking

()

VERIFIED WONTFIX

People

(Reporter: ekrock, Assigned: peterl-retired)

References

()

Details

View this HTML page to reproduce. Please email directly w/ any questions; I filter Scopus email to trash. --- CUT HERE --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <!-- * Internal HTML page title for indexing use only. Not shown on page. * --> <TITLE></TITLE> <!-- * If you want to add a CSS style sheet specific to this page, * uncomment the next line and add your formatting commands. * --> <STYLE TYPE="text/css"> /* First, set attributes of BODY element. These will be inherited by all elements inside BODY. Therefore, they will become default settings within document. */ BODY { color: red; background: white; } /* Set color for links and visited links. */ :link { color: #CC3300 } :visited { color: #666666 } :active { color: #000000 } /* Make sure that the table, row, and cell elements of the table which forms the skeleton of our presentation pages will have zero width margin and padding. */ .page_skeleton_table { margin: 0 0 0 0; border: 0 0 0 0; padding: 0 0 0 0; } H1 { font-size: 48 } P { font-size: 24 } LI { font-size: 24 } // show source code in a smaller font so more fits on the page PRE { font-size: 16 } // default size of text within tables TH { font-size: 24 } TD { font-size: 24 } </STYLE> <META NAME="GENERATOR" CONTENT="Mozilla/3.0Gold (Win95; I) [Netscape]"> </HEAD> <BODY> <TABLE CLASS=page_skeleton_table> <TR CLASS=page_skeleton_table> <TD CLASS=page_skeleton_table> <!-- This 1-pixel wide invisible GIF is necessary to ensure that --> <!-- the height of the table's top cell matches the height of the --> <!-- logo. Do not cut it or the top cell's height will change. --> <IMG SRC="basefile/head_inv.gif" HEIGHT=72 WIDTH=1 ALIGN=RIGHT> <!-- ******************************** --> <!-- * Place your header text here. * --> <!-- ******************************** --> <H1>All this text should be red.</H1> <!-- ******************************** --> <!-- * Header text ends here. * --> <!-- ******************************** --> </TD> </TR> <TR CLASS=page_skeleton_table> <TD CLASS=page_skeleton_table> <!-- ****************************** --> <!-- * Place your body text here. * --> <!-- ****************************** --> <P>What's wrong? <!-- ****************************** --> <!-- * Body text ends here. * --> <!-- ****************************** --> </TD> </TR> </TABLE> </BODY> </HTML>
Tables don't inherit styles. This won't be changed for 4.0
Actually, this problem is not table specific. Here's a test case where ordinary BODY text doesn't have it's color set (to red) even though setting the background color (to yellow) within the same selector succeeds: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <!-- * Internal HTML page title for indexing use only. Not shown on page. * --> <TITLE></TITLE> <!-- * If you want to add a CSS style sheet specific to this page, * uncomment the next line and add your formatting commands. * --> <STYLE TYPE="text/css"> /* First, set attributes of BODY element. These will be inherited by all elements inside BODY. Therefore, they will become default settings within document. */ /* PR3 bug: color ignored. */ BODY { color: red; background: yellow; } /* Set color for links and visited links. */ :link { color: #CC3300 } :visited { color: #666666 } :active { color: #000000 } /* Make sure that the table, row, and cell elements of the table which forms the skeleton of our presentation pages will have zero width margin and padding. */ .skeleton { margin: 0 0 0 0; border: 0 0 0 0; padding: 0 0 0 0; } /* Show title page text in large, bold font. */ /* PR3 BUG: text-align ignored. Workaround: hardcode in template. */ H1.titlepage { font-size: 30pt; text-align: center; font-weight: bold; } /* show source code in a smaller font so more fits on the page */ PRE { font-size: 12pt } /* Define table with smaller point size text for displaying long, complex information like methods and properties. */ .smalltexttable { font-size: 12pt } TABLE.smalltexttable TH { font-size: 12pt ! important } TABLE.smalltexttable TD { font-size: 12pt ! important } /* this doesn't seem to work on S_props2.htm .smalltexttable TH { font-size: 12pt } .smalltexttable TD { font-size: 12pt } */ /* TR.smalltexttable { font-size: 12pt } TH.smalltexttable { font-size: 12pt } TD.smalltexttable { font-size: 12pt } */ /* Show header line in large font. */ H1 { font-size: 36pt } /* Show body text in smaller font. */ P, LI, TH, TD { font-size: 18pt } </STYLE> <META NAME="GENERATOR" CONTENT="Mozilla/3.0Gold (Win95; I) [Netscape]"> </HEAD> <BODY> <TABLE CLASS=skeleton> <TR CLASS=skeleton> <TD CLASS=skeleton> <!-- This 1-pixel wide invisible GIF is necessary to ensure that --> <!-- the height of the table's top cell matches the height of the --> <!-- logo. Do not cut it or the top cell's height will change. --> <IMG SRC="basefile/head_inv.gif" HEIGHT=72 WIDTH=1 ALIGN=RIGHT> <!-- ******************************** --> <!-- * Place your header text here. * --> <!-- ******************************** --> <H1>Agenda</H1> <!-- ******************************** --> <!-- * Header text ends here. * --> <!-- ******************************** --> </TD> </TR> <TR CLASS=skeleton> <TD CLASS=skeleton> <!-- ****************************** --> <!-- * Place your body text here. * --> <!-- ****************************** --> <UL> <LI>new features</LI> <LI>more new features</LI> <LI>still more new features</LI> </UL> <!-- ****************************** --> <!-- * Body text ends here. * --> <!-- ****************************** --> </TD> </TR> </TABLE> </BODY> </HTML>
Reopening for 4.02 consideration
The second example is the same as the first wrt tables. Tables can't inherit properly without a major rewrite, which would probably break all existing tables in the world.
*** Bug 85059 has been marked as a duplicate of this bug. ***
Added URL from duplicate bug here. Nixed the duplicate.
changed target fix from nebulous 4.0i to concrete 5.0
Move david william's bugs to harishd. He should be starting 7/13/1998
This is one more bug under the "inheritance" umbrella... Setting priority to P1.
Reassigning bug to Eric...
Status: NEW → ASSIGNED
Component: CSS → Layout
Version: other → 1998-07-28
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
This bug is not present in the current source base (old Mozilla bug)
Status: RESOLVED → REOPENED
Ok, this is what I find: Background color is always inherited. Color is inherited if you assign font color as a part of the BODY in a CSS statement. But if it is assigned to a block level element (like BLOCKQUOTE or DIV) and the table is included within the block, the font color is not inherited. Other font attributes, text and box attributes are not inherited. (see above URL) For example, here is a shortened version of the code in the above URL: <html> <head> <title>CSS and Tables</title> <style type="text/css"> <!-- BODY{ font-family: Arial; font-style: italic; font-weight: bold; color: maroon; font-size: large; background-color: yellow; background-image: url("images/dot.gif"); background-repeat: repeat-y; text-transform: uppercase; text-align: center; margin: 2pt; padding: 4pt; border: 6pt; border-style: double; border-color: blue; } --> </style> </head> <body> <P>This is ordinary text placed before the style sheet. <P>This text is within the style sheet and should be large, maroon, italic, Arial, all upper case, on a yellow background, and centered, with a <U>vertically</U> repeating image of dot.gif.<BR> <spacer TYPE="block" ALIGN="left" HEIGHT=20><br CLEAR="left"> <TABLE border=1 width=90%> <CAPTION>This is a table on a page with CSS. This text is in the caption.</CAPTION> <TR> <TH colspan=4>You should see the style of the page inherited into the table. This table has no special attributes assigned to it beyond width of 90% and border of 1. The table itself lists the style sheet characteristics assigned to this page.</TH> </TR> <TR> <TD>Font</TD> <TD>Background</TD> <TD>Text</TD> <TD>Box</TD> </TR> <TR> <TD>Font-Family: Arial</TD> <TD>Background-Color: Yellow</TD> <TD>Text-Transform: Uppercase</TD> <TD>Margin: 2pt</TD> </TR> <TR> <TD>Font-Style: Italic</TD> <TD>Background-Image: dot.gif</TD> <TD>Text-Align: Center</TD> <TD>Border: 6pt</TD> </TR> <TR> <TD>Color: Maroon</TD> <TD>Background-Repeat: Repeat-y</TD> <TD>----</TD> <TD>Border-Color: Blue</TD> </TR> <TR> <TD>Font-Size: Large</TD> <TD>----</TD> <TD>----</TD> <TD>Padding: 4pt</TD> </TR> <TR> <TD>Font-Weight: Bold</TD> <TD>----</TD> <TD>----</TD> <TD>Border-Style: Double</TD> </TR> <TR> <TD>----</TD> <TD>----</TD> <TD>----</TD> <TD>Display: Block</TD> </TR> </TABLE> <BR> Outside the table, but still inside the Style Sheet. This paragraph does not have a paragraph tag, the paragraph above the table does. </body> </html>
Resolution: INVALID → ---
Setting all current Open/Normal to M4.
Assignee: pollmann → harishd
Status: REOPENED → NEW
Product: Mozilla → NGLayout
Version: 1998-07-28 → other
Handing this off to the CSS people. Jan, which build were you using?
oops, forgot to enter the build info! That was with the 2/2/99 build.
For compatibility reasons, tables can inherit only font and color properties assigned to the BODY, not random enclosing elements.
per leger, assigning QA contacts to all open bugs without QA contacts according to list at http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser
QA Contact: 4144 → 4110
Priority: P1 → P3
Target Milestone: M4 → M5
Lowering priority to P3 and setting a M5 milestone.
Target Milestone: M5 → M6
I'm not quite sure what's the status of this report right now. It still says 'New'. I have a very simple HTML sample that looks different in Amaya than it does in M5. http://www.obiwan.org/test.html should display a white font on a blue background. The blue is there, the white isn't.
Assignee: harishd → peterl
Peter -- I think this is actually yours.
Status: NEW → RESOLVED
Closed: 26 years ago25 years ago
Resolution: --- → WONTFIX
The behavior we have is as expected for backward compatibility. Try it in "standard mode"
Status: RESOLVED → VERIFIED
Verified WONTFIX.
You need to log in before you can comment on or make changes to this bug.