Summary: | Re-virtualize CSSRule. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||||
Component: | CSS | Assignee: | Andreas Kling <kling> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | allan.jensen, cmarcelo, eric.carlson, feature-media-reviews, koivisto, macpherson, menard, ojan, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Andreas Kling
2012-11-21 18:24:41 PST
Created attachment 175560 [details]
Patch
Created attachment 175561 [details]
Patch
Comment on attachment 175561 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175561&action=review > Source/WebCore/css/StyleResolver.cpp:2573 > - if (cssRule->isImportRule()) > + if (cssRule->type() == CSSRule::IMPORT_RULE) > collectCSSOMWrappers(wrapperMap, static_cast<CSSImportRule*>(cssRule)->styleSheet()); > - else if (cssRule->isMediaRule()) > + else if (cssRule->type() == CSSRule::MEDIA_RULE) > collectCSSOMWrappers(wrapperMap, static_cast<CSSMediaRule*>(cssRule)); > #if ENABLE(CSS_REGIONS) > - else if (cssRule->isRegionRule()) > + else if (cssRule->type() == CSSRule::WEBKIT_REGION_RULE) > collectCSSOMWrappers(wrapperMap, static_cast<WebKitCSSRegionRule*>(cssRule)); > #endif > - else if (cssRule->isStyleRule()) { > + else if (cssRule->type() == CSSRule::STYLE_RULE) { > CSSStyleRule* cssStyleRule = static_cast<CSSStyleRule*>(cssRule); > wrapperMap.add(cssStyleRule->styleRule(), cssStyleRule); > } This looks like it should be a switch statement instead. Committed r135465: <http://trac.webkit.org/changeset/135465> Comment on attachment 175560 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175560&action=review > Source/WebCore/css/CSSStyleRule.cpp:129 > + ASSERT(rule->isStyleRule()); > + m_styleRule = static_cast<StyleRule*>(rule); Would be good to add asStyleFooRule() casting functions at some point. |