CSSRule was split into CSSRule (CSSOM wrapper) and StyleRule (internal data), and keeping it lean is far less important as it's only instantiated on CSSOM API access. We should make it virtual again to make it more hackable and less error prone.
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.