<!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>[189032] 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/189032">189032</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-27 10:37:22 -0700 (Thu, 27 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Standardize on CSSStyleSheet.Type enum and move more protocol enum conversion to the manager
https://bugs.webkit.org/show_bug.cgi?id=148515
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-08-27
Reviewed by Brian Burg.
Source/WebInspectorUI:
* UserInterface/Controllers/CSSStyleManager.js:
(WebInspector.CSSStyleManager.protocolStyleSheetOriginToEnum):
(WebInspector.CSSStyleManager.protocolMediaSourceToEnum):
Protocol enum to frontend enum conversion.
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
(WebInspector.DOMNodeStyles.prototype.refresh):
(WebInspector.DOMNodeStyles.prototype._parseRulePayload):
(WebInspector.DOMNodeStyles.prototype._collectStylesInCascadeOrder):
Use the manager to convert from a protocol payload enum to frontend num for css types.
* UserInterface/Models/CSSRule.js:
(WebInspector.CSSRule.prototype.get editable):
* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection):
(WebInspector.CSSStyleDeclarationSection.prototype.refresh):
* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype.refresh.appendStyleSection):
(WebInspector.RulesStyleDetailsPanel.prototype.refresh):
* UserInterface/Views/VisualStyleSelectorSection.js:
(WebInspector.VisualStyleSelectorSection.prototype.update.createSelectorItem):
(WebInspector.VisualStyleSelectorSection.prototype.update.uniqueOrderedRules.set return):
(WebInspector.VisualStyleSelectorSection.prototype.update.uniqueOrderedRules):
(WebInspector.VisualStyleSelectorSection.prototype.update):
* UserInterface/Views/VisualStyleSelectorTreeItem.js:
(WebInspector.VisualStyleSelectorTreeItem):
Update enum use.
LayoutTests:
* inspector/css/matched-style-properties.html:
* inspector/css/pseudo-element-matches.html:
* inspector/css/selector-dynamic-specificity.html:
* inspector/css/selector-specificity.html:
* inspector/css/stylesheet-with-mutations.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectorcssmatchedstylepropertieshtml">trunk/LayoutTests/inspector/css/matched-style-properties.html</a></li>
<li><a href="#trunkLayoutTestsinspectorcsspseudoelementmatcheshtml">trunk/LayoutTests/inspector/css/pseudo-element-matches.html</a></li>
<li><a href="#trunkLayoutTestsinspectorcssselectordynamicspecificityhtml">trunk/LayoutTests/inspector/css/selector-dynamic-specificity.html</a></li>
<li><a href="#trunkLayoutTestsinspectorcssselectorspecificityhtml">trunk/LayoutTests/inspector/css/selector-specificity.html</a></li>
<li><a href="#trunkLayoutTestsinspectorcssstylesheetwithmutationshtml">trunk/LayoutTests/inspector/css/stylesheet-with-mutations.html</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCSSStyleManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSStyleManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSRulejs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSRule.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>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorTreeItemjs">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/LayoutTests/ChangeLog        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-08-27 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Standardize on CSSStyleSheet.Type enum and move more protocol enum conversion to the manager
+ https://bugs.webkit.org/show_bug.cgi?id=148515
+
+ Reviewed by Brian Burg.
+
+ * inspector/css/matched-style-properties.html:
+ * inspector/css/pseudo-element-matches.html:
+ * inspector/css/selector-dynamic-specificity.html:
+ * inspector/css/selector-specificity.html:
+ * inspector/css/stylesheet-with-mutations.html:
+
</ins><span class="cx"> 2015-08-27 Eric Carlson <eric.carlson@apple.com>
</span><span class="cx">
</span><span class="cx"> Media Session: MediaSession constructor 'kind' argument optional
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorcssmatchedstylepropertieshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/css/matched-style-properties.html (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/css/matched-style-properties.html        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/LayoutTests/inspector/css/matched-style-properties.html        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> {
</span><span class="cx"> for (var i = 0; i < nodeStyles.matchedRules.length; ++i) {
</span><span class="cx"> var rule = nodeStyles.matchedRules[i];
</span><del>- if (rule.type !== WebInspector.CSSRule.Type.Author)
</del><ins>+ if (rule.type !== WebInspector.CSSStyleSheet.Type.Author)
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> for (var j = 0; j < rule.style.properties.length; ++j) {
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorcsspseudoelementmatcheshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/css/pseudo-element-matches.html (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/css/pseudo-element-matches.html        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/LayoutTests/inspector/css/pseudo-element-matches.html        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx">
</span><span class="cx"> for (var i = 0; i < nodeStyles.matchedRules.length; ++i) {
</span><span class="cx"> var rule = nodeStyles.matchedRules[i];
</span><del>- if (rule.type !== WebInspector.CSSRule.Type.UserAgent)
</del><ins>+ if (rule.type !== WebInspector.CSSStyleSheet.Type.UserAgent)
</ins><span class="cx"> continue;
</span><span class="cx"> if (rule.selectorText.indexOf("::-webkit-media-text-track-container") === -1)
</span><span class="cx"> continue;
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorcssselectordynamicspecificityhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/css/selector-dynamic-specificity.html (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/css/selector-dynamic-specificity.html        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/LayoutTests/inspector/css/selector-dynamic-specificity.html        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx">
</span><span class="cx"> for (var i = 0; i < nodeStyles.matchedRules.length; ++i) {
</span><span class="cx"> var rule = nodeStyles.matchedRules[i];
</span><del>- if (rule.type !== WebInspector.CSSRule.Type.Author)
</del><ins>+ if (rule.type !== WebInspector.CSSStyleSheet.Type.Author)
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> if (seenRules.some(function(r) { return r.isEqualTo(rule); }))
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorcssselectorspecificityhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/css/selector-specificity.html (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/css/selector-specificity.html        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/LayoutTests/inspector/css/selector-specificity.html        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> {
</span><span class="cx"> for (var i = 0; i < nodeStyles.matchedRules.length; ++i) {
</span><span class="cx"> var rule = nodeStyles.matchedRules[i];
</span><del>- if (rule.type !== WebInspector.CSSRule.Type.Author)
</del><ins>+ if (rule.type !== WebInspector.CSSStyleSheet.Type.Author)
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> for (var selector of rule.selectors)
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorcssstylesheetwithmutationshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/css/stylesheet-with-mutations.html (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/css/stylesheet-with-mutations.html        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/LayoutTests/inspector/css/stylesheet-with-mutations.html        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> {
</span><span class="cx"> for (var i = 0; i < nodeStyles.matchedRules.length; ++i) {
</span><span class="cx"> var rule = nodeStyles.matchedRules[i];
</span><del>- if (rule.type !== WebInspector.CSSRule.Type.Author)
</del><ins>+ if (rule.type !== WebInspector.CSSStyleSheet.Type.Author)
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> for (var selector of rule.selectors)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2015-08-27 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Standardize on CSSStyleSheet.Type enum and move more protocol enum conversion to the manager
+ https://bugs.webkit.org/show_bug.cgi?id=148515
+
+ Reviewed by Brian Burg.
+
+ * UserInterface/Controllers/CSSStyleManager.js:
+ (WebInspector.CSSStyleManager.protocolStyleSheetOriginToEnum):
+ (WebInspector.CSSStyleManager.protocolMediaSourceToEnum):
+ Protocol enum to frontend enum conversion.
+
+ * UserInterface/Models/DOMNodeStyles.js:
+ (WebInspector.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
+ (WebInspector.DOMNodeStyles.prototype.refresh):
+ (WebInspector.DOMNodeStyles.prototype._parseRulePayload):
+ (WebInspector.DOMNodeStyles.prototype._collectStylesInCascadeOrder):
+ Use the manager to convert from a protocol payload enum to frontend num for css types.
+
+ * UserInterface/Models/CSSRule.js:
+ (WebInspector.CSSRule.prototype.get editable):
+ * UserInterface/Views/CSSStyleDeclarationSection.js:
+ (WebInspector.CSSStyleDeclarationSection):
+ (WebInspector.CSSStyleDeclarationSection.prototype.refresh):
+ * UserInterface/Views/RulesStyleDetailsPanel.js:
+ (WebInspector.RulesStyleDetailsPanel.prototype.refresh.appendStyleSection):
+ (WebInspector.RulesStyleDetailsPanel.prototype.refresh):
+ * UserInterface/Views/VisualStyleSelectorSection.js:
+ (WebInspector.VisualStyleSelectorSection.prototype.update.createSelectorItem):
+ (WebInspector.VisualStyleSelectorSection.prototype.update.uniqueOrderedRules.set return):
+ (WebInspector.VisualStyleSelectorSection.prototype.update.uniqueOrderedRules):
+ (WebInspector.VisualStyleSelectorSection.prototype.update):
+ * UserInterface/Views/VisualStyleSelectorTreeItem.js:
+ (WebInspector.VisualStyleSelectorTreeItem):
+ Update enum use.
+
</ins><span class="cx"> 2015-08-26 Nikita Vasilyev <nvasilyev@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: [Regression] [Mavericks]: Undocked Web Inspector toolbar is two different colors and has extra space
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCSSStyleManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSStyleManager.js (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSStyleManager.js        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSStyleManager.js        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx">
</span><span class="cx"> static protocolStyleSheetOriginToEnum(origin)
</span><span class="cx"> {
</span><del>- // FIXME: Switch from CSSRule.Type to CSSStyleSheet.Type everywhere.
</del><span class="cx"> switch (origin) {
</span><span class="cx"> case CSSAgent.StyleSheetOrigin.Regular:
</span><span class="cx"> return WebInspector.CSSStyleSheet.Type.Author;
</span><span class="lines">@@ -67,11 +66,28 @@
</span><span class="cx"> case CSSAgent.StyleSheetOrigin.Inspector:
</span><span class="cx"> return WebInspector.CSSStyleSheet.Type.Inspector;
</span><span class="cx"> default:
</span><del>- console.assert(false, "Unknown StyleSheetOrigin", origin);
</del><ins>+ console.assert(false, "Unknown CSS.StyleSheetOrigin", origin);
</ins><span class="cx"> return CSSAgent.StyleSheetOrigin.Regular;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ static protocolMediaSourceToEnum(source)
+ {
+ switch (source) {
+ case CSSAgent.CSSMediaSource.MediaRule:
+ return WebInspector.CSSMedia.Type.MediaRule;
+ case CSSAgent.CSSMediaSource.ImportRule:
+ return WebInspector.CSSMedia.Type.ImportRule;
+ case CSSAgent.CSSMediaSource.LinkedSheet:
+ return WebInspector.CSSMedia.Type.LinkedStyleSheet;
+ case CSSAgent.CSSMediaSource.InlineSheet:
+ return WebInspector.CSSMedia.Type.InlineStyleSheet;
+ default:
+ console.assert(false, "Unknown CSS.CSSMediaSource", origin);
+ return WebInspector.CSSMedia.Type.MediaRule;
+ }
+ }
+
</ins><span class="cx"> // Public
</span><span class="cx">
</span><span class="cx"> get preferredColorFormat()
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSRulejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSRule.js (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSRule.js        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSRule.js        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">
</span><span class="cx"> get editable()
</span><span class="cx"> {
</span><del>- return !!this._id && (this._type === WebInspector.CSSRule.Type.Author || this._type === WebInspector.CSSRule.Type.Inspector);
</del><ins>+ return !!this._id && (this._type === WebInspector.CSSStyleSheet.Type.Author || this._type === WebInspector.CSSStyleSheet.Type.Inspector);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> update(sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList, dontFireEvents)
</span><span class="lines">@@ -247,10 +247,3 @@
</span><span class="cx"> Changed: "css-rule-changed",
</span><span class="cx"> SelectorChanged: "css-rule-invalid-selector"
</span><span class="cx"> };
</span><del>-
-WebInspector.CSSRule.Type = {
- Author: "css-rule-type-author",
- User: "css-rule-type-user",
- UserAgent: "css-rule-type-user-agent",
- Inspector: "css-rule-type-inspector"
-};
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMNodeStylesjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -170,7 +170,7 @@
</span><span class="cx"> if (!this._includeUserAgentRulesOnNextRefresh) {
</span><span class="cx"> // We can assume all the styles with the same key are from the same stylesheet and rule, so we only check the first.
</span><span class="cx"> var firstStyle = this._styleDeclarationsMap[key][0];
</span><del>- if (firstStyle && firstStyle.ownerRule && firstStyle.ownerRule.type === WebInspector.CSSRule.Type.UserAgent) {
</del><ins>+ if (firstStyle && firstStyle.ownerRule && firstStyle.ownerRule.type === WebInspector.CSSStyleSheet.Type.UserAgent) {
</ins><span class="cx"> // User Agent styles get different identifiers after some edits. This would cause us to fire a significant refreshed
</span><span class="cx"> // event more than it is helpful. And since the user agent stylesheet is static it shouldn't match differently
</span><span class="cx"> // between refreshes for the same node. This issue is tracked by: https://webkit.org/b/110055
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx"> if (!this._includeUserAgentRulesOnNextRefresh) {
</span><span class="cx"> // See above for why we skip user agent style rules.
</span><span class="cx"> var firstStyle = this._previousStyleDeclarationsMap[key][0];
</span><del>- if (firstStyle && firstStyle.ownerRule && firstStyle.ownerRule.type === WebInspector.CSSRule.Type.UserAgent)
</del><ins>+ if (firstStyle && firstStyle.ownerRule && firstStyle.ownerRule.type === WebInspector.CSSStyleSheet.Type.UserAgent)
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -684,6 +684,7 @@
</span><span class="cx">
</span><span class="cx"> var selectorText = payload.selectorList.text;
</span><span class="cx"> var selectors = this._parseSelectorListPayload(payload.selectorList);
</span><ins>+ var type = WebInspector.CSSStyleManager.protocolStyleSheetOriginToEnum(payload.origin);
</ins><span class="cx">
</span><span class="cx"> var sourceCodeLocation = null;
</span><span class="cx"> var sourceRange = payload.selectorList.range;
</span><span class="lines">@@ -697,42 +698,10 @@
</span><span class="cx"> if (styleSheet)
</span><span class="cx"> sourceCodeLocation = styleSheet.offsetSourceCodeLocation(sourceCodeLocation);
</span><span class="cx">
</span><del>- var type;
- switch (payload.origin) {
- case "regular":
- type = WebInspector.CSSRule.Type.Author;
- break;
- case "user":
- type = WebInspector.CSSRule.Type.User;
- break;
- case "user-agent":
- type = WebInspector.CSSRule.Type.UserAgent;
- break;
- case "inspector":
- type = WebInspector.CSSRule.Type.Inspector;
- break;
- }
-
</del><span class="cx"> var mediaList = [];
</span><span class="cx"> for (var i = 0; payload.media && i < payload.media.length; ++i) {
</span><span class="cx"> var mediaItem = payload.media[i];
</span><del>-
- var mediaType;
- switch (mediaItem.source) {
- case "mediaRule":
- mediaType = WebInspector.CSSMedia.Type.MediaRule;
- break;
- case "importRule":
- mediaType = WebInspector.CSSMedia.Type.ImportRule;
- break;
- case "linkedSheet":
- mediaType = WebInspector.CSSMedia.Type.LinkedStyleSheet;
- break;
- case "inlineSheet":
- mediaType = WebInspector.CSSMedia.Type.InlineStyleSheet;
- break;
- }
-
</del><ins>+ var mediaType = WebInspector.CSSStyleManager.protocolMediaSourceToEnum(mediaItem.source);
</ins><span class="cx"> var mediaText = mediaItem.text;
</span><span class="cx"> var mediaSourceCodeLocation = this._createSourceCodeLocation(mediaItem.sourceURL, mediaItem.sourceLine);
</span><span class="cx"> if (styleSheet)
</span><span class="lines">@@ -820,13 +789,13 @@
</span><span class="cx"> // Only append to the result array here for author and inspector rules since attribute
</span><span class="cx"> // styles come between author rules and user/user agent rules.
</span><span class="cx"> switch (rule.type) {
</span><del>- case WebInspector.CSSRule.Type.Inspector:
- case WebInspector.CSSRule.Type.Author:
</del><ins>+ case WebInspector.CSSStyleSheet.Type.Inspector:
+ case WebInspector.CSSStyleSheet.Type.Author:
</ins><span class="cx"> result.push(rule.style);
</span><span class="cx"> break;
</span><span class="cx">
</span><del>- case WebInspector.CSSRule.Type.User:
- case WebInspector.CSSRule.Type.UserAgent:
</del><ins>+ case WebInspector.CSSStyleSheet.Type.User:
+ case WebInspector.CSSStyleSheet.Type.UserAgent:
</ins><span class="cx"> userAndUserAgentStyles.push(rule.style);
</span><span class="cx"> break;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationSectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -80,13 +80,13 @@
</span><span class="cx">
</span><span class="cx"> if (style.inherited)
</span><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName;
</span><del>- else if (style.ownerRule.type === WebInspector.CSSRule.Type.Author)
</del><ins>+ else if (style.ownerRule.type === WebInspector.CSSStyleSheet.Type.Author)
</ins><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName;
</span><del>- else if (style.ownerRule.type === WebInspector.CSSRule.Type.User)
</del><ins>+ else if (style.ownerRule.type === WebInspector.CSSStyleSheet.Type.User)
</ins><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName;
</span><del>- else if (style.ownerRule.type === WebInspector.CSSRule.Type.UserAgent)
</del><ins>+ else if (style.ownerRule.type === WebInspector.CSSStyleSheet.Type.UserAgent)
</ins><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName;
</span><del>- else if (style.ownerRule.type === WebInspector.CSSRule.Type.Inspector)
</del><ins>+ else if (style.ownerRule.type === WebInspector.CSSStyleSheet.Type.Inspector)
</ins><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName;
</span><span class="cx"> break;
</span><span class="cx">
</span><span class="lines">@@ -234,19 +234,19 @@
</span><span class="cx"> } else {
</span><span class="cx"> var originString;
</span><span class="cx"> switch (this._style.ownerRule.type) {
</span><del>- case WebInspector.CSSRule.Type.Author:
</del><ins>+ case WebInspector.CSSStyleSheet.Type.Author:
</ins><span class="cx"> originString = WebInspector.UIString("Author Stylesheet");
</span><span class="cx"> break;
</span><span class="cx">
</span><del>- case WebInspector.CSSRule.Type.User:
</del><ins>+ case WebInspector.CSSStyleSheet.Type.User:
</ins><span class="cx"> originString = WebInspector.UIString("User Stylesheet");
</span><span class="cx"> break;
</span><span class="cx">
</span><del>- case WebInspector.CSSRule.Type.UserAgent:
</del><ins>+ case WebInspector.CSSStyleSheet.Type.UserAgent:
</ins><span class="cx"> originString = WebInspector.UIString("User Agent Stylesheet");
</span><span class="cx"> break;
</span><span class="cx">
</span><del>- case WebInspector.CSSRule.Type.Inspector:
</del><ins>+ case WebInspector.CSSStyleSheet.Type.Inspector:
</ins><span class="cx"> originString = WebInspector.UIString("Web Inspector");
</span><span class="cx"> break;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx"> } else
</span><span class="cx"> section.refresh();
</span><span class="cx">
</span><del>- if (this._focusNextNewInspectorRule && style.ownerRule && style.ownerRule.type === WebInspector.CSSRule.Type.Inspector) {
</del><ins>+ if (this._focusNextNewInspectorRule && style.ownerRule && style.ownerRule.type === WebInspector.CSSStyleSheet.Type.Inspector) {
</ins><span class="cx"> this._previousFocusedSection = section;
</span><span class="cx"> delete this._focusNextNewInspectorRule;
</span><span class="cx"> }
</span><span class="lines">@@ -282,7 +282,7 @@
</span><span class="cx"> this._ruleMediaAndInherticanceList = [];
</span><span class="cx"> var orderedStyles = uniqueOrderedStyles(this.nodeStyles.orderedStyles);
</span><span class="cx"> for (var style of orderedStyles) {
</span><del>- var isUserAgentStyle = style.ownerRule && style.ownerRule.type === WebInspector.CSSRule.Type.UserAgent;
</del><ins>+ var isUserAgentStyle = style.ownerRule && style.ownerRule.type === WebInspector.CSSStyleSheet.Type.UserAgent;
</ins><span class="cx"> insertAllMatchingPseudoStyles.call(this, isUserAgentStyle || style.inerhited);
</span><span class="cx">
</span><span class="cx"> insertMediaOrInheritanceLabel.call(this, style);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorSectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorSection.js (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorSection.js        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorSection.js        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx"> selector.addEventListener(WebInspector.VisualStyleSelectorTreeItem.Event.CheckboxChanged, this._treeElementCheckboxToggled, this);
</span><span class="cx"> this._selectors.appendChild(selector);
</span><span class="cx">
</span><del>- if (this._focusNextNewInspectorRule && style.ownerRule && style.ownerRule.type === WebInspector.CSSRule.Type.Inspector) {
</del><ins>+ if (this._focusNextNewInspectorRule && style.ownerRule && style.ownerRule.type === WebInspector.CSSStyleSheet.Type.Inspector) {
</ins><span class="cx"> selector.select(true);
</span><span class="cx"> selector.element.scrollIntoView();
</span><span class="cx"> this._nodeStyles[WebInspector.VisualStyleSelectorSection.LastSelectedRuleSymbol] = style;
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx">
</span><span class="cx"> // Matched Rules
</span><span class="cx"> for (let rule of uniqueOrderedRules(this._nodeStyles.matchedRules)) {
</span><del>- if (rule.type === WebInspector.CSSRule.Type.UserAgent) {
</del><ins>+ if (rule.type === WebInspector.CSSStyleSheet.Type.UserAgent) {
</ins><span class="cx"> insertAllMatchingPseudoRules.call(this, true);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx"> this._selectors.appendChild(divider);
</span><span class="cx">
</span><span class="cx"> for (let rule of uniqueOrderedRules(inherited.matchedRules)) {
</span><del>- if (rule.type === WebInspector.CSSRule.Type.UserAgent)
</del><ins>+ if (rule.type === WebInspector.CSSStyleSheet.Type.UserAgent)
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> createSelectorItem.call(this, rule.style, rule.selectorText, rule.mediaText);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorTreeItemjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js (189031 => 189032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js        2015-08-27 17:33:48 UTC (rev 189031)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js        2015-08-27 17:37:22 UTC (rev 189032)
</span><span class="lines">@@ -34,13 +34,13 @@
</span><span class="cx">
</span><span class="cx"> if (style.inherited)
</span><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.InheritedStyleRuleIconStyleClassName;
</span><del>- else if (style.ownerRule.type === WebInspector.CSSRule.Type.Author)
</del><ins>+ else if (style.ownerRule.type === WebInspector.CSSStyleSheet.Type.Author)
</ins><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.AuthorStyleRuleIconStyleClassName;
</span><del>- else if (style.ownerRule.type === WebInspector.CSSRule.Type.User)
</del><ins>+ else if (style.ownerRule.type === WebInspector.CSSStyleSheet.Type.User)
</ins><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.UserStyleRuleIconStyleClassName;
</span><del>- else if (style.ownerRule.type === WebInspector.CSSRule.Type.UserAgent)
</del><ins>+ else if (style.ownerRule.type === WebInspector.CSSStyleSheet.Type.UserAgent)
</ins><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.UserAgentStyleRuleIconStyleClassName;
</span><del>- else if (style.ownerRule.type === WebInspector.CSSRule.Type.Inspector)
</del><ins>+ else if (style.ownerRule.type === WebInspector.CSSStyleSheet.Type.Inspector)
</ins><span class="cx"> iconClassName = WebInspector.CSSStyleDeclarationSection.InspectorStyleRuleIconStyleClassName;
</span><span class="cx"> break;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>