Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1132)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/StylesSectionModel.js

Issue 1418763003: DevTools: [SSP] treat new rules out of style cascade. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kill-style-rule
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles 7 * @param {!WebInspector.CSSStyleModel.MatchedStyleResult} matchedStyles
8 * @param {!Array<!WebInspector.CSSStyleDeclaration>} styles 8 * @param {!Array<!WebInspector.CSSStyleDeclaration>} styles
9 */ 9 */
10 WebInspector.SectionCascade = function(matchedStyles, styles) 10 WebInspector.SectionCascade = function(matchedStyles, styles)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 /** 82 /**
83 * @return {!Array.<!WebInspector.CSSStyleDeclaration>} 83 * @return {!Array.<!WebInspector.CSSStyleDeclaration>}
84 */ 84 */
85 styles: function() 85 styles: function()
86 { 86 {
87 return this._styles; 87 return this._styles;
88 }, 88 },
89 89
90 /** 90 /**
91 * @param {!WebInspector.CSSStyleDeclaration} style
92 * @param {!WebInspector.CSSStyleDeclaration=} insertAfter
93 */
94 insertStyle: function(style, insertAfter)
95 {
96 if (insertAfter) {
97 var index = this._styles.indexOf(insertAfter);
98 console.assert(index !== -1, "The insertAfter anchor could not be fo und in cascade");
99 this._styles.splice(index + 1, 0, style);
100 } else {
101 this._styles.push(style);
102 }
103 this.resetActiveProperties();
104 },
105
106 /**
107 * @param {!WebInspector.CSSProperty} property 91 * @param {!WebInspector.CSSProperty} property
108 * @return {?WebInspector.SectionCascade.PropertyState} 92 * @return {?WebInspector.SectionCascade.PropertyState}
109 */ 93 */
110 propertyState: function(property) 94 propertyState: function(property)
111 { 95 {
112 if (this._propertiesState.size === 0) 96 if (this._propertiesState.size === 0)
113 this._propertiesState = this._computeActiveProperties(); 97 this._propertiesState = this._computeActiveProperties();
114 return this._propertiesState.get(property) || null; 98 return this._propertiesState.get(property) || null;
115 }, 99 },
116 100
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 197 }
214 return result; 198 return result;
215 } 199 }
216 } 200 }
217 201
218 /** @enum {string} */ 202 /** @enum {string} */
219 WebInspector.SectionCascade.PropertyState = { 203 WebInspector.SectionCascade.PropertyState = {
220 Active: "Active", 204 Active: "Active",
221 Overloaded: "Overloaded" 205 Overloaded: "Overloaded"
222 } 206 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698