Closed
Bug 155507
Opened 22 years ago
Closed 15 years ago
Borders collapse when rules="all" is declared
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla1.8beta2
People
(Reporter: bugzilla, Unassigned)
References
Details
(Keywords: testcase, Whiteboard: [patch])
Attachments
(5 files)
(deleted),
text/html
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
patch
|
bernd_mozilla
:
review+
bzbarsky
:
superreview+
asa
:
approval1.8b2+
|
Details | Diff | Splinter Review |
The default value for border-collapse is separate. If you add the attribute
rules="all", then the value of border-collapse becomes collapse; a given value
to cellspacing is ignored.
Opera 6 (O6 does not support the rules attribute anyway) and MSIE 6 do not react
this way.
Reporter | ||
Comment 1•22 years ago
|
||
Comment 2•22 years ago
|
||
Agreed, that seems bad for rules="all" mapping. I'll try to remember to get to
this when I work on the other bug I own about cleaning up the code so it doesn't
use PostResolveCallbacks.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P2
Target Milestone: --- → Future
Comment 3•22 years ago
|
||
This is being caused by the rule:
table[rules] {
border-collapse: collapse;
}
in html.css
> This is being caused by the rule... in html.css.
So then, this could be fixed by adding
table[rules="all"] {
border-collapse: separate;
}
OS: Windows XP → All
Hardware: PC → All
Comment 5•22 years ago
|
||
Or changing the selector to
table[rules]:not([rules="all"])
Updated•22 years ago
|
Whiteboard: [patch]
Reporter | ||
Comment 7•22 years ago
|
||
I don't even understand why one would want to declare a css rule where the
[rules] selector determines somehow the border-collapse property value of a
table. That, I don't understand.
MSIE 6 does not work like that.
Borders on rows and columns have no effect in the separated borders model.
That's why we need to use the collapsed borders model for tables with 'rules'.
http://www.w3.org/TR/REC-CSS2/tables.html#separated-borders
What MSIE is doing here is, I think, not actually possible in CSS. (And you
can't do it with CSS in MSIE, either.) In a table with rules=cols, the vertical
borders are painted *into* the cellspacing to connect them from cell to cell.
Reporter | ||
Comment 9•22 years ago
|
||
Re comment #8
So, this quote [ from http://www.w3.org/TR/REC-CSS2/tables.html#separated-borders ]
should be decisive:
"In this (separated border) model, each cell has an individual border. (...)
Rows, columns, row groups, and column groups cannot have borders (i.e., user
agents must ignore the border properties for those elements)."
So in other words:
1) table[rules="all"] implies border-collapse:separate
2) table[rules="cols"] implies border-collapse:collapse
3) table[rules="rows"] implies border-collapse:collapse
4) table[rules="groups"] implies border-collapse:collapse
5) table[rules="none"] implies border-collapse:collapse (?!?)
Did I get this right?
So, this bug could be solved by modifying html.css with these css3 attribute
selectors:
table[rules*="o"] {border-collapse:collapse;}
/* every rules that has a value with the substring "o" at least once */
or
table[rules]:not([rules="all"]) {border-collapse:collapse;}
/* all of the rules values except when rules="all" */
and
table[rules="all"] {border-collapse:separate;}
Comment 10•22 years ago
|
||
table[rules]:not([rules="all"]) {border-collapse:collapse;}
...would also match table with no rules attribute. Better would be to list the
values intended to affect border-collapse.
Anyway, this can't be done in html.css since it needs to be considered as author
level style (it's a presentational attribute) so it must be done at the
attribute mapping level.
Comment 11•22 years ago
|
||
Comment 12•22 years ago
|
||
Comment 13•22 years ago
|
||
I'm against the idea that any of the values for the HTML attribute 'rules'
should imply 'border-collapse:collapse'. If the author hasn't explicitly
specified 'collapse' it should be 'separate', after all what would you do when
the author explicitly have style="border-collapse:separate" and rules="all" ?
I think the IE6 implementation of "separate rules" is excellent and in spirit
with the HTML spec regarding 'rules' (see attachment 101843 [details].)
IMHO, that is the rendering we should implement too.
Reporter | ||
Comment 14•22 years ago
|
||
Mats, what do you make of this which can be read at section 17.6.1 of CSS2 and
CSS2.1:
"In this (separated border) model, each cell has an individual border. (...)
Rows, columns, row groups, and column groups cannot have borders (i.e., user
agents must ignore the border properties for those elements)."
Toward the end of section 17.6.2 of CSS2 and CSS2.1, the W3C give an example of
a table with rules="rows"; the border-collapse:collapse declaration is
explicitly stated to achieve that.
{The top border of the table is set to 'hidden' to suppress the top border of
the first row. This implements the "rules" attribute of HTML 4.0 (rules="rows").
TABLE[rules=rows] TR { border-top: solid }
TABLE[rules=rows] { border-collapse: collapse;
border-top: hidden }
}
Comment 15•22 years ago
|
||
*** Bug 187258 has been marked as a duplicate of this bug. ***
Comment 16•22 years ago
|
||
*** Bug 188883 has been marked as a duplicate of this bug. ***
Comment 17•22 years ago
|
||
*** Bug 199573 has been marked as a duplicate of this bug. ***
Comment 18•21 years ago
|
||
Updated•21 years ago
|
Attachment #139525 -
Flags: superreview?(bz-vacation)
Attachment #139525 -
Flags: review?(bernd.mielke)
Comment 19•21 years ago
|
||
Comment on attachment 139525 [details] [diff] [review]
patch
sr=bzbarsky
Attachment #139525 -
Flags: superreview?(bz-vacation) → superreview+
Comment 20•21 years ago
|
||
Borders still have broken styles for cols, rows and groups. Why?
I have a table with <colgroup span=2>, <td colspan=2> and <td rowspan=2> and
simply want to have it looking the same way as simple tables. Without any CSS
hacks if possible.
On IE it works as expected
(http://bugzilla.mozilla.org/attachment.cgi?id=101843&action=view)
Comment 21•21 years ago
|
||
Comment on attachment 139525 [details] [diff] [review]
patch
this will probably still match rules="", but it fixes this bug, which is for me
more a reaction to public pressure than content driven.
Attachment #139525 -
Flags: review?(bernd.mielke) → review+
Comment 22•20 years ago
|
||
Why was this never checked in?
Comment 23•20 years ago
|
||
This was assigned and a patch was made. Why wasn't it checked in?
Status update anyone? Ian, David?
Updated•20 years ago
|
Attachment #139525 -
Flags: approval1.8b2?
Comment 24•20 years ago
|
||
Comment on attachment 139525 [details] [diff] [review]
patch
a=asa
Attachment #139525 -
Flags: approval1.8b2? → approval1.8b2+
Comment 25•20 years ago
|
||
Fix checked in to trunk, 2005-04-28 13:47 -0700.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: Future → mozilla1.8beta2
Comment 26•19 years ago
|
||
The rules="all" part of this got backed out because it caused bug 310100. It
looks like we need to get bug 43178 fixed...
Updated•18 years ago
|
Assignee: dbaron → nobody
Status: REOPENED → NEW
QA Contact: ian → style-system
Comment 27•15 years ago
|
||
bug 43178 got fixed the test case is http://mxr.mozilla.org/mozilla-central/source/layout/reftests/table-bordercollapse/borderhandling-rules-border.html
Status: NEW → RESOLVED
Closed: 20 years ago → 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•