<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[177228] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/177228">177228</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-12-12 12:28:17 -0800 (Fri, 12 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use is<>() / downcast<>() for StyleRuleBase subclasses
https://bugs.webkit.org/show_bug.cgi?id=139571
Reviewed by Andreas Kling.
Use is<>() / downcast<>() for StyleRuleBase subclasses for safety and
consistency.
No new tests, no behavior change.
* css/CSSFontFaceRule.cpp:
(WebCore::CSSFontFaceRule::reattach):
* css/CSSKeyframesRule.h:
(isType):
* css/CSSPageRule.cpp:
(WebCore::CSSPageRule::reattach):
* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::reattach):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::insertRule):
* css/RuleSet.cpp:
(WebCore::RuleSet::addRegionRule):
(WebCore::RuleSet::addChildRules):
* css/StyleInvalidationAnalysis.cpp:
(WebCore::shouldDirtyAllStyle):
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::destroy):
(WebCore::StyleRuleBase::copy):
(WebCore::StyleRuleBase::createCSSOMWrapper):
* css/StyleRule.h:
(isType):
(WebCore::toStyleRule): Deleted.
* css/StyleRuleImport.h:
(isType):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parserAppendRule):
(WebCore::StyleSheetContents::wrapperInsertRule):
(WebCore::StyleSheetContents::addSubresourceStyleURLs):
(WebCore::childRulesHaveFailedOrCanceledSubresources):
* css/WebKitCSSViewportRule.cpp:
(WebCore::WebKitCSSViewportRule::reattach):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceRulecpp">trunk/Source/WebCore/css/CSSFontFaceRule.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSKeyframesRuleh">trunk/Source/WebCore/css/CSSKeyframesRule.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPageRulecpp">trunk/Source/WebCore/css/CSSPageRule.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSStyleRulecpp">trunk/Source/WebCore/css/CSSStyleRule.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSStyleSheetcpp">trunk/Source/WebCore/css/CSSStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssRuleSetcpp">trunk/Source/WebCore/css/RuleSet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleInvalidationAnalysiscpp">trunk/Source/WebCore/css/StyleInvalidationAnalysis.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleRulecpp">trunk/Source/WebCore/css/StyleRule.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleRuleh">trunk/Source/WebCore/css/StyleRule.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleRuleImporth">trunk/Source/WebCore/css/StyleRuleImport.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleSheetContentscpp">trunk/Source/WebCore/css/StyleSheetContents.cpp</a></li>
<li><a href="#trunkSourceWebCorecssWebKitCSSViewportRulecpp">trunk/Source/WebCore/css/WebKitCSSViewportRule.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/ChangeLog        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2014-12-12 Chris Dumez <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for StyleRuleBase subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=139571
+
+ Reviewed by Andreas Kling.
+
+ Use is<>() / downcast<>() for StyleRuleBase subclasses for safety and
+ consistency.
+
+ No new tests, no behavior change.
+
+ * css/CSSFontFaceRule.cpp:
+ (WebCore::CSSFontFaceRule::reattach):
+ * css/CSSKeyframesRule.h:
+ (isType):
+ * css/CSSPageRule.cpp:
+ (WebCore::CSSPageRule::reattach):
+ * css/CSSStyleRule.cpp:
+ (WebCore::CSSStyleRule::reattach):
+ * css/CSSStyleSheet.cpp:
+ (WebCore::CSSStyleSheet::insertRule):
+ * css/RuleSet.cpp:
+ (WebCore::RuleSet::addRegionRule):
+ (WebCore::RuleSet::addChildRules):
+ * css/StyleInvalidationAnalysis.cpp:
+ (WebCore::shouldDirtyAllStyle):
+ * css/StyleRule.cpp:
+ (WebCore::StyleRuleBase::destroy):
+ (WebCore::StyleRuleBase::copy):
+ (WebCore::StyleRuleBase::createCSSOMWrapper):
+ * css/StyleRule.h:
+ (isType):
+ (WebCore::toStyleRule): Deleted.
+ * css/StyleRuleImport.h:
+ (isType):
+ * css/StyleSheetContents.cpp:
+ (WebCore::StyleSheetContents::parserAppendRule):
+ (WebCore::StyleSheetContents::wrapperInsertRule):
+ (WebCore::StyleSheetContents::addSubresourceStyleURLs):
+ (WebCore::childRulesHaveFailedOrCanceledSubresources):
+ * css/WebKitCSSViewportRule.cpp:
+ (WebCore::WebKitCSSViewportRule::reattach):
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
+
</ins><span class="cx"> 2014-12-12 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> [MSE] Add support for SourceBuffer.mode.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceRule.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceRule.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/CSSFontFaceRule.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -62,8 +62,7 @@
</span><span class="cx">
</span><span class="cx"> void CSSFontFaceRule::reattach(StyleRuleBase& rule)
</span><span class="cx"> {
</span><del>- ASSERT_WITH_SECURITY_IMPLICATION(rule.isFontFaceRule());
- m_fontFaceRule = static_cast<StyleRuleFontFace&>(rule);
</del><ins>+ m_fontFaceRule = downcast<StyleRuleFontFace>(rule);
</ins><span class="cx"> if (m_propertiesCSSOMWrapper)
</span><span class="cx"> m_propertiesCSSOMWrapper->reattach(m_fontFaceRule->mutableProperties());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSKeyframesRuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSKeyframesRule.h (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSKeyframesRule.h        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/CSSKeyframesRule.h        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -101,4 +101,8 @@
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSKeyframesRule, CSSRule::KEYFRAMES_RULE)
</span><span class="cx">
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleKeyframes)
+ static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isKeyframesRule(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // CSSKeyframesRule_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPageRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPageRule.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPageRule.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/CSSPageRule.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -96,8 +96,7 @@
</span><span class="cx">
</span><span class="cx"> void CSSPageRule::reattach(StyleRuleBase& rule)
</span><span class="cx"> {
</span><del>- ASSERT_WITH_SECURITY_IMPLICATION(rule.isPageRule());
- m_pageRule = static_cast<StyleRulePage&>(rule);
</del><ins>+ m_pageRule = downcast<StyleRulePage>(rule);
</ins><span class="cx"> if (m_propertiesCSSOMWrapper)
</span><span class="cx"> m_propertiesCSSOMWrapper->reattach(m_pageRule.get().mutableProperties());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSStyleRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSStyleRule.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSStyleRule.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/CSSStyleRule.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -133,8 +133,7 @@
</span><span class="cx">
</span><span class="cx"> void CSSStyleRule::reattach(StyleRuleBase& rule)
</span><span class="cx"> {
</span><del>- ASSERT_WITH_SECURITY_IMPLICATION(rule.isStyleRule());
- m_styleRule = static_cast<StyleRule&>(rule);
</del><ins>+ m_styleRule = downcast<StyleRule>(rule);
</ins><span class="cx"> if (m_propertiesCSSOMWrapper)
</span><span class="cx"> m_propertiesCSSOMWrapper->reattach(m_styleRule->mutableProperties());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSStyleSheet.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSStyleSheet.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/CSSStyleSheet.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -300,7 +300,7 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RuleMutationScope mutationScope(this, RuleInsertion, rule->type() == StyleRuleBase::Keyframes ? static_cast<StyleRuleKeyframes*>(rule.get()) : 0);
</del><ins>+ RuleMutationScope mutationScope(this, RuleInsertion, is<StyleRuleKeyframes>(*rule) ? downcast<StyleRuleKeyframes>(rule.get()) : nullptr);
</ins><span class="cx">
</span><span class="cx"> bool success = m_contents.get().wrapperInsertRule(rule, index);
</span><span class="cx"> if (!success) {
</span></span></pre></div>
<a id="trunkSourceWebCorecssRuleSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/RuleSet.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/RuleSet.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/RuleSet.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -307,10 +307,9 @@
</span><span class="cx"> const Vector<RefPtr<StyleRuleBase>>& childRules = regionRule->childRules();
</span><span class="cx"> AddRuleFlags addRuleFlags = hasDocumentSecurityOrigin ? RuleHasDocumentSecurityOrigin : RuleHasNoSpecialState;
</span><span class="cx"> addRuleFlags = static_cast<AddRuleFlags>(addRuleFlags | RuleIsInRegionRule);
</span><del>- for (unsigned i = 0; i < childRules.size(); ++i) {
- StyleRuleBase* regionStylingRule = childRules[i].get();
- if (regionStylingRule->isStyleRule())
- regionRuleSet->addStyleRule(static_cast<StyleRule*>(regionStylingRule), addRuleFlags);
</del><ins>+ for (auto& childRule : childRules) {
+ if (is<StyleRule>(*childRule))
+ regionRuleSet->addStyleRule(downcast<StyleRule>(childRule.get()), addRuleFlags);
</ins><span class="cx"> }
</span><span class="cx"> // Update the "global" rule count so that proper order is maintained
</span><span class="cx"> m_ruleCount = regionRuleSet->m_ruleCount;
</span><span class="lines">@@ -320,35 +319,31 @@
</span><span class="cx">
</span><span class="cx"> void RuleSet::addChildRules(const Vector<RefPtr<StyleRuleBase>>& rules, const MediaQueryEvaluator& medium, StyleResolver* resolver, bool hasDocumentSecurityOrigin, AddRuleFlags addRuleFlags)
</span><span class="cx"> {
</span><del>- for (unsigned i = 0; i < rules.size(); ++i) {
- StyleRuleBase* rule = rules[i].get();
-
- if (rule->isStyleRule()) {
- StyleRule* styleRule = static_cast<StyleRule*>(rule);
- addStyleRule(styleRule, addRuleFlags);
- } else if (rule->isPageRule())
- addPageRule(static_cast<StyleRulePage*>(rule));
- else if (rule->isMediaRule()) {
- StyleRuleMedia* mediaRule = static_cast<StyleRuleMedia*>(rule);
- if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueries(), resolver)))
- addChildRules(mediaRule->childRules(), medium, resolver, hasDocumentSecurityOrigin, addRuleFlags);
- } else if (rule->isFontFaceRule() && resolver) {
</del><ins>+ for (auto& rule : rules) {
+ if (is<StyleRule>(*rule))
+ addStyleRule(downcast<StyleRule>(rule.get()), addRuleFlags);
+ else if (is<StyleRulePage>(*rule))
+ addPageRule(downcast<StyleRulePage>(rule.get()));
+ else if (is<StyleRuleMedia>(*rule)) {
+ auto& mediaRule = downcast<StyleRuleMedia>(*rule);
+ if ((!mediaRule.mediaQueries() || medium.eval(mediaRule.mediaQueries(), resolver)))
+ addChildRules(mediaRule.childRules(), medium, resolver, hasDocumentSecurityOrigin, addRuleFlags);
+ } else if (is<StyleRuleFontFace>(*rule) && resolver) {
</ins><span class="cx"> // Add this font face to our set.
</span><del>- const StyleRuleFontFace* fontFaceRule = static_cast<StyleRuleFontFace*>(rule);
- resolver->fontSelector()->addFontFaceRule(fontFaceRule);
</del><ins>+ resolver->fontSelector()->addFontFaceRule(downcast<StyleRuleFontFace>(rule.get()));
</ins><span class="cx"> resolver->invalidateMatchedPropertiesCache();
</span><del>- } else if (rule->isKeyframesRule() && resolver)
- resolver->addKeyframeStyle(static_cast<StyleRuleKeyframes*>(rule));
- else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule)->conditionIsSupported())
- addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), medium, resolver, hasDocumentSecurityOrigin, addRuleFlags);
</del><ins>+ } else if (is<StyleRuleKeyframes>(*rule) && resolver)
+ resolver->addKeyframeStyle(downcast<StyleRuleKeyframes>(rule.get()));
+ else if (is<StyleRuleSupports>(*rule) && downcast<StyleRuleSupports>(*rule).conditionIsSupported())
+ addChildRules(downcast<StyleRuleSupports>(*rule).childRules(), medium, resolver, hasDocumentSecurityOrigin, addRuleFlags);
</ins><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><del>- else if (rule->isRegionRule() && resolver) {
- addRegionRule(static_cast<StyleRuleRegion*>(rule), hasDocumentSecurityOrigin);
</del><ins>+ else if (is<StyleRuleRegion>(*rule) && resolver) {
+ addRegionRule(downcast<StyleRuleRegion>(rule.get()), hasDocumentSecurityOrigin);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><del>- else if (rule->isViewportRule() && resolver) {
- resolver->viewportStyleResolver()->addViewportRule(static_cast<StyleRuleViewport*>(rule));
</del><ins>+ else if (is<StyleRuleViewport>(*rule) && resolver) {
+ resolver->viewportStyleResolver()->addViewportRule(downcast<StyleRuleViewport>(rule.get()));
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleInvalidationAnalysiscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleInvalidationAnalysis.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleInvalidationAnalysis.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/StyleInvalidationAnalysis.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -39,13 +39,13 @@
</span><span class="cx"> static bool shouldDirtyAllStyle(const Vector<RefPtr<StyleRuleBase>>& rules)
</span><span class="cx"> {
</span><span class="cx"> for (auto& rule : rules) {
</span><del>- if (rule->isMediaRule()) {
- if (shouldDirtyAllStyle(static_cast<StyleRuleMedia&>(*rule).childRules()))
</del><ins>+ if (is<StyleRuleMedia>(*rule)) {
+ if (shouldDirtyAllStyle(downcast<StyleRuleMedia>(*rule).childRules()))
</ins><span class="cx"> return true;
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> // FIXME: At least font faces don't need full recalc in all cases.
</span><del>- if (!rule->isStyleRule())
</del><ins>+ if (!is<StyleRule>(*rule))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleRule.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleRule.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/StyleRule.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -59,34 +59,34 @@
</span><span class="cx"> {
</span><span class="cx"> switch (type()) {
</span><span class="cx"> case Style:
</span><del>- delete static_cast<StyleRule*>(this);
</del><ins>+ delete downcast<StyleRule>(this);
</ins><span class="cx"> return;
</span><span class="cx"> case Page:
</span><del>- delete static_cast<StyleRulePage*>(this);
</del><ins>+ delete downcast<StyleRulePage>(this);
</ins><span class="cx"> return;
</span><span class="cx"> case FontFace:
</span><del>- delete static_cast<StyleRuleFontFace*>(this);
</del><ins>+ delete downcast<StyleRuleFontFace>(this);
</ins><span class="cx"> return;
</span><span class="cx"> case Media:
</span><del>- delete static_cast<StyleRuleMedia*>(this);
</del><ins>+ delete downcast<StyleRuleMedia>(this);
</ins><span class="cx"> return;
</span><span class="cx"> case Supports:
</span><del>- delete static_cast<StyleRuleSupports*>(this);
</del><ins>+ delete downcast<StyleRuleSupports>(this);
</ins><span class="cx"> return;
</span><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx"> case Region:
</span><del>- delete static_cast<StyleRuleRegion*>(this);
</del><ins>+ delete downcast<StyleRuleRegion>(this);
</ins><span class="cx"> return;
</span><span class="cx"> #endif
</span><span class="cx"> case Import:
</span><del>- delete static_cast<StyleRuleImport*>(this);
</del><ins>+ delete downcast<StyleRuleImport>(this);
</ins><span class="cx"> return;
</span><span class="cx"> case Keyframes:
</span><del>- delete static_cast<StyleRuleKeyframes*>(this);
</del><ins>+ delete downcast<StyleRuleKeyframes>(this);
</ins><span class="cx"> return;
</span><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><span class="cx"> case Viewport:
</span><del>- delete static_cast<StyleRuleViewport*>(this);
</del><ins>+ delete downcast<StyleRuleViewport>(this);
</ins><span class="cx"> return;
</span><span class="cx"> #endif
</span><span class="cx"> case Unknown:
</span><span class="lines">@@ -105,24 +105,24 @@
</span><span class="cx"> {
</span><span class="cx"> switch (type()) {
</span><span class="cx"> case Style:
</span><del>- return static_cast<const StyleRule*>(this)->copy();
</del><ins>+ return downcast<StyleRule>(*this).copy();
</ins><span class="cx"> case Page:
</span><del>- return static_cast<const StyleRulePage*>(this)->copy();
</del><ins>+ return downcast<StyleRulePage>(*this).copy();
</ins><span class="cx"> case FontFace:
</span><del>- return static_cast<const StyleRuleFontFace*>(this)->copy();
</del><ins>+ return downcast<StyleRuleFontFace>(*this).copy();
</ins><span class="cx"> case Media:
</span><del>- return static_cast<const StyleRuleMedia*>(this)->copy();
</del><ins>+ return downcast<StyleRuleMedia>(*this).copy();
</ins><span class="cx"> case Supports:
</span><del>- return static_cast<const StyleRuleSupports*>(this)->copy();
</del><ins>+ return downcast<StyleRuleSupports>(*this).copy();
</ins><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx"> case Region:
</span><del>- return static_cast<const StyleRuleRegion*>(this)->copy();
</del><ins>+ return downcast<StyleRuleRegion>(*this).copy();
</ins><span class="cx"> #endif
</span><span class="cx"> case Keyframes:
</span><del>- return static_cast<const StyleRuleKeyframes*>(this)->copy();
</del><ins>+ return downcast<StyleRuleKeyframes>(*this).copy();
</ins><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><span class="cx"> case Viewport:
</span><del>- return static_cast<const StyleRuleViewport*>(this)->copy();
</del><ins>+ return downcast<StyleRuleViewport>(*this).copy();
</ins><span class="cx"> #endif
</span><span class="cx"> case Import:
</span><span class="cx"> // FIXME: Copy import rules.
</span><span class="lines">@@ -146,34 +146,34 @@
</span><span class="cx"> StyleRuleBase& self = const_cast<StyleRuleBase&>(*this);
</span><span class="cx"> switch (type()) {
</span><span class="cx"> case Style:
</span><del>- rule = CSSStyleRule::create(static_cast<StyleRule&>(self), parentSheet);
</del><ins>+ rule = CSSStyleRule::create(downcast<StyleRule>(self), parentSheet);
</ins><span class="cx"> break;
</span><span class="cx"> case Page:
</span><del>- rule = CSSPageRule::create(static_cast<StyleRulePage&>(self), parentSheet);
</del><ins>+ rule = CSSPageRule::create(downcast<StyleRulePage>(self), parentSheet);
</ins><span class="cx"> break;
</span><span class="cx"> case FontFace:
</span><del>- rule = CSSFontFaceRule::create(static_cast<StyleRuleFontFace&>(self), parentSheet);
</del><ins>+ rule = CSSFontFaceRule::create(downcast<StyleRuleFontFace>(self), parentSheet);
</ins><span class="cx"> break;
</span><span class="cx"> case Media:
</span><del>- rule = CSSMediaRule::create(static_cast<StyleRuleMedia&>(self), parentSheet);
</del><ins>+ rule = CSSMediaRule::create(downcast<StyleRuleMedia>(self), parentSheet);
</ins><span class="cx"> break;
</span><span class="cx"> case Supports:
</span><del>- rule = CSSSupportsRule::create(static_cast<StyleRuleSupports&>(self), parentSheet);
</del><ins>+ rule = CSSSupportsRule::create(downcast<StyleRuleSupports>(self), parentSheet);
</ins><span class="cx"> break;
</span><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx"> case Region:
</span><del>- rule = WebKitCSSRegionRule::create(static_cast<StyleRuleRegion&>(self), parentSheet);
</del><ins>+ rule = WebKitCSSRegionRule::create(downcast<StyleRuleRegion>(self), parentSheet);
</ins><span class="cx"> break;
</span><span class="cx"> #endif
</span><span class="cx"> case Import:
</span><del>- rule = CSSImportRule::create(static_cast<StyleRuleImport&>(self), parentSheet);
</del><ins>+ rule = CSSImportRule::create(downcast<StyleRuleImport>(self), parentSheet);
</ins><span class="cx"> break;
</span><span class="cx"> case Keyframes:
</span><del>- rule = CSSKeyframesRule::create(static_cast<StyleRuleKeyframes&>(self), parentSheet);
</del><ins>+ rule = CSSKeyframesRule::create(downcast<StyleRuleKeyframes>(self), parentSheet);
</ins><span class="cx"> break;
</span><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><span class="cx"> case Viewport:
</span><del>- rule = WebKitCSSViewportRule::create(static_cast<StyleRuleViewport&>(self), parentSheet);
</del><ins>+ rule = WebKitCSSViewportRule::create(downcast<StyleRuleViewport>(self), parentSheet);
</ins><span class="cx"> break;
</span><span class="cx"> #endif
</span><span class="cx"> case Unknown:
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> case Region:
</span><span class="cx"> #endif
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> if (parentRule)
</span><span class="cx"> rule->setParentRule(parentRule);
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleRuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleRule.h (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleRule.h        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/StyleRule.h        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -134,12 +134,6 @@
</span><span class="cx"> CSSSelectorList m_selectorList;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline const StyleRule* toStyleRule(const StyleRuleBase* rule)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isStyleRule());
- return static_cast<const StyleRule*>(rule);
-}
-
</del><span class="cx"> class StyleRuleFontFace : public StyleRuleBase {
</span><span class="cx"> public:
</span><span class="cx"> static PassRef<StyleRuleFontFace> create(PassRef<StyleProperties> properties) { return adoptRef(*new StyleRuleFontFace(WTF::move(properties))); }
</span><span class="lines">@@ -274,16 +268,34 @@
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRule)
+ static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isStyleRule(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleFontFace)
+ static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isFontFaceRule(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleMedia)
</span><del>- static bool isType(const WebCore::StyleRuleGroup& group) { return group.isMediaRule(); }
</del><ins>+ static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isMediaRule(); }
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><span class="cx">
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRulePage)
+ static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isPageRule(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleSupports)
</span><del>- static bool isType(const WebCore::StyleRuleGroup& group) { return group.isSupportsRule(); }
</del><ins>+ static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isSupportsRule(); }
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleRegion)
</span><del>- static bool isType(const WebCore::StyleRuleGroup& group) { return group.isRegionRule(); }
</del><ins>+ static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isRegionRule(); }
</ins><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><span class="cx">
</span><ins>+#if ENABLE(CSS_DEVICE_ADAPTATION)
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleViewport)
+ static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isViewportRule(); }
+SPECIALIZE_TYPE_TRAITS_END()
+#endif // ENABLE(CSS_DEVICE_ADAPTATION)
+
</ins><span class="cx"> #endif // StyleRule_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleRuleImporth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleRuleImport.h (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleRuleImport.h        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/StyleRuleImport.h        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #include "CachedResourceHandle.h"
</span><span class="cx"> #include "CachedStyleSheetClient.h"
</span><span class="cx"> #include "StyleRule.h"
</span><ins>+#include <wtf/TypeCasts.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -83,4 +84,8 @@
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleImport)
+ static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isImportRule(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleSheetContentscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleSheetContents.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -127,10 +127,10 @@
</span><span class="cx"> void StyleSheetContents::parserAppendRule(PassRefPtr<StyleRuleBase> rule)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!rule->isCharsetRule());
</span><del>- if (rule->isImportRule()) {
</del><ins>+ if (is<StyleRuleImport>(*rule)) {
</ins><span class="cx"> // Parser enforces that @import rules come before anything else except @charset.
</span><span class="cx"> ASSERT(m_childRules.isEmpty());
</span><del>- m_importRules.append(static_cast<StyleRuleImport*>(rule.get()));
</del><ins>+ m_importRules.append(downcast<StyleRuleImport>(rule.get()));
</ins><span class="cx"> m_importRules.last()->setParentStyleSheet(this);
</span><span class="cx"> m_importRules.last()->requestStyleSheet();
</span><span class="cx"> return;
</span><span class="lines">@@ -138,14 +138,14 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(RESOLUTION_MEDIA_QUERY)
</span><span class="cx"> // Add warning message to inspector if dpi/dpcm values are used for screen media.
</span><del>- if (rule->isMediaRule())
- reportMediaQueryWarningIfNeeded(singleOwnerDocument(), static_cast<StyleRuleMedia*>(rule.get())->mediaQueries());
</del><ins>+ if (is<StyleRuleMedia>(*rule))
+ reportMediaQueryWarningIfNeeded(singleOwnerDocument(), downcast<StyleRuleMedia>(*rule).mediaQueries());
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // NOTE: The selector list has to fit into RuleData. <http://webkit.org/b/118369>
</span><span class="cx"> // If we're adding a rule with a huge number of selectors, split it up into multiple rules
</span><del>- if (rule->isStyleRule() && toStyleRule(rule.get())->selectorList().componentCount() > RuleData::maximumSelectorComponentCount) {
- Vector<RefPtr<StyleRule>> rules = toStyleRule(rule.get())->splitIntoMultipleRulesWithMaximumSelectorComponentCount(RuleData::maximumSelectorComponentCount);
</del><ins>+ if (is<StyleRule>(*rule) && downcast<StyleRule>(*rule).selectorList().componentCount() > RuleData::maximumSelectorComponentCount) {
+ Vector<RefPtr<StyleRule>> rules = downcast<StyleRule>(*rule).splitIntoMultipleRulesWithMaximumSelectorComponentCount(RuleData::maximumSelectorComponentCount);
</ins><span class="cx"> m_childRules.appendVector(rules);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -221,16 +221,16 @@
</span><span class="cx">
</span><span class="cx"> if (childVectorIndex < m_importRules.size() || (childVectorIndex == m_importRules.size() && rule->isImportRule())) {
</span><span class="cx"> // Inserting non-import rule before @import is not allowed.
</span><del>- if (!rule->isImportRule())
</del><ins>+ if (!is<StyleRuleImport>(*rule))
</ins><span class="cx"> return false;
</span><del>- m_importRules.insert(childVectorIndex, static_cast<StyleRuleImport*>(rule.get()));
</del><ins>+ m_importRules.insert(childVectorIndex, downcast<StyleRuleImport>(rule.get()));
</ins><span class="cx"> m_importRules[childVectorIndex]->setParentStyleSheet(this);
</span><span class="cx"> m_importRules[childVectorIndex]->requestStyleSheet();
</span><span class="cx"> // FIXME: Stylesheet doesn't actually change meaningfully before the imported sheets are loaded.
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> // Inserting @import rule after a non-import rule is not allowed.
</span><del>- if (rule->isImportRule())
</del><ins>+ if (is<StyleRuleImport>(*rule))
</ins><span class="cx"> return false;
</span><span class="cx"> childVectorIndex -= m_importRules.size();
</span><span class="cx">
</span><span class="lines">@@ -410,42 +410,39 @@
</span><span class="cx"> while (!styleSheetQueue.isEmpty()) {
</span><span class="cx"> StyleSheetContents* styleSheet = styleSheetQueue.takeFirst();
</span><span class="cx">
</span><del>- for (unsigned i = 0; i < styleSheet->m_importRules.size(); ++i) {
- StyleRuleImport* importRule = styleSheet->m_importRules[i].get();
</del><ins>+ for (auto& importRule : styleSheet->m_importRules) {
</ins><span class="cx"> if (importRule->styleSheet()) {
</span><span class="cx"> styleSheetQueue.append(importRule->styleSheet());
</span><span class="cx"> addSubresourceURL(urls, importRule->styleSheet()->baseURL());
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- for (unsigned i = 0; i < styleSheet->m_childRules.size(); ++i) {
- StyleRuleBase* rule = styleSheet->m_childRules[i].get();
- if (rule->isStyleRule())
- static_cast<StyleRule*>(rule)->properties().addSubresourceStyleURLs(urls, this);
- else if (rule->isFontFaceRule())
- static_cast<StyleRuleFontFace*>(rule)->properties().addSubresourceStyleURLs(urls, this);
</del><ins>+ for (auto& rule : styleSheet->m_childRules) {
+ if (is<StyleRule>(*rule))
+ downcast<StyleRule>(*rule).properties().addSubresourceStyleURLs(urls, this);
+ else if (is<StyleRuleFontFace>(*rule))
+ downcast<StyleRuleFontFace>(*rule).properties().addSubresourceStyleURLs(urls, this);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static bool childRulesHaveFailedOrCanceledSubresources(const Vector<RefPtr<StyleRuleBase>>& rules)
</span><span class="cx"> {
</span><del>- for (unsigned i = 0; i < rules.size(); ++i) {
- const StyleRuleBase* rule = rules[i].get();
</del><ins>+ for (auto& rule : rules) {
</ins><span class="cx"> switch (rule->type()) {
</span><span class="cx"> case StyleRuleBase::Style:
</span><del>- if (static_cast<const StyleRule*>(rule)->properties().hasFailedOrCanceledSubresources())
</del><ins>+ if (downcast<StyleRule>(*rule).properties().hasFailedOrCanceledSubresources())
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><span class="cx"> case StyleRuleBase::FontFace:
</span><del>- if (static_cast<const StyleRuleFontFace*>(rule)->properties().hasFailedOrCanceledSubresources())
</del><ins>+ if (downcast<StyleRuleFontFace>(*rule).properties().hasFailedOrCanceledSubresources())
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><span class="cx"> case StyleRuleBase::Media:
</span><del>- if (childRulesHaveFailedOrCanceledSubresources(static_cast<const StyleRuleMedia*>(rule)->childRules()))
</del><ins>+ if (childRulesHaveFailedOrCanceledSubresources(downcast<StyleRuleMedia>(*rule).childRules()))
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><span class="cx"> case StyleRuleBase::Region:
</span><del>- if (childRulesHaveFailedOrCanceledSubresources(static_cast<const StyleRuleRegion*>(rule)->childRules()))
</del><ins>+ if (childRulesHaveFailedOrCanceledSubresources(downcast<StyleRuleRegion>(*rule).childRules()))
</ins><span class="cx"> return true;
</span><span class="cx"> break;
</span><span class="cx"> case StyleRuleBase::Import:
</span></span></pre></div>
<a id="trunkSourceWebCorecssWebKitCSSViewportRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/WebKitCSSViewportRule.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/WebKitCSSViewportRule.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/css/WebKitCSSViewportRule.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -77,8 +77,7 @@
</span><span class="cx">
</span><span class="cx"> void WebKitCSSViewportRule::reattach(StyleRuleBase& rule)
</span><span class="cx"> {
</span><del>- ASSERT_WITH_SECURITY_IMPLICATION(rule.isViewportRule());
- m_viewportRule = static_cast<StyleRuleViewport&>(rule);
</del><ins>+ m_viewportRule = downcast<StyleRuleViewport>(rule);
</ins><span class="cx">
</span><span class="cx"> if (m_propertiesCSSOMWrapper)
</span><span class="cx"> m_propertiesCSSOMWrapper->reattach(m_viewportRule->mutableProperties());
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (177227 => 177228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-12-12 20:21:04 UTC (rev 177227)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-12-12 20:28:17 UTC (rev 177228)
</span><span class="lines">@@ -1044,17 +1044,13 @@
</span><span class="cx"> SelectorChecker::CheckingContext context(SelectorChecker::Mode::CollectingRules);
</span><span class="cx"> SelectorChecker selectorChecker(element->document());
</span><span class="cx">
</span><del>- for (unsigned i = 0; i < matchedRules.size(); ++i) {
- if (!matchedRules[i]->isStyleRule())
- continue;
-
- StyleRule* matchedStyleRule = static_cast<StyleRule*>(matchedRules[i].get());
- RefPtr<Inspector::Protocol::CSS::CSSRule> ruleObject = buildObjectForRule(matchedStyleRule, styleResolver);
</del><ins>+ for (auto& matchedRule : matchedRules) {
+ RefPtr<Inspector::Protocol::CSS::CSSRule> ruleObject = buildObjectForRule(matchedRule.get(), styleResolver);
</ins><span class="cx"> if (!ruleObject)
</span><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> RefPtr<Inspector::Protocol::Array<int>> matchingSelectors = Inspector::Protocol::Array<int>::create();
</span><del>- const CSSSelectorList& selectorList = matchedStyleRule->selectorList();
</del><ins>+ const CSSSelectorList& selectorList = matchedRule->selectorList();
</ins><span class="cx"> long index = 0;
</span><span class="cx"> for (const CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(selector)) {
</span><span class="cx"> unsigned ignoredSpecificity;
</span></span></pre>
</div>
</div>
</body>
</html>