Closed
Bug 102344
Opened 23 years ago
Closed 23 years ago
'border-spacing' property in CSS2 cannot have negative lengths
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
People
(Reporter: tetem, Assigned: dbaron)
Details
(Keywords: css2)
Attachments
(1 file, 1 obsolete file)
1.42 KB,
patch
|
dbaron
:
review+
attinasi
:
superreview+
|
Details | Diff | Splinter Review |
In the following HTML table, the 'table' element has two CSS2 declarations. In CSS2, the 'border-spacing' property cannot have negative lengths. Accordingly, a CSS2 user agent must ignore the declaration. But, Mozilla 0.9.4 accepts it. <table border="1" style="border-collapse: separate; border-spacing: -0.5em"> <tr> <td>ABCDEFG</td> <td>HIJKLMN</td> </tr> <tr> <td>OPQRSTU</td> <td>VWXYZ</td> </tr> </table> References: http://www.w3.org/TR/REC-CSS2/tables.html#propdef-border-spacing http://www.w3.org/TR/html401/struct/tables.html
Comment 1•23 years ago
|
||
Indeed. Over to style system....
Assignee: karnaze → dbaron
Component: HTMLTables → Style System
QA Contact: amar → ian
Comment 2•23 years ago
|
||
Yep. Confirming. Either we need a new variant for non-negative lengths or ParseBorderSpacing needs to do the checking itself.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•23 years ago
|
OS: Windows 2000 → All
Hardware: PC → All
Summary: 'border-spacing' property in CSS2 → 'border-spacing' property in CSS2 cannot have negative lengths
Assignee | ||
Comment 3•23 years ago
|
||
We should probably do whatever we do for padding, which also cannot accept negative lengths.
Comment 4•23 years ago
|
||
Looks like that would just be a matter of replacing ParseVariant with ParsePositiveVariant in CSSParserImpl::ParseBorderSpacing Attaching patch
Comment 5•23 years ago
|
||
Assignee | ||
Comment 7•23 years ago
|
||
The way you use ExpectEndProperty will mess up error reporting. Perhaps it would be better to call ExpectEndProperty in the else of the second ParsePositiveVariant check and move the AppendValue calls for the one-value case there as well?
Comment 8•23 years ago
|
||
Well, it looks like ParsePositiveVariant() will eat up tokens... so something like: border-spacing: 0.5em -2em; would succeed on the first ParsePositiveVariant, fail on the second. Now what do we do? Just use 0.5em for both dimensions? We have no way of telling whether the second ParsePositiveVariant failed because there was nothing there to parse or because it parsed an illegal value.
Comment 9•23 years ago
|
||
Would it make sense for ParsePositiveVariant to UngetToken() for cases when ParseVariant() succeeds but returns a negative value?
Comment 10•23 years ago
|
||
Comment 11•23 years ago
|
||
Comment on attachment 51422 [details] [diff] [review] Patch to fix this The second patch fixes ParsePositiveVariant() so we handle this and negative paddings better and uses it...
Attachment #51422 -
Attachment is obsolete: true
Assignee | ||
Comment 12•23 years ago
|
||
Comment on attachment 51483 [details] [diff] [review] Better patch r=dbaron
Attachment #51483 -
Flags: review+
Comment 13•23 years ago
|
||
Comment on attachment 51483 [details] [diff] [review] Better patch sr=attinasi
Attachment #51483 -
Flags: superreview+
Comment 14•23 years ago
|
||
Checked into trunk.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•