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

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

Issue 2769843003: DevTools: split text_utils out of common module (Closed)
Patch Set: rebaseline Created 3 years, 9 months 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 SDK.CSSMediaQuery = class { 7 SDK.CSSMediaQuery = class {
8 /** 8 /**
9 * @param {!Protocol.CSS.MediaQuery} payload 9 * @param {!Protocol.CSS.MediaQuery} payload
10 */ 10 */
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 * @unrestricted 43 * @unrestricted
44 */ 44 */
45 SDK.CSSMediaQueryExpression = class { 45 SDK.CSSMediaQueryExpression = class {
46 /** 46 /**
47 * @param {!Protocol.CSS.MediaQueryExpression} payload 47 * @param {!Protocol.CSS.MediaQueryExpression} payload
48 */ 48 */
49 constructor(payload) { 49 constructor(payload) {
50 this._value = payload.value; 50 this._value = payload.value;
51 this._unit = payload.unit; 51 this._unit = payload.unit;
52 this._feature = payload.feature; 52 this._feature = payload.feature;
53 this._valueRange = payload.valueRange ? Common.TextRange.fromObject(payload. valueRange) : null; 53 this._valueRange = payload.valueRange ? TextUtils.TextRange.fromObject(paylo ad.valueRange) : null;
54 this._computedLength = payload.computedLength || null; 54 this._computedLength = payload.computedLength || null;
55 } 55 }
56 56
57 /** 57 /**
58 * @param {!Protocol.CSS.MediaQueryExpression} payload 58 * @param {!Protocol.CSS.MediaQueryExpression} payload
59 * @return {!SDK.CSSMediaQueryExpression} 59 * @return {!SDK.CSSMediaQueryExpression}
60 */ 60 */
61 static parsePayload(payload) { 61 static parsePayload(payload) {
62 return new SDK.CSSMediaQueryExpression(payload); 62 return new SDK.CSSMediaQueryExpression(payload);
63 } 63 }
(...skipping 13 matching lines...) Expand all
77 } 77 }
78 78
79 /** 79 /**
80 * @return {string} 80 * @return {string}
81 */ 81 */
82 feature() { 82 feature() {
83 return this._feature; 83 return this._feature;
84 } 84 }
85 85
86 /** 86 /**
87 * @return {?Common.TextRange} 87 * @return {?TextUtils.TextRange}
88 */ 88 */
89 valueRange() { 89 valueRange() {
90 return this._valueRange; 90 return this._valueRange;
91 } 91 }
92 92
93 /** 93 /**
94 * @return {?number} 94 * @return {?number}
95 */ 95 */
96 computedLength() { 96 computedLength() {
97 return this._computedLength; 97 return this._computedLength;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return result; 133 return result;
134 } 134 }
135 135
136 /** 136 /**
137 * @param {!Protocol.CSS.CSSMedia} payload 137 * @param {!Protocol.CSS.CSSMedia} payload
138 */ 138 */
139 _reinitialize(payload) { 139 _reinitialize(payload) {
140 this.text = payload.text; 140 this.text = payload.text;
141 this.source = payload.source; 141 this.source = payload.source;
142 this.sourceURL = payload.sourceURL || ''; 142 this.sourceURL = payload.sourceURL || '';
143 this.range = payload.range ? Common.TextRange.fromObject(payload.range) : nu ll; 143 this.range = payload.range ? TextUtils.TextRange.fromObject(payload.range) : null;
144 this.styleSheetId = payload.styleSheetId; 144 this.styleSheetId = payload.styleSheetId;
145 this.mediaList = null; 145 this.mediaList = null;
146 if (payload.mediaList) { 146 if (payload.mediaList) {
147 this.mediaList = []; 147 this.mediaList = [];
148 for (var i = 0; i < payload.mediaList.length; ++i) 148 for (var i = 0; i < payload.mediaList.length; ++i)
149 this.mediaList.push(SDK.CSSMediaQuery.parsePayload(payload.mediaList[i]) ); 149 this.mediaList.push(SDK.CSSMediaQuery.parsePayload(payload.mediaList[i]) );
150 } 150 }
151 } 151 }
152 152
153 /** 153 /**
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 return new SDK.CSSLocation(header, lineNumber, this.columnNumberInSource()); 227 return new SDK.CSSLocation(header, lineNumber, this.columnNumberInSource());
228 } 228 }
229 }; 229 };
230 230
231 SDK.CSSMedia.Source = { 231 SDK.CSSMedia.Source = {
232 LINKED_SHEET: 'linkedSheet', 232 LINKED_SHEET: 'linkedSheet',
233 INLINE_SHEET: 'inlineSheet', 233 INLINE_SHEET: 'inlineSheet',
234 MEDIA_RULE: 'mediaRule', 234 MEDIA_RULE: 'mediaRule',
235 IMPORT_RULE: 'importRule' 235 IMPORT_RULE: 'importRule'
236 }; 236 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698