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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleDeclaration.js

Issue 2440953003: DevTools: use semicolons after each statement. (Closed)
Patch Set: rebaseline Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.CSSModel} cssModel 7 * @param {!WebInspector.CSSModel} cssModel
8 * @param {?WebInspector.CSSRule} parentRule 8 * @param {?WebInspector.CSSRule} parentRule
9 * @param {!CSSAgent.CSSStyle} payload 9 * @param {!CSSAgent.CSSStyle} payload
10 * @param {!WebInspector.CSSStyleDeclaration.Type} type 10 * @param {!WebInspector.CSSStyleDeclaration.Type} type
11 */ 11 */
12 WebInspector.CSSStyleDeclaration = function(cssModel, parentRule, payload, type) 12 WebInspector.CSSStyleDeclaration = function(cssModel, parentRule, payload, type)
13 { 13 {
14 this._cssModel = cssModel; 14 this._cssModel = cssModel;
15 this.parentRule = parentRule; 15 this.parentRule = parentRule;
16 this._reinitialize(payload); 16 this._reinitialize(payload);
17 this.type = type; 17 this.type = type;
18 } 18 };
19 19
20 /** @enum {string} */ 20 /** @enum {string} */
21 WebInspector.CSSStyleDeclaration.Type = { 21 WebInspector.CSSStyleDeclaration.Type = {
22 Regular: "Regular", 22 Regular: "Regular",
23 Inline: "Inline", 23 Inline: "Inline",
24 Attributes: "Attributes" 24 Attributes: "Attributes"
25 } 25 };
26 26
27 WebInspector.CSSStyleDeclaration.prototype = { 27 WebInspector.CSSStyleDeclaration.prototype = {
28 /** 28 /**
29 * @param {!WebInspector.CSSModel.Edit} edit 29 * @param {!WebInspector.CSSModel.Edit} edit
30 */ 30 */
31 rebase: function(edit) 31 rebase: function(edit)
32 { 32 {
33 if (this.styleSheetId !== edit.styleSheetId || !this.range) 33 if (this.styleSheetId !== edit.styleSheetId || !this.range)
34 return; 34 return;
35 if (edit.oldRange.equal(this.range)) { 35 if (edit.oldRange.equal(this.range)) {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 return property; 279 return property;
280 }, 280 },
281 281
282 /** 282 /**
283 * @param {string} text 283 * @param {string} text
284 * @param {boolean} majorChange 284 * @param {boolean} majorChange
285 * @return {!Promise.<boolean>} 285 * @return {!Promise.<boolean>}
286 */ 286 */
287 setText: function(text, majorChange) 287 setText: function(text, majorChange)
288 { 288 {
289 return this._cssModel.setStyleText(this.styleSheetId, this.range, text, majorChange) 289 return this._cssModel.setStyleText(this.styleSheetId, this.range, text, majorChange);
290 }, 290 },
291 291
292 /** 292 /**
293 * @param {number} index 293 * @param {number} index
294 * @param {string} name 294 * @param {string} name
295 * @param {string} value 295 * @param {string} value
296 * @param {function(boolean)=} userCallback 296 * @param {function(boolean)=} userCallback
297 */ 297 */
298 insertPropertyAt: function(index, name, value, userCallback) 298 insertPropertyAt: function(index, name, value, userCallback)
299 { 299 {
300 this.newBlankProperty(index).setText(name + ": " + value + ";", false, t rue) 300 this.newBlankProperty(index).setText(name + ": " + value + ";", false, t rue)
301 .then(userCallback); 301 .then(userCallback);
302 }, 302 },
303 303
304 /** 304 /**
305 * @param {string} name 305 * @param {string} name
306 * @param {string} value 306 * @param {string} value
307 * @param {function(boolean)=} userCallback 307 * @param {function(boolean)=} userCallback
308 */ 308 */
309 appendProperty: function(name, value, userCallback) 309 appendProperty: function(name, value, userCallback)
310 { 310 {
311 this.insertPropertyAt(this.allProperties.length, name, value, userCallba ck); 311 this.insertPropertyAt(this.allProperties.length, name, value, userCallba ck);
312 } 312 }
313 } 313 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698