[Webkit-unassigned] [Bug 34402] Implement numeric CSS3 list-style-types
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Feb 7 10:09:38 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=34402
Darin Adler <darin at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #48291|review? |review+
Flag| |
--- Comment #8 from Darin Adler <darin at apple.com> 2010-02-07 10:09:32 PST ---
(From update of attachment 48291)
> +static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, int sequenceSize, bool isAlphabeticSequence)
Elsewhere in WebKit code we've found that enums are easier to read than bools
for arguments like this where the value passed is a constant.
enum SequenceType { NumericSequence, AlphabeticSequence };
You can still name the argument isAlphabeticSequence and use boolean-style
logic inside the function.
> + ASSERT(sizeof(number) <= 4);
This could instead be a compile-time assert.
> + const int lettersSize = 32 + 1; // big enough to hold the ASCII representation of the largest negative 32-bit int in binary plus a minus sign.
Since this is the only place we are depending on the size of the number
argument, then I think you we just use sizeof in this expression instead of
using an assertion.
const int lettersSize = sizeof(number) * 8 + 1; // Binary is the worst
case; requires one character per bit plus a minus sign.
> + numberShadow = -number;
I'm glad this works for MIN_INT, but I'm not sure how it works.
r=me
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list