Closed
Bug 414638
Opened 18 years ago
Closed 15 years ago
Disallow mixed space/comma syntax for CSS rect() value
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla6
People
(Reporter: roc, Assigned: Ms2ger)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
|
427 bytes,
text/html
|
Details | |
|
4.60 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
http://lists.w3.org/Archives/Public/www-style/2008Jan/0208.html
We allow as per spec
clip: rect(96px, 96px, 96px, 96px);
and for compatibility we allow
clip: rect(96px 96px 96px 96px);
but we also allow
clip: rect(96px ,96px 96px, 96px);
and we probably shouldn't.
Comment 2•18 years ago
|
||
The spec has finally clarified this to say that all-commas and no-commas are allowed, but mixed is not, so we should in fact change.
http://test.csswg.org/suites/css2.1/20101001/html4/clip-rect-001.htm
Blocks: css2.1-tests
Updated•16 years ago
|
Whiteboard: [good first bug]
| Assignee | ||
Updated•15 years ago
|
Assignee: nobody → Ms2ger
Whiteboard: [good first bug] → [needs patch]
| Assignee | ||
Comment 4•15 years ago
|
||
I'm assuming that fantasai doesn't mind me reusing her test...
Attachment #528065 -
Flags: review?(dbaron)
| Assignee | ||
Updated•15 years ago
|
Status: NEW → ASSIGNED
Whiteboard: [needs patch] → [needs review]
Target Milestone: --- → mozilla6
Comment on attachment 528065 [details] [diff] [review]
Patch v1
>From: Ms2ger <ms2ger@gmail.com>
>Bug 414638 - Disallow mixed space/comma syntax for CSS rect() value
You may want to get a newer version of Mercurial at some point.
>+ PRBool useCommas = PR_FALSE;
Better to leave this uninitialized so valgrind will catch any errors.
> NS_FOR_CSS_SIDES(side) {
> if (! ParseVariant(rect.*(nsCSSRect::sides[side]),
> VARIANT_AL, nsnull)) {
> return PR_FALSE;
> }
>- if (side < 3) {
>- // skip optional commas between elements
>- (void)ExpectSymbol(',', PR_TRUE);
>+ if (side == 0) {
>+ useCommas = ExpectSymbol(',', PR_TRUE);
>+ } else if (side < 3) {
>+ // Skip optional commas between elements, but only if the first
>+ // separator was a comma.
>+ if (ExpectSymbol(',', PR_TRUE) != useCommas) {
>+ return PR_FALSE;
>+ }
You can make this addition simpler (and avoid the highly unusual pattern of comparing the result of ExpectSymbol to some other boolean) by changing it to:
if (side == 0) {
useCommas = ExpectSymbol(',', PR_TRUE);
} else if (useCommas && side < 3) {
if (!ExpectSymbol(',', PR_TRUE)) {
return PR_FALSE;
}
}
r=dbaron with that.
Attachment #528065 -
Flags: review?(dbaron) → review+
| Assignee | ||
Comment 7•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
You need to log in
before you can comment on or make changes to this bug.
Description
•