| OLD | NEW |
| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 WebInspector.CSSValue = class { | 7 WebInspector.CSSValue = class { |
| 8 /** | 8 /** |
| 9 * @param {!Protocol.CSS.Value} payload | 9 * @param {!Protocol.CSS.Value} payload |
| 10 */ | 10 */ |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 /** | 96 /** |
| 97 * @unrestricted | 97 * @unrestricted |
| 98 */ | 98 */ |
| 99 WebInspector.CSSStyleRule = class extends WebInspector.CSSRule { | 99 WebInspector.CSSStyleRule = class extends WebInspector.CSSRule { |
| 100 /** | 100 /** |
| 101 * @param {!WebInspector.CSSModel} cssModel | 101 * @param {!WebInspector.CSSModel} cssModel |
| 102 * @param {!Protocol.CSS.CSSRule} payload | 102 * @param {!Protocol.CSS.CSSRule} payload |
| 103 * @param {boolean=} wasUsed |
| 103 */ | 104 */ |
| 104 constructor(cssModel, payload) { | 105 constructor(cssModel, payload, wasUsed) { |
| 105 super(cssModel, payload); | 106 super(cssModel, payload); |
| 106 | 107 |
| 107 this._reinitializeSelectors(payload.selectorList); | 108 this._reinitializeSelectors(payload.selectorList); |
| 108 this.media = payload.media ? WebInspector.CSSMedia.parseMediaArrayPayload(cs
sModel, payload.media) : []; | 109 this.media = payload.media ? WebInspector.CSSMedia.parseMediaArrayPayload(cs
sModel, payload.media) : []; |
| 110 this.wasUsed = wasUsed || false; |
| 109 } | 111 } |
| 110 | 112 |
| 111 /** | 113 /** |
| 112 * @param {!WebInspector.CSSModel} cssModel | 114 * @param {!WebInspector.CSSModel} cssModel |
| 113 * @param {string} selectorText | 115 * @param {string} selectorText |
| 114 * @return {!WebInspector.CSSStyleRule} | 116 * @return {!WebInspector.CSSStyleRule} |
| 115 */ | 117 */ |
| 116 static createDummyRule(cssModel, selectorText) { | 118 static createDummyRule(cssModel, selectorText) { |
| 117 var dummyPayload = { | 119 var dummyPayload = { |
| 118 selectorList: { | 120 selectorList: { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 setKeyText(newKeyText) { | 293 setKeyText(newKeyText) { |
| 292 var styleSheetId = this.styleSheetId; | 294 var styleSheetId = this.styleSheetId; |
| 293 if (!styleSheetId) | 295 if (!styleSheetId) |
| 294 throw 'No rule stylesheet id'; | 296 throw 'No rule stylesheet id'; |
| 295 var range = this._keyText.range; | 297 var range = this._keyText.range; |
| 296 if (!range) | 298 if (!range) |
| 297 throw 'Keyframe key is not editable'; | 299 throw 'Keyframe key is not editable'; |
| 298 return this._cssModel.setKeyframeKey(styleSheetId, range, newKeyText); | 300 return this._cssModel.setKeyframeKey(styleSheetId, range, newKeyText); |
| 299 } | 301 } |
| 300 }; | 302 }; |
| OLD | NEW |