Closed Bug 188715 Opened 22 years ago Closed 15 years ago

CSS property border-color not working on tables

Categories

(Core :: Layout: Tables, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: webmaster, Unassigned)

References

Details

(Keywords: testcase, Whiteboard: Ignore comments 9-14)

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3a) Gecko/20021212
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3a) Gecko/20021212

There's just a little problem with the css attribute border-color. When you use
this attribute in a style HTML attribute, it doesn't affect the table
border-color : <table bordercolor="#0000FF"> works but <table
style="border-color:#0000FF"> doesn't. But the first one is not in the HTML 4.0
W3C Standard, where the second one is in the CSS 2.0 Standard.

Reproducible: Always

Steps to Reproduce:
1. make a html page with a table and the attribute style="border-color:#FF0000"
in the table tag (this page for instance:
http://www.thps-warehouse.net/css-test.html)
2. 
3.

Actual Results:  
the table border color is not red, but the default color while border-color is
in the W3C CSS 2.0 standard

Expected Results:  
the table border color should be red

Mozilla Theme : Modern (forgot to test with classic theme but there is the same
problem with Netscape 7.01 Classic Theme)
confirming using build 20030111 on Linux. Konqueror 3.1 shows it red.
could be dupe of bug 14090.
Keywords: testcase
OS: Windows 98 → All
Hardware: PC → All
Whiteboard: http://www.thps-warehouse.net/css-test.html
"bordercolor" is an IE extension to HTML that we do not support and have no
plans to support.  Use the style="border-color: whatever" version, which is the
standardized method of doing that.

It's not clear to me what made you even think that "bordercolor" should work,
given that you _have_ read the standards in question...
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Whiteboard: http://www.thps-warehouse.net/css-test.html
for Boris Zbarsky:

i didn't say that: i said bordercolor was _not_ in the W3C standard but that the
CSS attribute : border-color is in the W3C Standard. Although, Mozilla and
Netscape (w/ win98) doesn't show red borders.

(but bordercolor works with mozilla, i think for compatibility reasons since IE
is unfortunately very used)
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Oh, man.  I should learn to read, apparently.....  My apologies.

So here's what a brief investigation shows:

1)  In standards mode (with the "Transitional" removed from the DTD) we paint the
    border red.
2)  In quirks mode we paint it red only when the border-style is set to something
    other than "none".

bernd, what was that thing about table border painting in quirks mode and how
it's deliberately broken for compat with someone?
boris thats exactly the quirk at bug 14090 we are observing here. IE does not
color borders. Our default bordertstyle in quirks mode is -moz-bg-outset which
could be safely renamed into -moz-ie-quirk-outset. Maybe we should map the
default border style to -outset once a color is specified (I am not certain that
this is achievable)
Um... Why are we using a quirky value of border-style to set a specific _color_?
Would not a quirky value of border-color be better? (and border-style: outset in
html.css, probably)

For that matter, why is the current stuff hardcoded in the C++ instead of being
in html.css/quirk.css?

So my proposal:

1)  Remove the code at
http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsHTMLTableElement.cpp#1472
and remove the corresponding code in MapTableFrameInto. (btw, that code for the
"frame" attribute looks pretty broken; should that not be in a post-resolve
callback?  If not, it should be checking the existing CSSUnits, no?)

2)  Put the following rule in html.css:

table { border-style: outset } 

3)  Put in quirk.css:

table { border-color: -moz-background; }  /* seems to fit what it does well */

4)  Make nsCSSRendering do the right thing.

What do you think?  This way if a site author sets a border color, it works.  If
the site author sets a border style without setting a border color, they just
get an odd color; perfectly normal behavior that can be predicted (unlike our
current "can't set border color without setting border style first" thing).

Confirming this while we figure it out.  ;)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Target Milestone: --- → Future
Does not appear to exist anymore.
Attached file quirks testcase
Hi,
I found a strange bug with the css border-color feature and I think it is the same.
Works with Netscape 7.2, but is already broken with Mozilla 1.6 and also with
Firefox 0.8. Still reproduceable with lates Firefox nightly (14. May).

I have created a CSS/XHTML testcase that will be attched.
The borders of the header and footer should be red, but the borders are in fact
identical to the (font) color.
(I hope that my CSS is correct, the validator says so.)

Stephen
> Works with Netscape 7.2
Sorry, Netscape 7.1 of course... :-/

By searching for a workaround for my webpage (where the testcase is extracted
from), I found out, that if you specify the border-color at the end of the CSS
file, it actually works.
Looks like there is some information overwritten, when parsing the CSS.

Stephen, none of that has anything to do with this bug (which is about a
specific border-color issue with tables), and the current behavior is correct,
since the border-top shorthand resets the color.  Netscape 7.1 is buggy here. 
Email me personally instead of adding more spam to this bug if you have questions.
Whiteboard: Ignore comments 9-14
Boris, could you shed some light on this bug. Is this wfm as your last comment
indicates?
Bernd, this bug's substance is described in comment 6 (together with my proposed
program for fixing it).  My last comment (comment 14) just says that the
behavior described by comment 13 is not a bug.
The first part of comment 6 should happen in bug 43178. At least thats my
understanding of http://bugzilla.mozilla.org/show_bug.cgi?id=43178#c16
Depends on: 43178
Attachment #148566 - Attachment is obsolete: true
Attachment #148567 - Attachment is obsolete: true
Bernd's "quirks testcase" works for me, in standards mode also.
Summary: CSS attribute border-color not working → CSS property border-color not working on tables
fixed by bug 84307
Status: NEW → RESOLVED
Closed: 22 years ago15 years ago
Depends on: 84307
No longer depends on: 43178
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: