Bug 139209

Summary: Modernize the CSSParser code
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CSSAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, darin, kling, koivisto, ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2014-12-02 16:21:40 PST
Modernize the CSSParser code by:
- Using more references instead of pointers
- Using nullptr instead of 0
Comment 1 Chris Dumez 2014-12-02 17:07:44 PST
Created attachment 242465 [details]
Patch
Comment 2 Antti Koivisto 2014-12-03 05:42:27 PST
Comment on attachment 242465 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=242465&action=review

> Source/WebCore/css/CSSParser.cpp:5966
> +    for (CSSParserValue* argument = args.current(); argument; argument = args.next()) {
>          // The call to parseFillPosition below should consume all of the
>          // arguments except the first three. Thus, an index greater than two
>          // indicates an invalid production.
> -        if (args->currentIndex() > 2)
> +        if (args.currentIndex() > 2)
>              return nullptr;

The stateful iteration of CSSParserValueList is bit strange. Wonder if it could just be a vector...
Comment 3 WebKit Commit Bot 2014-12-03 06:21:02 PST
Comment on attachment 242465 [details]
Patch

Clearing flags on attachment: 242465

Committed r176719: <http://trac.webkit.org/changeset/176719>
Comment 4 WebKit Commit Bot 2014-12-03 06:21:09 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Csaba Osztrogonác 2014-12-03 07:34:24 PST
(In reply to comment #3)
> Comment on attachment 242465 [details]
> Patch
> 
> Clearing flags on attachment: 242465
> 
> Committed r176719: <http://trac.webkit.org/changeset/176719>

And the trivial buildfix landed in https://trac.webkit.org/changeset/176722.
(unfortunately with wrong reference to the changeset)

But it was super easy and EWS noticed it in time. :-/