Closed Bug 114867 Opened 18 years ago Closed 18 years ago

layout issue with display:block applied to a table


(Core :: Layout, defect)

Windows NT
Not set





(Reporter: ebourg, Assigned: attinasi)


(Keywords: qawanted)


(1 file)

If the style "display:block" is applied to a table, its layout is changed. Since
'block' is the default value for the 'display' style attribute on a table
element, this action should have no visible effect.
The default value of the display property for TABLE is likely to be 'table'. 
Per CSS2 the default display of table elements is "table" (yes, IE gets this
Closed: 18 years ago
Resolution: --- → INVALID
I wasn't aware of this rule of CSS2, thank you. However this doesn't explain why
a table layout is broken when display:block is applied. The CSS2 spec states :

<i>The default style sheet for HTML 4.0 in the appendix illustrates the use of
these values for HTML 4.0:

TABLE    { display: table }
TR       { display: table-row }
THEAD    { display: table-header-group }
TBODY    { display: table-row-group }
TFOOT    { display: table-footer-group }
COL      { display: table-column }
COLGROUP { display: table-column-group }
TD, TH   { display: table-cell }
CAPTION  { display: table-caption }

User agents may ignore these 'display' property values for HTML documents, since
authors should not alter an element's expected behavior.

Since altering the display property value to 'block' seems to break the table
layout, Mozilla should follow the recommendation and actually ignore attempts to
set it to anything else but 'table' (and maybe 'none' of course).

Resolution: INVALID → ---
That's not a _recommendation_.  A recommendation would say "should".  This says
"may".  So it's a violation of the spec which is allowable in some circumstances
for some reason.

QA to hixie, who has the final word on this sort of thing.
Keywords: qawanted
QA Contact: petersen → ian
Replace "recommendation" by "suggestion" in my previous comment if you want :)
Mozilla _may_ ignore the value, and i'm giving - i think - a good reason for it
to do so (a layout change).
No, a good reason could be "This is commonly misused on very popular sites", or
"We have a layout engine that has no concept of display:table"....  In my
opinion, of course.
"may" != "must"

This bug as it stands is invalid.  We are not required by the spec to ignore
this and it is obvious that we don't.  We properly apply the display as
specified in the CSS and are required to since we do not ignore this display

However, if you feel that we should ignore the display property in this
instance, it is a different issue and thus a different bug.  Please search
Bugzilla to avoid dupes.
Closed: 18 years ago18 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.