[webkit-reviews] review granted: [Bug 137364] Use is<>() / downcast<>() for CSSRule subclasses : [Attachment 239152] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 2 17:20:23 PDT 2014


Benjamin Poulain <benjamin at webkit.org> has granted Chris Dumez
<cdumez at apple.com>'s request for review:
Bug 137364: Use is<>() / downcast<>() for CSSRule subclasses
https://bugs.webkit.org/show_bug.cgi?id=137364

Attachment 239152: Patch
https://bugs.webkit.org/attachment.cgi?id=239152&action=review

------- Additional Comments from Benjamin Poulain <benjamin at webkit.org>
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.


More information about the webkit-reviews mailing list