Closed Bug 72358 Opened 23 years ago Closed 23 years ago

:table has border-spacing: 2px

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla0.9.7

People

(Reporter: ian, Assigned: dbaron)

References

()

Details

(Keywords: css2, testcase, Whiteboard: [Hixie-P3] [easy fix])

Attachments

(2 files)

In html.css, the :table rule sets 'border-spacing' and 'border-collapse'.  It 
should inherit both of them.

I would guess we could change the rules like this:

========================= change this... =========

/* tables */

table, :table {
  display: table;
  border-spacing: 2px; 
  border-collapse: separate;
  margin-top: 0;
  margin-bottom: 0;
  -moz-box-sizing: border-box;
}

========================= to this... =============

/* tables */

table {
  display: table;
  border-spacing: 2px; 
  border-collapse: separate;
  margin-top: 0;
  margin-bottom: 0;
  -moz-box-sizing: border-box;
}

:table {
  display: table;
}

==================================================

...because:

  border-spacing is inherited by default
  border-collapse is inherited by default
  margin-top has '0' as the initial value anyway
  margin-bottom has '0' as the initial value anyway

I'm not sure about the -moz-box-sizing declaration, will :table ever be given
an explicit width? If not, then the declaration is moot, no?

You can see the effect of this change at:
   http://www.hixie.ch/tests/adhoc/css/box/table/001.xml
Without the fix, there is lots of red. With the fix, there is only a thin border
of red (caused by the bug which is depending on this bug).
Blocks: 72359
Moving to m1.0
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
QA contact update
QA Contact: chrisd → amar
Correct me if I am wrong, but the CSS2 specification requires the following
initial values:

table {
    border-spacing: 0;
    border-collapse: collapse;
}

See http://www.w3.org/TR/REC-CSS2/tables.html#propdef-border-collapse
The CSS2 spec also allows for a UA stylesheet to specify the default layout of
any markup language.
Evan: that's non-normative.

I would like to change my previous proposal to include !important in the rule
for :table. Ideally, of course, we wouldn't have to resolve psuedo-style on
these anonymous elements at all and those frames would just "know" that they
are table frames...

Is there any reason _not_ to fix the bug as proposed?
Whiteboard: [Hixie-P3] [easy fix] (py8ieh: ho hum)
Reassigning to hyatt as per discussion.
Assignee: karnaze → hyatt
Status: ASSIGNED → NEW
Whiteboard: [Hixie-P3] [easy fix] (py8ieh: ho hum) → [Hixie-P3] [easy fix]
r=dbaron on Ian's proposal.

We should investigate sometime whether our default values for 'border-collapse'
and 'empty-cells' are correct.
what is the status on this?
Oh, I'll take this and get it in.
Assignee: hyatt → dbaron
Priority: -- → P2
Target Milestone: mozilla1.0 → mozilla0.9.5
Status: NEW → ASSIGNED
Adding keywords...
Keywords: patch, review
setting platform/os to all
OS: Windows 2000 → All
Hardware: PC → All
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Comment on attachment 52089 [details] [diff] [review]
Hixie's patch as an attachment

r=dbaron
Attachment #52089 - Flags: review+
Although, could someone double-check that the changes to -moz-box-sizing and to
border-collapse don't cause problems?
I can guarentee that the change to border-collapse will have no effect. :-)
Not sure about -moz-box-sizing though.
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Comment on attachment 56975 [details] [diff] [review]
safer patch

sr=attinasi
Attachment #56975 - Flags: superreview+
I'm curious about how :table is used. I thought it was used to create an
anonymous table in case, for example, a rowgroup is inserted into some non-table
container. In that case, I would expect that table and :table should have the
same style properties. From looking at Ian's testcase, it seems we use :table
for arbitrary elements with display:table - is this right? Is there a disconnect
between these two uses?
Comment on attachment 56975 [details] [diff] [review]
safer patch

r=hixie
Attachment #56975 - Flags: review+
The :table pseudo-element is used in one place,
nsCSSFrameConstructor::CreatePseudoTableFrame.  Presumably that means it's only
used for anonymous content, although I could imagine there might be some cases
where we construct unneeded anonymous content (missing row groups?).
Fix checked in 2001-11-10 17:35 PDT.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Actually, in Ian's testcase, the table frame is an anonymous table object --
nothing has 'display: table' -- it's a table-row inside a float.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: