Closed Bug 965 Opened 26 years ago Closed 25 years ago

Tables with border styles don't display properly

Categories

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

x86
Windows 95
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: angus, Assigned: karnaze)

Details

(Whiteboard: [MAKINGTEST] klein_sh@inter.net.il)

Attachments

(1 file)

This table: <table style="border: thin solid red" border=2> <tr><td>One</td><td>Two</td></tr> </table> Should look just like this one: <table border=2> <tr><td>One</td><td>Two</td></tr> </table> ... but in in addition it should have a red border around it. Currently, we display the red border, but we disregard the "border=2" stuff that should be applied to TD's. Seperately, the border on TD elements is an inconsistent width. For example, see this testcase: <table border=2 style="border: thin solid red"> <tr> <Td style="border: thin solid green">one</td> <td style="border: thin solid red">two</td> <td style="border: thin solid blue">three</td> </tr> <tr> <td style="border: thin solid green">four</td> <td style="border: thin solid yellow">five</td> <td style="border: thin solid orange">six</td> </tr> </table> IE 5.0 displays this properly. But in raptor, the borders of some sides of some TDs are wider than other borders. Additionally, the red border surrounding the entire table is too wide on the right side.
Status: NEW → ASSIGNED
Assignee: buster → peterl
Status: ASSIGNED → NEW
(Peter, I've assigned this to you for the last part. Keep reading...) For the first test case, the "thin" in the style attribute takes precedence over the "border=2" attribute. The CSS style property wins over the HTML attribute. I believe the current behavior is correct. I don't know what's going on with the TD borders. That requires a little investigation. For the rest of the bug report, I think it boils down to a style/attribute resolution conflict. The real question seems to be, why do the following two tables have different table borders? <html><body> <table style="border: 2px solid red" border=2> <tr><td>One</td><td>Two</td></tr> </table> <br> <table style="border:solid red" border=2> <tr><td>One</td><td>Two</td></tr> </table> </body></html>
The last 2 examples you give above should yield different results, since shorthand properties set other properties to their initial values. Thus "border: solid red" is equivalent to "border: medium solid red", and the medium takes precedence over the border=2 since non-CSS presentational hints are treated as if they are at the beginning of the author style sheet with a specificity of 0.
Setting all current Open/Normal to M4.
per leger, assigning QA contacts to all open bugs without QA contacts according to list at http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser
Status: NEW → ASSIGNED
Target Milestone: M4 → M6
Target Milestone: M6 → M7
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
Current behavior for all supplied test cases is correct.
Attached file Border color problem (deleted) —
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Added attachment that shows problem with border colors. This will be fixed when the border code is moved from tableCell's DidSetStyleContext to Table's MapAttributesInto.
Assignee: peterl → karnaze
Status: REOPENED → NEW
Status: NEW → ASSIGNED
Target Milestone: M9 → M10
Whiteboard: [MAKINGTEST] klein_sh@inter.net.il
I can't find support for the notion that <table border=2> should put a 2px border around its cells. Should the <td> in <table><tr><td style="border: thin solid green"> have a border. The html 4 spec says that border=0 implies rules=none. Should the <td> in <table style="border:1px solid red"><tr><td style="border: thin solid green"> have a border?
HTML 4.01 says, in section 11.3.1, that: Setting border="0" implies frame="void" and, unless otherwise specified, rules="none". Other values of border imply frame="border" and, unless otherwise specified, rules="all". The value "border" in the start tag of the TABLE element should be interpreted as the value of the frame attribute. It implies rules="all" and some default (non-zero) value for the border attribute. See http://www.w3.org/TR/html40/struct/tables.html#h-11.3.1 . These rules have nothing to do with CSS - if CSS gives a border for a table, it's a border for a table. So the answer to both your questions is yes, since in both cases the CSS style attribute gives a border for the cell. These are of course overridden by any author CSS, but that's another bug. So the correct procedure should be something like this: * If a table has a border attribute, set the frame and rules attributes as described above. * then map the value of the border attribute to border-width on the table. * If the table has rules=all (should you require frame=border too??), then set border-collapse to separate * Map the frame attribute to the border-style on the four sides of the table: + border -> outset on all sides + others can map to either combinations of solid/none or outset/none * Map the rules attribute to the border style of certain elements within the table: + all -> inset on cells + groups -> solid on top and bottom of rowgroups (thead, tbody, tfoot) + rows -> solid on top and bottom of tr elements + cols -> solid on sides of col elements + none -> either 1) do nothing or 2) hidden on cells * Then cascade all of the above attribute to style mappings in with all the other CSS rules that apply so that they come after all UA and user rules and before all author rules.
You should also map border-collapse to separate when rules=none (largely for backwards compatibility). rules=none and rules=all cover all of the backwards compatibility cases, I think, so you're safe ignoring cellspacing for all the other values and using the collapsing border model.
BTW, all the other values of the rules attribute should explicitly map to border-collapse: collapse because: * Bug 9191 isn't fixed yet. * It should override user stylesheets.
OK... another comment :-) : I think the above attribute mapping would mean the only table border rules you would need in ua.css for backwards compatibility would be: table[frame=border], table[rules=all] td { border-width: 1px; } (assuming that the attribute-switching described in HTML 4.0 11.3.1 is reflected in the content model, which I think it should be)
Status: ASSIGNED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
Fixed with latest checkin.
Status: RESOLVED → VERIFIED
Using 9/15 Apprunner with peterl test casefro 8/6, verified bug fixed.
Bug is fixed when using "border:thin solid", but not for numbered values i.e. "border:1pt solid". When using "border:1pt solid", border on TD elements has an inconsistent width - bottom and right border is thicker than top and left. Also values thin, medium, thick etc. are not consistent with IE. thin = in IE 1.5pt, Mozilla 1pt medium = in IE 3pt, Mozilla 2pt thick = in IE 6pt, Mozilla 4pt
In my comment please replace TD element with TABLE tag. The bug is on TABLE tag. Sorry for typo.
Commenting on long-fixed bugs isn't useful. Furthermore, thin=1px, medium=3px, and thick=5px.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: