[webkit-reviews] review granted: [Bug 16708] CSS: Slow parsing of rgb() with percent values : [Attachment 86486] proposed patch v3

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 29 10:41:19 PDT 2011


Darin Adler <darin at apple.com> has granted Andras Becsi <abecsi at webkit.org>'s
request for review:
Bug 16708: CSS: Slow parsing of rgb() with percent values
https://bugs.webkit.org/show_bug.cgi?id=16708

Attachment 86486: proposed patch v3
https://bugs.webkit.org/attachment.cgi?id=86486&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=86486&action=review

> Source/WebCore/css/CSSParser.cpp:3904
> +// Returns the number of characters which form a valid double
> +// and are terminated by the given terminator character
> +static int isValidDouble(const UChar* string, const UChar* end, const char
terminator)

Given that this returns the number of characters, the function name should
probably be something that doesn’t make it sound like it returns a boolean.

> Source/WebCore/css/CSSParser.cpp:3964
> +    unsigned scale = 1;
> +
> +    while (position < length && scale < MAX_SCALE) {
> +	   fraction = fraction * 10 + string[position++] - '0';
> +	   scale *= 10;
> +    }
> +
> +    value = localValue + (fraction / static_cast<double>(scale));

It seems that "scale" should be a double here instead of unsigned.


More information about the webkit-reviews mailing list