[Webkit-unassigned] [Bug 70107] Custom written CSS lexer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 27 03:39:50 PST 2011


--- Comment #32 from Benjamin Poulain <benjamin at webkit.org>  2011-12-27 03:39:49 PST ---
(From update of attachment 120002)
View in context: https://bugs.webkit.org/attachment.cgi?id=120002&action=review

I just quickly skimmed over the path. Some comments bellow.
A general concern is lot of code have the assumption the input is ASCII. Is there no need to handle unicode (identifiers, space, digits, etc?).

> Source/WebCore/css/CSSParser.cpp:7446
> +    while (UNLIKELY(*data <= ' ' && (typesOfASCIICharacters[*data] == CharacterWhiteSpace)))

I am not sure the UNLIKELY() is a good idea here. A bunch of spaces grouped together seems very likely :)

> Source/WebCore/css/CSSParser.cpp:8032
> +    // This is not a real loop, just allows us to avoid gotos.
> +    while (true) {

Where would the Goto be? I only see one break at the end. The body is a switch().

> Source/WebCore/css/CSSParser.cpp:8098
> +            if (!isASCIIDigit(m_data[0]))
> +                break;

Isn't this redundant with the following code?
The code of CharacterNumber also handle the dot case.

> Source/WebCore/css/CSSParser.cpp:8102
> +            bool dotSeen = (m_token == '.');

I haven't read the purpose of this yet but that but I have only seen m_token used with named contants everywhere else.

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