Open
Bug 417826
Opened 16 years ago
Updated 2 years ago
In table cell, width="0px" is ignored, but style="width: 0px" is honored
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
NEW
Webcompat Priority | P3 |
People
(Reporter: dholbert, Unassigned)
References
Details
Attachments
(2 files)
In Trunk on a table cell, we honor style="width: 0px" as a specified-width of 0px, but we ignore width="0" and treat it as auto-width. This was noted in https://bugzilla.mozilla.org/show_bug.cgi?id=413286#c19. The auto-width behavior is due to nsHTMLTableCellElement.cpp:338, with the explanatory comment "0 implies auto for compatibility." We should make the behaviors of styled zero-width and attribute zero-width consistent -- either ignore both, or honor both.
Reporter | ||
Comment 2•16 years ago
|
||
Reporter | ||
Comment 3•16 years ago
|
||
Reporter | ||
Comment 4•16 years ago
|
||
The top half of testcase 1 shows the bug in Firefox Trunk -- the zero-width "as attribute" version matches "No Width", but the zero-width "as style" version doesn't match -- it honors the zero-width, and consequently shrink-wraps to the min-width of the light blue cell. In other browsers, all of the "Width is 0" cases are indistinguishable* from the "No Width" cases. (Other browsers = WebKit/Konqueror, Opera, IE7, and FF2.) So, in the interest of compatibility, I think we should probably shift to make styled zero-width behavior match attribute zero-width behavior -- that is, we should ignore a styled zero-width, and treat it instead as auto-width. *indistinguishable -- but with one funny exception: IE7 seems to ignore 'width="0%"', but honors 'style="width: 0%"'. It's similar to this bug here, but with % instead of px.
Comment 5•16 years ago
|
||
So... if I recall how this works, the idea is that per CSS spec "width:0" is pretty well-defined and we do what it says to do. The width="0" behavior is there for compat with IE. I'm guessing the other UAs made width="0" behave that way for compat reasons and did the style thing for the same reasons you're proposing here... but is this particular spec violation really something we want? If so, can we at least get the spec changed?
So I think we should stick to honoring the CSS -- it's potentially a useful feature, and it produces more sensible/understandable behavior for authors when we honor it. The question is whether we should start honoring HTML width="0". I don't know of any specs that define any of this; which ones are you referring to?
Updated•7 years ago
|
See Also: → https://webcompat.com/issues/3838
Updated•5 years ago
|
See Also: → https://webcompat.com/issues/10219
Updated•5 years ago
|
status-firefox67:
--- → affected
status-firefox68:
--- → affected
status-firefox69:
--- → affected
status-firefox70:
--- → affected
status-firefox71:
--- → affected
Webcompat Priority: --- → ?
Updated•4 years ago
|
Webcompat Priority: ? → revisit
Updated•2 years ago
|
Webcompat Priority: revisit → P3
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•