<!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>[178767] trunk</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/178767">178767</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-01-20 16:30:36 -0800 (Tue, 20 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Should show dynamic specificity values
https://bugs.webkit.org/show_bug.cgi?id=140647

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2015-01-20
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

* inspector/protocol/CSS.json:
Clarify CSSSelector optional values and add &quot;dynamic&quot; property indicating
if the selector can be dynamic based on the element it is matched against.

Source/WebCore:

Test: inspector/css/selector-dynamic-specificity.html

* inspector/InspectorCSSAgent.h:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::addRule):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
When building a response for a particular element, pass the element along.

* inspector/InspectorStyleSheet.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::hasDynamicSpecificity):
(WebCore::buildObjectForSelectorHelper):
(WebCore::selectorsFromSource):
(WebCore::InspectorStyleSheet::buildObjectForSelector):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
(WebCore::InspectorStyleSheet::buildObjectForRule):
(WebCore::InspectorStyleSheet::buildArrayForRuleList):
(WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
When building a response for a Selector, include the specificity if we know
the element in context.

Source/WebInspectorUI:

For dynamic selectors, provide text in the tooltip describing that the
specificity is dynamic and may change, and pointing out the element
the current value was calculated against.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/CSSSelector.js:
(WebInspector.CSSSelector):
(WebInspector.CSSSelector.prototype.get specificity):
(WebInspector.CSSSelector.prototype.get dynamic):
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype._parseSelectorListPayload.return):
(WebInspector.DOMNodeStyles.prototype._parseSelectorListPayload):
* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype.refresh.appendSelector):

LayoutTests:

* inspector/css/selector-dynamic-specificity-expected.txt: Added.
* inspector/css/selector-dynamic-specificity.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolCSSjson">trunk/Source/JavaScriptCore/inspector/protocol/CSS.json</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgenth">trunk/Source/WebCore/inspector/InspectorCSSAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleSheetcpp">trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleSheeth">trunk/Source/WebCore/inspector/InspectorStyleSheet.h</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSSelectorjs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSSelector.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMNodeStylesjs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorcssselectordynamicspecificityexpectedtxt">trunk/LayoutTests/inspector/css/selector-dynamic-specificity-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorcssselectordynamicspecificityhtml">trunk/LayoutTests/inspector/css/selector-dynamic-specificity.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/LayoutTests/ChangeLog        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-01-20  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Should show dynamic specificity values
+        https://bugs.webkit.org/show_bug.cgi?id=140647
+
+        Reviewed by Benjamin Poulain.
+
+        * inspector/css/selector-dynamic-specificity-expected.txt: Added.
+        * inspector/css/selector-dynamic-specificity.html: Added.
+
</ins><span class="cx"> 2015-01-20  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         http/tests/xmlhttprequest/xmlhttprequest-responseURL.html uses an incorrect resource path
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorcssselectordynamicspecificityexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/css/selector-dynamic-specificity-expected.txt (0 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/css/selector-dynamic-specificity-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/css/selector-dynamic-specificity-expected.txt        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+Testing that dynamic selectors have expected specificity values depending on the context node.
+
+
+p - :matches(div, article) (0, 0, 1) (dynamic)
+p - :matches(div, .foo, #bar, div#bar) (no value) (dynamic)
+p - div:nth-child(odd) (0, 1, 1)
+p - :nth-child(odd of div) (0, 1, 1) (dynamic)
+p - :nth-child(odd of div, .foo, #bar, div#bar) (no value) (dynamic)
+p - :nth-child(even of div, .foo, #bar, div#bar) (no value) (dynamic)
+p - :not(span, #missing) (1, 0, 0)
+p - :not(:not(:matches(div, .foo, #bar, div#bar))) (1, 0, 1)
+
+div - :matches(div, article) (0, 0, 1) (dynamic)
+div - :matches(div, .foo, #bar, div#bar) (0, 0, 1) (dynamic)
+div - div:nth-child(odd) (0, 1, 1)
+div - :nth-child(odd of div) (0, 1, 1) (dynamic)
+div - :nth-child(odd of div, .foo, #bar, div#bar) (0, 1, 1) (dynamic)
+div - :nth-child(even of div, .foo, #bar, div#bar) (no value) (dynamic)
+div - :not(span, #missing) (1, 0, 0)
+div - :not(:not(:matches(div, .foo, #bar, div#bar))) (1, 0, 1)
+
+.foo - :matches(div, article) (0, 0, 1) (dynamic)
+.foo - :matches(div, .foo, #bar, div#bar) (0, 1, 0) (dynamic)
+.foo - div:nth-child(odd) (0, 1, 1)
+.foo - :nth-child(odd of div) (0, 1, 1) (dynamic)
+.foo - :nth-child(odd of div, .foo, #bar, div#bar) (no value) (dynamic)
+.foo - :nth-child(even of div, .foo, #bar, div#bar) (0, 2, 0) (dynamic)
+.foo - :not(span, #missing) (1, 0, 0)
+.foo - :not(:not(:matches(div, .foo, #bar, div#bar))) (1, 0, 1)
+
+#bar - :matches(div, article) (0, 0, 1) (dynamic)
+#bar - :matches(div, .foo, #bar, div#bar) (1, 0, 1) (dynamic)
+#bar - div:nth-child(odd) (0, 1, 1)
+#bar - :nth-child(odd of div) (0, 1, 1) (dynamic)
+#bar - :nth-child(odd of div, .foo, #bar, div#bar) (1, 1, 1) (dynamic)
+#bar - :nth-child(even of div, .foo, #bar, div#bar) (no value) (dynamic)
+#bar - :not(span, #missing) (1, 0, 0)
+#bar - :not(:not(:matches(div, .foo, #bar, div#bar))) (1, 0, 1)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorcssselectordynamicspecificityhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/css/selector-dynamic-specificity.html (0 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/css/selector-dynamic-specificity.html                                (rev 0)
+++ trunk/LayoutTests/inspector/css/selector-dynamic-specificity.html        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+:matches(div, article),                         /* dynamic, but statically always the same */
+:matches(div, .foo, #bar, div#bar),             /* dynamic, changing based on matched element */
+div:nth-child(odd),                             /* static, no selector list */
+:nth-child(odd of div),                         /* dynamic, but statically always the same */
+:nth-child(odd of div, .foo, #bar, div#bar),    /* dynamic, changing based on matched element */
+:nth-child(even of div, .foo, #bar, div#bar),   /* dynamic, changing based on matched element */
+:not(span, #missing),                           /* static, maximum in list */
+:not(:not(:matches(div, .foo, #bar, div#bar))), /* static, matches() inside not() is maximized */
+* /* ignored */
+{
+    color: green;
+}
+&lt;/style&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    var nodeStyles;
+    var documentNode;
+
+    var currentSelector = null;
+    var currentStepIndex = 0;
+    var steps = [&quot;p&quot;, &quot;div&quot;, &quot;.foo&quot;, &quot;#bar&quot;];
+
+    function validateSelectors()
+    {
+        InspectorTest.log(&quot;&quot;);
+
+        var seenRules = [];
+
+        for (var i = 0; i &lt; nodeStyles.matchedRules.length; ++i) {
+            var rule = nodeStyles.matchedRules[i];
+            if (rule.type !== WebInspector.CSSRule.Type.Author)
+                continue;
+
+            if (seenRules.some(function(r) { return r.isEqualTo(rule); }))
+                continue;
+            seenRules.push(rule);
+
+            for (var selector of rule.selectors) {
+                if (selector.text === &quot;*&quot;)
+                    continue;
+
+                var output = currentSelector + &quot; - &quot; + selector.text;
+                output += selector.specificity ? &quot; (&quot; + selector.specificity.join(&quot;, &quot;) + &quot;)&quot; : &quot; (no value)&quot;;
+                if (selector.dynamic)
+                    output += &quot; (dynamic)&quot;;
+                InspectorTest.log(output);
+            }
+        }
+
+        runNextStep();
+    }
+
+    function onStylesRefreshed()
+    {
+        nodeStyles.removeEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, onStylesRefreshed, this);
+        validateSelectors();
+    }
+
+    function runNextStep()
+    {
+        if (currentStepIndex &gt;= steps.length) {
+            InspectorTest.completeTest();
+            return;
+        }
+
+        currentSelector = steps[currentStepIndex++];
+        WebInspector.domTreeManager.querySelector(documentNode.id, currentSelector, function(contentNodeId) {
+            if (contentNodeId) {
+                var domNode = WebInspector.domTreeManager.nodeForId(contentNodeId);
+                nodeStyles = WebInspector.cssStyleManager.stylesForNode(domNode);
+
+                if (nodeStyles.needsRefresh)
+                    nodeStyles.addEventListener(WebInspector.DOMNodeStyles.Event.Refreshed, onStylesRefreshed, this);
+                else
+                    validateSelectors();
+            } else {
+                InspectorTest.log(&quot;DOM node not found.&quot;);
+                InspectorTest.completeTest();
+            }
+        });
+    }
+
+    WebInspector.domTreeManager.requestDocument(function(node) {
+        documentNode = node;
+        runNextStep();
+    });
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Testing that dynamic selectors have expected specificity values depending on the context node.&lt;/p&gt;
+
+    &lt;div&gt;&lt;/div&gt;
+    &lt;div class=&quot;foo&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;bar&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-01-20  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Should show dynamic specificity values
+        https://bugs.webkit.org/show_bug.cgi?id=140647
+
+        Reviewed by Benjamin Poulain.
+
+        * inspector/protocol/CSS.json:
+        Clarify CSSSelector optional values and add &quot;dynamic&quot; property indicating
+        if the selector can be dynamic based on the element it is matched against.
+
</ins><span class="cx"> 2015-01-20  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r178751.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolCSSjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/CSS.json (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/CSS.json        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/JavaScriptCore/inspector/protocol/CSS.json        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -63,7 +63,8 @@
</span><span class="cx">             &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">             &quot;properties&quot;: [
</span><span class="cx">                 { &quot;name&quot;: &quot;text&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Canonicalized selector text.&quot; },
</span><del>-                { &quot;name&quot;: &quot;specificity&quot;, &quot;optional&quot;: true, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;type&quot;: &quot;integer&quot; }, &quot;description&quot;: &quot;Specificity (a, b, c) tuple. If missing the specificity is not known statically and may be dynamic.&quot; }
</del><ins>+                { &quot;name&quot;: &quot;specificity&quot;, &quot;optional&quot;: true, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;type&quot;: &quot;integer&quot; }, &quot;description&quot;: &quot;Specificity (a, b, c) tuple. Included if the selector is sent in response to CSS.getMatchedStylesForNode which provides a context element.&quot; },
+                { &quot;name&quot;: &quot;dynamic&quot;, &quot;optional&quot;: true, &quot;type&quot;: &quot;boolean&quot;, &quot;description&quot;: &quot;Whether or not the specificity can be dynamic. Included if the selector is sent in response to CSS.getMatchedStylesForNode which provides a context element.&quot; }
</ins><span class="cx">             ],
</span><span class="cx">             &quot;description&quot;: &quot;CSS selector.&quot;
</span><span class="cx">         },
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebCore/ChangeLog        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2015-01-20  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Should show dynamic specificity values
+        https://bugs.webkit.org/show_bug.cgi?id=140647
+
+        Reviewed by Benjamin Poulain.
+
+        Test: inspector/css/selector-dynamic-specificity.html
+
+        * inspector/InspectorCSSAgent.h:
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::setRuleSelector):
+        (WebCore::InspectorCSSAgent::addRule):
+        (WebCore::InspectorCSSAgent::buildObjectForRule):
+        (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
+        When building a response for a particular element, pass the element along.
+
+        * inspector/InspectorStyleSheet.h:
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::hasDynamicSpecificity):
+        (WebCore::buildObjectForSelectorHelper):
+        (WebCore::selectorsFromSource):
+        (WebCore::InspectorStyleSheet::buildObjectForSelector):
+        (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
+        (WebCore::InspectorStyleSheet::buildObjectForRule):
+        (WebCore::InspectorStyleSheet::buildArrayForRuleList):
+        (WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
+        When building a response for a Selector, include the specificity if we know
+        the element in context.
+
</ins><span class="cx"> 2015-01-20  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Build fix after r178760.
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -781,7 +781,7 @@
</span><span class="cx">     bool success = m_domAgent-&gt;history()-&gt;perform(std::make_unique&lt;SetRuleSelectorAction&gt;(inspectorStyleSheet, compoundId, selector), ec);
</span><span class="cx"> 
</span><span class="cx">     if (success)
</span><del>-        result = inspectorStyleSheet-&gt;buildObjectForRule(inspectorStyleSheet-&gt;ruleForId(compoundId));
</del><ins>+        result = inspectorStyleSheet-&gt;buildObjectForRule(inspectorStyleSheet-&gt;ruleForId(compoundId), nullptr);
</ins><span class="cx">     errorString = InspectorDOMAgent::toErrorString(ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -808,7 +808,7 @@
</span><span class="cx"> 
</span><span class="cx">     InspectorCSSId ruleId = rawAction-&gt;newRuleId();
</span><span class="cx">     CSSStyleRule* rule = inspectorStyleSheet-&gt;ruleForId(ruleId);
</span><del>-    result = inspectorStyleSheet-&gt;buildObjectForRule(rule);
</del><ins>+    result = inspectorStyleSheet-&gt;buildObjectForRule(rule, nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorCSSAgent::getSupportedCSSProperties(ErrorString&amp;, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::CSS::CSSPropertyInfo&gt;&gt;&amp; cssProperties)
</span><span class="lines">@@ -1016,7 +1016,7 @@
</span><span class="cx">     return origin;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; InspectorCSSAgent::buildObjectForRule(StyleRule* styleRule, StyleResolver&amp; styleResolver)
</del><ins>+RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; InspectorCSSAgent::buildObjectForRule(StyleRule* styleRule, StyleResolver&amp; styleResolver, Element* element)
</ins><span class="cx"> {
</span><span class="cx">     if (!styleRule)
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -1027,7 +1027,7 @@
</span><span class="cx">     if (!cssomWrapper)
</span><span class="cx">         return nullptr;
</span><span class="cx">     InspectorStyleSheet* inspectorStyleSheet = bindStyleSheet(cssomWrapper-&gt;parentStyleSheet());
</span><del>-    return inspectorStyleSheet ? inspectorStyleSheet-&gt;buildObjectForRule(cssomWrapper) : nullptr;
</del><ins>+    return inspectorStyleSheet ? inspectorStyleSheet-&gt;buildObjectForRule(cssomWrapper, element) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; InspectorCSSAgent::buildObjectForRule(CSSStyleRule* rule)
</span><span class="lines">@@ -1037,7 +1037,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(rule-&gt;parentStyleSheet());
</span><span class="cx">     InspectorStyleSheet* inspectorStyleSheet = bindStyleSheet(rule-&gt;parentStyleSheet());
</span><del>-    return inspectorStyleSheet ? inspectorStyleSheet-&gt;buildObjectForRule(rule) : nullptr;
</del><ins>+    return inspectorStyleSheet ? inspectorStyleSheet-&gt;buildObjectForRule(rule, nullptr) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::CSS::RuleMatch&gt;&gt; InspectorCSSAgent::buildArrayForMatchedRuleList(const Vector&lt;RefPtr&lt;StyleRule&gt;&gt;&amp; matchedRules, StyleResolver&amp; styleResolver, Element* element)
</span><span class="lines">@@ -1048,7 +1048,7 @@
</span><span class="cx">     SelectorChecker selectorChecker(element-&gt;document());
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; matchedRule : matchedRules) {
</span><del>-        RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; ruleObject = buildObjectForRule(matchedRule.get(), styleResolver);
</del><ins>+        RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; ruleObject = buildObjectForRule(matchedRule.get(), styleResolver, element);
</ins><span class="cx">         if (!ruleObject)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.h (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.h        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.h        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">     InspectorStyleSheet* assertStyleSheetForId(ErrorString&amp;, const String&amp;);
</span><span class="cx">     Inspector::Protocol::CSS::StyleSheetOrigin detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; buildObjectForRule(StyleRule*, StyleResolver&amp;);
</del><ins>+    RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; buildObjectForRule(StyleRule*, StyleResolver&amp;, Element*);
</ins><span class="cx">     RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; buildObjectForRule(CSSStyleRule*);
</span><span class="cx">     RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::CSS::RuleMatch&gt;&gt; buildArrayForMatchedRuleList(const Vector&lt;RefPtr&lt;StyleRule&gt;&gt;&amp;, StyleResolver&amp;, Element*);
</span><span class="cx">     RefPtr&lt;Inspector::Protocol::CSS::CSSStyle&gt; buildObjectForAttributesStyle(Element*);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -996,27 +996,58 @@
</span><span class="cx">         .release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Ref&lt;Inspector::Protocol::CSS::CSSSelector&gt; buildObjectForSelectorHelper(const String&amp; selectorText, const CSSSelector&amp; selector)
</del><ins>+static bool hasDynamicSpecificity(const CSSSelector&amp; simpleSelector)
</ins><span class="cx"> {
</span><ins>+    // It is possible that these can have a static specificity if each selector in the list has
+    // equal specificity, but lets always report that they can be dynamic.
+    for (const CSSSelector* selector = &amp;simpleSelector; selector; selector = selector-&gt;tagHistory()) {
+        if (selector-&gt;match() == CSSSelector::PseudoClass) {
+            CSSSelector::PseudoClassType pseudoClassType = selector-&gt;pseudoClassType();
+            if (pseudoClassType == CSSSelector::PseudoClassMatches)
+                return true;
+            if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild) {
+                if (selector-&gt;selectorList())
+                    return true;
+                return false;
+            }
+        }
+    }
+
+    return false;
+}
+
+static Ref&lt;Inspector::Protocol::CSS::CSSSelector&gt; buildObjectForSelectorHelper(const String&amp; selectorText, const CSSSelector&amp; selector, Element* element)
+{
</ins><span class="cx">     auto inspectorSelector = Inspector::Protocol::CSS::CSSSelector::create()
</span><span class="cx">         .setText(selectorText)
</span><span class="cx">         .release();
</span><span class="cx"> 
</span><del>-    bool ok;
-    unsigned specificity = selector.staticSpecificity(ok);
</del><ins>+    if (element) {
+        bool dynamic = hasDynamicSpecificity(selector);
+        if (dynamic)
+            inspectorSelector-&gt;setDynamic(true);
</ins><span class="cx"> 
</span><del>-    if (ok) {
-        auto tuple = Inspector::Protocol::Array&lt;int&gt;::create();
-        tuple-&gt;addItem(static_cast&lt;int&gt;((specificity &amp; CSSSelector::idMask) &gt;&gt; 16));
-        tuple-&gt;addItem(static_cast&lt;int&gt;((specificity &amp; CSSSelector::classMask) &gt;&gt; 8));
-        tuple-&gt;addItem(static_cast&lt;int&gt;(specificity &amp; CSSSelector::elementMask));
-        inspectorSelector-&gt;setSpecificity(WTF::move(tuple));
</del><ins>+        SelectorChecker::CheckingContext context(SelectorChecker::Mode::CollectingRules);
+        SelectorChecker selectorChecker(element-&gt;document());
+
+        unsigned specificity;
+        bool okay = selectorChecker.match(&amp;selector, element, context, specificity);
+        if (!okay)
+            specificity = selector.staticSpecificity(okay);
+
+        if (okay) {
+            auto tuple = Inspector::Protocol::Array&lt;int&gt;::create();
+            tuple-&gt;addItem(static_cast&lt;int&gt;((specificity &amp; CSSSelector::idMask) &gt;&gt; 16));
+            tuple-&gt;addItem(static_cast&lt;int&gt;((specificity &amp; CSSSelector::classMask) &gt;&gt; 8));
+            tuple-&gt;addItem(static_cast&lt;int&gt;(specificity &amp; CSSSelector::elementMask));
+            inspectorSelector-&gt;setSpecificity(WTF::move(tuple));
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return WTF::move(inspectorSelector);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Ref&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::CSS::CSSSelector&gt;&gt; selectorsFromSource(const CSSRuleSourceData* sourceData, const String&amp; sheetText, const CSSSelectorList&amp; selectorList)
</del><ins>+static Ref&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::CSS::CSSSelector&gt;&gt; selectorsFromSource(const CSSRuleSourceData* sourceData, const String&amp; sheetText, const CSSSelectorList&amp; selectorList, Element* element)
</ins><span class="cx"> {
</span><span class="cx">     DEPRECATED_DEFINE_STATIC_LOCAL(JSC::Yarr::RegularExpression, comment, (&quot;/\\*[^]*?\\*/&quot;, TextCaseSensitive, JSC::Yarr::MultilineEnabled));
</span><span class="cx"> 
</span><span class="lines">@@ -1029,19 +1060,19 @@
</span><span class="cx"> 
</span><span class="cx">         // We don't want to see any comments in the selector components, only the meaningful parts.
</span><span class="cx">         replace(selectorText, comment, String());
</span><del>-        result-&gt;addItem(buildObjectForSelectorHelper(selectorText.stripWhiteSpace(), *selector));
</del><ins>+        result-&gt;addItem(buildObjectForSelectorHelper(selectorText.stripWhiteSpace(), *selector, element));
</ins><span class="cx"> 
</span><span class="cx">         selector = CSSSelectorList::next(selector);
</span><span class="cx">     }
</span><span class="cx">     return WTF::move(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;Inspector::Protocol::CSS::CSSSelector&gt; InspectorStyleSheet::buildObjectForSelector(const CSSSelector* selector)
</del><ins>+Ref&lt;Inspector::Protocol::CSS::CSSSelector&gt; InspectorStyleSheet::buildObjectForSelector(const CSSSelector* selector, Element* element)
</ins><span class="cx"> {
</span><del>-    return buildObjectForSelectorHelper(selector-&gt;selectorText(), *selector);
</del><ins>+    return buildObjectForSelectorHelper(selector-&gt;selectorText(), *selector, element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;Inspector::Protocol::CSS::SelectorList&gt; InspectorStyleSheet::buildObjectForSelectorList(CSSStyleRule* rule)
</del><ins>+Ref&lt;Inspector::Protocol::CSS::SelectorList&gt; InspectorStyleSheet::buildObjectForSelectorList(CSSStyleRule* rule, Element* element)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSRuleSourceData&gt; sourceData;
</span><span class="cx">     if (ensureParsedDataReady())
</span><span class="lines">@@ -1052,12 +1083,12 @@
</span><span class="cx">     String selectorText = rule-&gt;selectorText();
</span><span class="cx"> 
</span><span class="cx">     if (sourceData)
</span><del>-        selectors = selectorsFromSource(sourceData.get(), m_parsedStyleSheet-&gt;text(), rule-&gt;styleRule().selectorList());
</del><ins>+        selectors = selectorsFromSource(sourceData.get(), m_parsedStyleSheet-&gt;text(), rule-&gt;styleRule().selectorList(), element);
</ins><span class="cx">     else {
</span><span class="cx">         selectors = Inspector::Protocol::Array&lt;Inspector::Protocol::CSS::CSSSelector&gt;::create();
</span><span class="cx">         const CSSSelectorList&amp; selectorList = rule-&gt;styleRule().selectorList();
</span><span class="cx">         for (const CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(selector))
</span><del>-            selectors-&gt;addItem(buildObjectForSelector(selector));
</del><ins>+            selectors-&gt;addItem(buildObjectForSelector(selector, element));
</ins><span class="cx">     }
</span><span class="cx">     auto result = Inspector::Protocol::CSS::SelectorList::create()
</span><span class="cx">         .setSelectors(selectors.release())
</span><span class="lines">@@ -1068,14 +1099,14 @@
</span><span class="cx">     return WTF::move(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; InspectorStyleSheet::buildObjectForRule(CSSStyleRule* rule)
</del><ins>+RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; InspectorStyleSheet::buildObjectForRule(CSSStyleRule* rule, Element* element)
</ins><span class="cx"> {
</span><span class="cx">     CSSStyleSheet* styleSheet = pageStyleSheet();
</span><span class="cx">     if (!styleSheet)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     auto result = Inspector::Protocol::CSS::CSSRule::create()
</span><del>-        .setSelectorList(buildObjectForSelectorList(rule))
</del><ins>+        .setSelectorList(buildObjectForSelectorList(rule, element))
</ins><span class="cx">         .setSourceLine(rule-&gt;styleRule().sourceLine())
</span><span class="cx">         .setOrigin(m_origin)
</span><span class="cx">         .setStyle(buildObjectForStyle(&amp;rule-&gt;style()))
</span><span class="lines">@@ -1435,7 +1466,7 @@
</span><span class="cx">     collectFlatRules(WTF::move(refRuleList), &amp;rules);
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0, size = rules.size(); i &lt; size; ++i)
</span><del>-        result-&gt;addItem(buildObjectForRule(rules.at(i).get()));
</del><ins>+        result-&gt;addItem(buildObjectForRule(rules.at(i).get(), nullptr));
</ins><span class="cx"> 
</span><span class="cx">     return WTF::move(result);
</span><span class="cx"> }
</span><span class="lines">@@ -1464,7 +1495,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(InspectorPageAgent* pageAgent, const String&amp; id, RefPtr&lt;Element&gt;&amp;&amp; element, Inspector::Protocol::CSS::StyleSheetOrigin origin, Listener* listener)
</span><del>-    : InspectorStyleSheet(pageAgent, id, nullptr, origin, &quot;&quot;, listener)
</del><ins>+    : InspectorStyleSheet(pageAgent, id, nullptr, origin, String(), listener)
</ins><span class="cx">     , m_element(WTF::move(element))
</span><span class="cx">     , m_ruleSourceData(nullptr)
</span><span class="cx">     , m_isStyleTextValid(false)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleSheeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.h (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleSheet.h        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.h        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -50,7 +50,6 @@
</span><span class="cx"> class Element;
</span><span class="cx"> class InspectorPageAgent;
</span><span class="cx"> class InspectorStyleSheet;
</span><del>-class Node;
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx"> 
</span><span class="lines">@@ -194,7 +193,7 @@
</span><span class="cx">     CSSStyleRule* ruleForId(const InspectorCSSId&amp;) const;
</span><span class="cx">     RefPtr&lt;Inspector::Protocol::CSS::CSSStyleSheetBody&gt; buildObjectForStyleSheet();
</span><span class="cx">     RefPtr&lt;Inspector::Protocol::CSS::CSSStyleSheetHeader&gt; buildObjectForStyleSheetInfo();
</span><del>-    RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; buildObjectForRule(CSSStyleRule*);
</del><ins>+    RefPtr&lt;Inspector::Protocol::CSS::CSSRule&gt; buildObjectForRule(CSSStyleRule*, Element*);
</ins><span class="cx">     RefPtr&lt;Inspector::Protocol::CSS::CSSStyle&gt; buildObjectForStyle(CSSStyleDeclaration*);
</span><span class="cx">     bool setStyleText(const InspectorCSSId&amp;, const String&amp; text, String* oldText, ExceptionCode&amp;);
</span><span class="cx">     bool setPropertyText(const InspectorCSSId&amp;, unsigned propertyIndex, const String&amp; text, bool overwrite, String* oldPropertyText, ExceptionCode&amp;);
</span><span class="lines">@@ -239,8 +238,8 @@
</span><span class="cx">     bool resourceStyleSheetText(String* result) const;
</span><span class="cx">     bool inlineStyleSheetText(String* result) const;
</span><span class="cx">     Ref&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::CSS::CSSRule&gt;&gt; buildArrayForRuleList(CSSRuleList*);
</span><del>-    Ref&lt;Inspector::Protocol::CSS::CSSSelector&gt; buildObjectForSelector(const CSSSelector*);
-    Ref&lt;Inspector::Protocol::CSS::SelectorList&gt; buildObjectForSelectorList(CSSStyleRule*);
</del><ins>+    Ref&lt;Inspector::Protocol::CSS::CSSSelector&gt; buildObjectForSelector(const CSSSelector*, Element*);
+    Ref&lt;Inspector::Protocol::CSS::SelectorList&gt; buildObjectForSelectorList(CSSStyleRule*, Element*);
</ins><span class="cx"> 
</span><span class="cx">     InspectorPageAgent* m_pageAgent;
</span><span class="cx">     String m_id;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-01-20  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Should show dynamic specificity values
+        https://bugs.webkit.org/show_bug.cgi?id=140647
+
+        Reviewed by Benjamin Poulain.
+
+        For dynamic selectors, provide text in the tooltip describing that the
+        specificity is dynamic and may change, and pointing out the element
+        the current value was calculated against.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Models/CSSSelector.js:
+        (WebInspector.CSSSelector):
+        (WebInspector.CSSSelector.prototype.get specificity):
+        (WebInspector.CSSSelector.prototype.get dynamic):
+        * UserInterface/Models/DOMNodeStyles.js:
+        (WebInspector.DOMNodeStyles.prototype._parseSelectorListPayload.return):
+        (WebInspector.DOMNodeStyles.prototype._parseSelectorListPayload):
+        * UserInterface/Views/CSSStyleDeclarationSection.js:
+        (WebInspector.CSSStyleDeclarationSection.prototype.refresh.appendSelector):
+
</ins><span class="cx"> 2015-01-19  Saam Barati  &lt;saambarati1@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Provide a front end for JSC's Control Flow Profiler
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -148,6 +148,9 @@
</span><span class="cx"> localizedStrings[&quot;Done&quot;] = &quot;Done&quot;;
</span><span class="cx"> localizedStrings[&quot;Download Web Archive&quot;] = &quot;Download Web Archive&quot;;
</span><span class="cx"> localizedStrings[&quot;Duration&quot;] = &quot;Duration&quot;;
</span><ins>+localizedStrings[&quot;Dynamically calculated for the parent element&quot;] = &quot;Dynamically calculated for the parent element&quot;;
+localizedStrings[&quot;Dynamically calculated for the selected element&quot;] = &quot;Dynamically calculated for the selected element&quot;;
+localizedStrings[&quot;Dynamically calculated for the selected element and did not match&quot;] = &quot;Dynamically calculated for the selected element and did not match&quot;;
</ins><span class="cx"> localizedStrings[&quot;Edit Attribute&quot;] = &quot;Edit Attribute&quot;;
</span><span class="cx"> localizedStrings[&quot;Edit Breakpoint &amp;&quot;] = &quot;Edit Breakpoint &amp;&quot;;
</span><span class="cx"> localizedStrings[&quot;Edit Text&quot;] = &quot;Edit Text&quot;;
</span><span class="lines">@@ -411,6 +414,7 @@
</span><span class="cx"> localizedStrings[&quot;Sockets&quot;] = &quot;Sockets&quot;;
</span><span class="cx"> localizedStrings[&quot;Source Code&quot;] = &quot;Source Code&quot;;
</span><span class="cx"> localizedStrings[&quot;Specificity: (%d, %d, %d) &quot;H %d&quot;] = &quot;Specificity: (%d, %d, %d) &quot;H %d&quot;;
</span><ins>+localizedStrings[&quot;Specificity: No value for selected element&quot;] = &quot;Specificity: No value for selected element&quot;;
</ins><span class="cx"> localizedStrings[&quot;Spelling&quot;] = &quot;Spelling&quot;;
</span><span class="cx"> localizedStrings[&quot;Start Playback&quot;] = &quot;Start Playback&quot;;
</span><span class="cx"> localizedStrings[&quot;Start Recording&quot;] = &quot;Start Recording&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSSelectorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSSelector.js (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSSelector.js        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSSelector.js        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-WebInspector.CSSSelector = function(text, specificity)
</del><ins>+WebInspector.CSSSelector = function(text, specificity, dynamic)
</ins><span class="cx"> {
</span><span class="cx">     WebInspector.Object.call(this);
</span><span class="cx"> 
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> 
</span><span class="cx">     this._text = text;
</span><span class="cx">     this._specificity = specificity || null;
</span><ins>+    this._dynamic = dynamic || false;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.CSSSelector.prototype = {
</span><span class="lines">@@ -47,5 +48,10 @@
</span><span class="cx">     get specificity()
</span><span class="cx">     {
</span><span class="cx">         return this._specificity;
</span><ins>+    },
+
+    get dynamic()
+    {
+        return this._dynamic;
</ins><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMNodeStylesjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -770,7 +770,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return selectors.map(function(selectorPayload) {
</span><del>-            return new WebInspector.CSSSelector(selectorPayload.text, selectorPayload.specificity);
</del><ins>+            return new WebInspector.CSSSelector(selectorPayload.text, selectorPayload.specificity, selectorPayload.dynamic);
</ins><span class="cx">         });
</span><span class="cx">     },
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationSectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js (178766 => 178767)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js        2015-01-21 00:28:33 UTC (rev 178766)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js        2015-01-21 00:30:36 UTC (rev 178767)
</span><span class="lines">@@ -181,7 +181,20 @@
</span><span class="cx">             var specificity = selector.specificity;
</span><span class="cx">             if (specificity) {
</span><span class="cx">                 var approximatedSpecificity = (specificity[0] * 100) + (specificity[1] * 10) + specificity[2];
</span><del>-                selectorElement.title = WebInspector.UIString(&quot;Specificity: (%d, %d, %d) ≈ %d&quot;).format(specificity[0], specificity[1], specificity[2], approximatedSpecificity);
</del><ins>+                var tooltip = WebInspector.UIString(&quot;Specificity: (%d, %d, %d) ≈ %d&quot;).format(specificity[0], specificity[1], specificity[2], approximatedSpecificity);
+                if (selector.dynamic) {
+                    tooltip += &quot;\n&quot;;
+                    if (this._style.inherited)
+                        tooltip += WebInspector.UIString(&quot;Dynamically calculated for the parent element&quot;);
+                    else
+                        tooltip += WebInspector.UIString(&quot;Dynamically calculated for the selected element&quot;);
+                }
+                selectorElement.title = tooltip;
+            } else if (selector.dynamic) {
+                var tooltip = WebInspector.UIString(&quot;Specificity: No value for selected element&quot;);
+                tooltip += &quot;\n&quot;;
+                tooltip += WebInspector.UIString(&quot;Dynamically calculated for the selected element and did not match&quot;);
+                selectorElement.title = tooltip;
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             this._selectorElement.appendChild(selectorElement);
</span></span></pre>
</div>
</div>

</body>
</html>