WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
137364
Use is<>() / downcast<>() for CSSRule subclasses
https://bugs.webkit.org/show_bug.cgi?id=137364
Summary
Use is<>() / downcast<>() for CSSRule subclasses
Chris Dumez
Reported
2014-10-02 15:37:06 PDT
Use is<>() / downcast<>() for CSSRule subclasses
Attachments
Patch
(13.06 KB, patch)
2014-10-02 16:23 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(14.79 KB, patch)
2014-10-02 17:33 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(15.50 KB, patch)
2014-10-02 18:03 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2014-10-02 16:23:03 PDT
Created
attachment 239152
[details]
Patch
Benjamin Poulain
Comment 2
2014-10-02 17:20:22 PDT
Comment on
attachment 239152
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=239152&action=review
> Source/WebCore/css/CSSFontFaceRule.h:54 > +SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSFontFaceRule, FONT_FACE_RULE)
I would prefere CSSRule::FONT_FACE_RULE over FONT_FACE_RULE. A little more typing but I like that we follow the scope.
> Source/WebCore/css/InspectorCSSOMWrappers.cpp:64 > + collect(downcast<CSSMediaRule>(cssRule));
cssRule is not null, shouldn't you use &downcast<CSSMediaRule>(*cssRule)) by you own rules?
> Source/WebCore/css/InspectorCSSOMWrappers.cpp:68 > - collect(toCSSSupportsRule(cssRule)); > + collect(downcast<CSSSupportsRule>(cssRule));
ditto
> Source/WebCore/css/InspectorCSSOMWrappers.cpp:73 > - collect(toWebKitCSSRegionRule(cssRule)); > + collect(downcast<WebKitCSSRegionRule>(cssRule));
ditto
> Source/WebCore/inspector/InspectorCSSAgent.cpp:432 > CSSStyleRule* InspectorCSSAgent::asCSSStyleRule(CSSRule* rule) > { > - if (rule->type() != CSSRule::STYLE_RULE) > + ASSERT(rule);
It would be nice to fix the call site to pass a CSSRule&, then remove the assertion.
Chris Dumez
Comment 3
2014-10-02 17:24:19 PDT
Comment on
attachment 239152
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=239152&action=review
>> Source/WebCore/css/CSSFontFaceRule.h:54 >> +SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSFontFaceRule, FONT_FACE_RULE) > > I would prefere CSSRule::FONT_FACE_RULE over FONT_FACE_RULE. A little more typing but I like that we follow the scope.
Hmm, I already went the other way for
http://trac.webkit.org/changeset/174236/trunk/Source/WebCore/css/CSSBasicShapes.h
But why not.
>> Source/WebCore/css/InspectorCSSOMWrappers.cpp:64 >> + collect(downcast<CSSMediaRule>(cssRule)); > > cssRule is not null, shouldn't you use &downcast<CSSMediaRule>(*cssRule)) by you own rules?
I think you are confusing with is<>(). There is no null check in the downcast<>().
>> Source/WebCore/inspector/InspectorCSSAgent.cpp:432 >> + ASSERT(rule); > > It would be nice to fix the call site to pass a CSSRule&, then remove the assertion.
I hesitated :) Ok, will do it.
Chris Dumez
Comment 4
2014-10-02 17:33:49 PDT
Created
attachment 239163
[details]
Patch
Chris Dumez
Comment 5
2014-10-02 18:03:08 PDT
Created
attachment 239167
[details]
Patch
WebKit Commit Bot
Comment 6
2014-10-02 18:40:21 PDT
Comment on
attachment 239167
[details]
Patch Clearing flags on attachment: 239167 Committed
r174253
: <
http://trac.webkit.org/changeset/174253
>
WebKit Commit Bot
Comment 7
2014-10-02 18:40:26 PDT
All reviewed patches have been landed. Closing bug.
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