Bug 139209 - Modernize the CSSParser code
Summary: Modernize the CSSParser code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-02 16:21 PST by Chris Dumez
Modified: 2014-12-03 07:34 PST (History)
6 users (show)

See Also:


Attachments
Patch (245.74 KB, patch)
2014-12-02 17:07 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. :-/