Bug 98557 - Add a "non-zero" flag for CSSParser::validUnit()
Summary: Add a "non-zero" flag for CSSParser::validUnit()
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tab Atkins
URL:
Keywords:
Depends on:
Blocks: 65159
  Show dependency treegraph
 
Reported: 2012-10-05 14:32 PDT by Tab Atkins
Modified: 2022-08-02 13:28 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.16 KB, patch)
2012-10-05 14:43 PDT, Tab Atkins
no flags Details | Formatted Diff | Diff
Patch (2.10 KB, patch)
2012-10-05 19:11 PDT, Tab Atkins
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tab Atkins 2012-10-05 14:32:08 PDT
CSSParser::validUnit() can currently take a "non-negative" flag, but some properties further need to be strictly positive.  For example, "column-count" only accepts integers > 0, but currently we accept "0" as a valid value (see bug 65159).

This patch adds a non-zero flag to the flag enum that validUnit() uses, so this can be easily checked.
Comment 1 Tab Atkins 2012-10-05 14:43:40 PDT
Created attachment 167384 [details]
Patch
Comment 2 Tab Atkins 2012-10-05 19:11:37 PDT
Created attachment 167435 [details]
Patch
Comment 3 Tab Atkins 2012-10-05 19:13:49 PDT
Whoops, sorry for the noise.  This patch is identical to the previous.  I hadn't refreshed the bug page since before I uploaded the first patch, so I didn't realize it was already committed. :/

Anyway, r+ and cq+ please. ^_^
Comment 4 Eric Seidel (no email) 2012-10-08 11:52:11 PDT
Comment on attachment 167435 [details]
Patch

It seems like for such a simple change we might want to just roll this into bug 65159.  I also probably would have called this FPositive since non-zero could be negative, no?
Comment 5 Tab Atkins 2012-10-08 12:11:15 PDT
Okay, I wasn't sure what the protocol was for this kind of thing.

I went with NonZero rather than Positive because it might be useful to have non-zero behavior specifically.  However, I don't know of any case where that's true, so I might as well just rename it and shorten its usage.

Okay, so I'll fold this into bug 65159.
Comment 6 Tab Atkins 2012-10-08 12:56:32 PDT
Comment on attachment 167435 [details]
Patch

Turning off cq? to see if this gets submitted as part of bug 65159 instead.  If so, I'll just cancel this bug out entirely.
Comment 7 Brent Fulgham 2022-08-02 13:28:27 PDT
Comment on attachment 167435 [details]
Patch

This code is no longer relevant.