Open
Bug 665918
Opened 13 years ago
Updated 2 years ago
[BC] Using rules="all" causes border colors on rows to be ignored because the cell border colors override them
Categories
(Core :: Layout: Tables, defect)
Tracking
()
NEW
People
(Reporter: nnever2000, Unassigned)
References
Details
(Keywords: testcase)
Attachments
(1 file, 1 obsolete file)
(deleted),
text/html
|
Details |
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Build Identifier: Mozilla 5.0 (also present in mozilla 4.0)
Look at this small piece of code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>BUG</title>
</head>
<body>
<table cellspacing="0" rules="all" border="1" style="width: 100%; height: 100%; font-size: 8pt;
font-family: Verdana; color: Black; border-width: 1px; border-style: Solid; border-color: #D4D0C8;
background-color: White; border-collapse: collapse;">
<tr style="color: #4073A7; background-color: White; border-color: #D4D0C8; border-width: 1px;
border-style: Solid; font-size: 8pt; text-decoration: none;">
<th align="center" scope="col" style="width: 100px;">
Data
</th>
<th align="left" scope="col">
Titolo
</th>
</tr>
<tr align="center" style="border-color: #D4D0C8; border-width: 1px; border-style: Solid;
height: 20px;">
<td align="center">
16/06/2011
</td>
<td align="left">
PIPPO
</td>
</tr>
</table>
</body>
</html>
Reproducible: Always
Steps to Reproduce:
1.Open in firefox the code in details section
2.
3.
Actual Results:
The text color and the border color are the same
Expected Results:
The border color should be #D4D0C8 instead is the same of the text
Comment 1•13 years ago
|
||
rules="all" puts borders on all the cells and uses the collapsed border model (which you're using explicitly anyway).
Now your rows have 1px solid borders from your styles and the cells have thin solid borders from the rules="all" (which also means 1px usually). CSS 2.1 section 17.6.2.1 says:
If border styles differ only in color, then a style set on a cell wins over
one on a row
which is exactly what you see here.
fantasai, what do you think the right behavior is here? Getting the behavior the reporter seems to expect means only setting left/right borders on the cells, and not even doing that for the cells that abut the table edges... which can't be figured out in practice on the selector level anyway.
Component: General → Layout: Tables
QA Contact: general → layout.tables
Summary: Using rules="all" the border color of the table is the same color of the text → Using rules="all" causes border colors on rows to be ignored because the cell border colors override them
Comment 2•13 years ago
|
||
Note that the HTML5 spec currently calls for our behavior, but that's at least in part because they lifted our style rules.
Attachment #540779 -
Attachment is obsolete: true
Reporter | ||
Comment 5•13 years ago
|
||
I would like to point out that about "CSS 2.1 section 17.6.2.1" it says that if "only colored BORDER STYLE Differ" but in our case the two borders (cell and row) are both the same color (green in the test cases) instead the color that wins is the text color and not the border-color. I really think it's a bug, and not strict application of the rules of HTML 5.0
Comment 6•13 years ago
|
||
> but in our case the two borders (cell and row) are both the same color (green
> in the test cases)
No. The table _row_ border colors in the testcase are green. The table _cell_ border colors are not set by the testcase directly, but setting rules="all" applies a UA style rule that sets the cell borders to solid style and thin width, with the default value of border-color. The default value of border-color is the text color. So the two cells in the testcase have a red and blue border respectively, which is what you're seeing.
Reporter | ||
Comment 7•13 years ago
|
||
> The default value of border-color is the text color.
Ok, I see now.
Having understood better what was happening I was able to create a centralized way to fix my applications.
Many thanks.
Updated•13 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 8•13 years ago
|
||
You're welcome. Still thinking about whether there's a good way to change the behavior on our end to be less surprising.
I think setting border-color: inherit; unconditionally on all internal table elements would help here. (It won't address the interaction with columns, but there isn't much we can do there.)
Comment 10•13 years ago
|
||
Just in the rules="all" case? Or in general? I can almost buy setting it in the rules="all" case, but in general would be pretty weird.
Comment 11•13 years ago
|
||
I think in general would be best. That makes the behavior very predictable. And if I roll back 10+ years of working with CSS specs and look at what I'd expect as an HTML4 Transitional author, it makes sense for the color to inherit through. That was the conceptual model HTML had for borders and backgrounds on tables.
Comment 12•13 years ago
|
||
So if I have a <table border="5"> and then style some cell with a color you would not expect that cell's border to get that color?
Comment 13•13 years ago
|
||
No, I would not expect that. I'd expect the cell to have the same color as the table border.
Comment 14•13 years ago
|
||
Hmm.
What do other UAs do here, esp. in the separated border model when color is applied to a row and a different one applied to a cell an the cell is given a default-colored border?
Summary: Using rules="all" causes border colors on rows to be ignored because the cell border colors override them → [BC] Using rules="all" causes border colors on rows to be ignored because the cell border colors override them
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•