WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
121161
Rework CSS parser, eliminating "floating" concept and using %destructor
https://bugs.webkit.org/show_bug.cgi?id=121161
Summary
Rework CSS parser, eliminating "floating" concept and using %destructor
Darin Adler
Reported
2013-09-11 07:17:09 PDT
Rework CSS parser, eliminating "floating" concept and using %destructor.
Attachments
Patch
(96.41 KB, patch)
2013-09-11 08:01 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2013-09-11 08:01:03 PDT
Created
attachment 211314
[details]
Patch
WebKit Commit Bot
Comment 2
2013-09-11 08:04:03 PDT
Attachment 211314
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/css/CSSGrammar.y.in', u'Source/WebCore/css/CSSParser.cpp', u'Source/WebCore/css/CSSParser.h', u'Source/WebCore/css/CSSParserValues.cpp', u'Source/WebCore/css/CSSParserValues.h']" exit_code: 1 Source/WebCore/css/CSSParser.cpp:11630: Missing spaces around >> [whitespace/operators] [3] Source/WebCore/css/CSSParser.cpp:11744: The return type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.cpp:11744: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.cpp:11744: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.cpp:11764: Local variables should never be PassRefPtr (see
http://webkit.org/coding/RefPtr.html
). [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.cpp:11787: Missing spaces around >> [whitespace/operators] [3] Source/WebCore/css/CSSParser.cpp:11796: Local variables should never be PassRefPtr (see
http://webkit.org/coding/RefPtr.html
). [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.cpp:11796: Missing spaces around >> [whitespace/operators] [3] Source/WebCore/css/CSSParser.cpp:11847: Local variables should never be PassRefPtr (see
http://webkit.org/coding/RefPtr.html
). [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.cpp:12088: Local variables should never be PassRefPtr (see
http://webkit.org/coding/RefPtr.html
). [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.h:304: The return type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.h:305: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.h:314: Missing spaces around >> [whitespace/operators] [3] Source/WebCore/css/CSSParser.h:317: Missing spaces around >> [whitespace/operators] [3] Source/WebCore/css/CSSParser.h:340: The return type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.h:340: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/css/CSSParser.h:340: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Total errors found: 17 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Sam Weinig
Comment 3
2013-09-11 09:15:00 PDT
Comment on
attachment 211314
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=211314&action=review
>> Source/WebCore/css/CSSParser.h:304 >> + OwnPtr<Vector<OwnPtr<CSSParserSelector>>> createSelectorVector(); > > The return type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5]
Should this return a PassOwnPtr?
>> Source/WebCore/css/CSSParser.h:305 >> + void recycleSelectorVector(OwnPtr<Vector<OwnPtr<CSSParserSelector>>>); > > The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5]
Should this take a PassOwnPtr?
>>>> Source/WebCore/css/CSSParser.h:340 >>>> + OwnPtr<CSSParserSelector> rewriteSpecifiers(OwnPtr<CSSParserSelector>, OwnPtr<CSSParserSelector>); >>> >>> The return type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] >> >> The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] > > The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5]
PassOwnPtr?
Antti Koivisto
Comment 4
2013-09-11 09:23:10 PDT
Comment on
attachment 211314
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=211314&action=review
r=me
> Source/WebCore/css/CSSGrammar.y.in:188 > +%union { StyleRuleBase* rule; }
Is there still no way to use safe types in grammar? All these leakRefs and leakPtrs are bit scary.
>>>> Source/WebCore/css/CSSParser.cpp:11744 >>>> + specifiers->appendTagHistory(CSSSelector::SubSelector, newSpecifier.release()); >>> >>> The return type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] >> >> The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] > > The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5]
style bot needs to learn that PassOwnPtr is obsolete
Sam Weinig
Comment 5
2013-09-11 09:24:08 PDT
(In reply to
comment #4
)
> style bot needs to learn that PassOwnPtr is obsolete
Sam needs to learn that PassOwnPtr is obsolete :(.
Darin Adler
Comment 6
2013-09-11 09:45:58 PDT
Comment on
attachment 211314
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=211314&action=review
>> Source/WebCore/css/CSSGrammar.y.in:188 >> +%union { StyleRuleBase* rule; } > > Is there still no way to use safe types in grammar? All these leakRefs and leakPtrs are bit scary.
I’ll keep looking for a way to do it without having to write leakRef/leakPtr/adoptRef/adoptPtr/new/delete directly and if I find one I will switch to it. The fact that so much CSS parsing doesn’t use the union at all and instead using state inside CSSParser seems to point to a possible direction, but I am unclear how that works during the parsing process.
WebKit Commit Bot
Comment 7
2013-09-11 09:47:23 PDT
Comment on
attachment 211314
[details]
Patch Clearing flags on attachment: 211314 Committed
r155536
: <
http://trac.webkit.org/changeset/155536
>
WebKit Commit Bot
Comment 8
2013-09-11 09:47:25 PDT
All reviewed patches have been landed. Closing bug.
Ryosuke Niwa
Comment 9
2013-10-15 02:10:11 PDT
Looks like this may have caused 3-4% performance regression on SVG/Bamboo:Time?
https://perf.webkit.org/#mode=charts&chartList=%5B%5B%22mac-mountainlion%22%2C%22SVG%2FBamboo%3ATime%22%5D%2C%5B%22mac-lion%22%2C%22SVG%2FBamboo%3ATime%22%5D%5D&days=56
Ryosuke Niwa
Comment 10
2013-10-15 18:26:42 PDT
(In reply to
comment #9
)
> Looks like this may have caused 3-4% performance regression on SVG/Bamboo:Time? >
https://perf.webkit.org/#mode=charts&chartList=%5B%5B%22mac-mountainlion%22%2C%22SVG%2FBamboo%3ATime%22%5D%2C%5B%22mac-lion%22%2C%22SVG%2FBamboo%3ATime%22%5D%5D&days=56
Oops, this was a 3% perf. improvement!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug