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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sass/ASTSourceMap.js

Issue 1774503005: [DevTools] Roll closure compiler to ToT version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 {string} cssURL 7 * @param {string} cssURL
8 * @param {!Map<string, !WebInspector.SASSSupport.AST>} models 8 * @param {!Map<string, !WebInspector.SASSSupport.AST>} models
9 */ 9 */
10 WebInspector.ASTSourceMap = function(cssURL, models) 10 WebInspector.ASTSourceMap = function(cssURL, models)
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 cssAST: function() 109 cssAST: function()
110 { 110 {
111 return /** @type {!WebInspector.SASSSupport.AST} */(this._models.get(thi s._cssURL)); 111 return /** @type {!WebInspector.SASSSupport.AST} */(this._models.get(thi s._cssURL));
112 }, 112 },
113 113
114 /** 114 /**
115 * @return {!Map<string, !WebInspector.SASSSupport.AST>} 115 * @return {!Map<string, !WebInspector.SASSSupport.AST>}
116 */ 116 */
117 sassModels: function() 117 sassModels: function()
118 { 118 {
119 var sassModels = new Map(this._models); 119 var sassModels = /** @type {!Map<string, !WebInspector.SASSSupport.AST>} */(new Map(this._models));
120 sassModels.delete(this._cssURL); 120 sassModels.delete(this._cssURL);
121 return sassModels; 121 return sassModels;
122 }, 122 },
123 123
124 /** 124 /**
125 * @return {!Map<string, !WebInspector.SASSSupport.AST>} 125 * @return {!Map<string, !WebInspector.SASSSupport.AST>}
126 */ 126 */
127 models: function() 127 models: function()
128 { 128 {
129 return new Map(this._models); 129 return /** @type {!Map<string, !WebInspector.SASSSupport.AST>} */(new Ma p(this._models));
130 }, 130 },
131 131
132 /** 132 /**
133 * @param {string} url 133 * @param {string} url
134 * @return {?WebInspector.SASSSupport.AST} 134 * @return {?WebInspector.SASSSupport.AST}
135 */ 135 */
136 modelForURL: function(url) 136 modelForURL: function(url)
137 { 137 {
138 return this._models.get(url) || null; 138 return this._models.get(url) || null;
139 }, 139 },
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 /** 199 /**
200 * @param {!Array<!WebInspector.SASSSupport.AST>} updated 200 * @param {!Array<!WebInspector.SASSSupport.AST>} updated
201 * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.No de>=} outNodeMapping 201 * @param {!Map<!WebInspector.SASSSupport.Node, !WebInspector.SASSSupport.No de>=} outNodeMapping
202 * @return {?WebInspector.ASTSourceMap} 202 * @return {?WebInspector.ASTSourceMap}
203 */ 203 */
204 rebase: function(updated, outNodeMapping) 204 rebase: function(updated, outNodeMapping)
205 { 205 {
206 outNodeMapping = outNodeMapping || new Map(); 206 outNodeMapping = outNodeMapping || new Map();
207 outNodeMapping.clear(); 207 outNodeMapping.clear();
208 208
209 var models = new Map(this._models); 209 var models = /** @type {!Map<string, !WebInspector.SASSSupport.AST>} */( new Map(this._models));
210 for (var newAST of updated) { 210 for (var newAST of updated) {
211 var oldAST = models.get(newAST.document.url); 211 var oldAST = models.get(newAST.document.url);
212 if (!oldAST.match(newAST, outNodeMapping)) 212 if (!oldAST.match(newAST, outNodeMapping))
213 return null; 213 return null;
214 models.set(newAST.document.url, newAST); 214 models.set(newAST.document.url, newAST);
215 } 215 }
216 216
217 var newMap = new WebInspector.ASTSourceMap(this._cssURL, models); 217 var newMap = new WebInspector.ASTSourceMap(this._cssURL, models);
218 var cssNodes = this._cssToSass.keysArray(); 218 var cssNodes = this._cssToSass.keysArray();
219 for (var i = 0; i < cssNodes.length; ++i) { 219 for (var i = 0; i < cssNodes.length; ++i) {
(...skipping 18 matching lines...) Expand all
238 continue; 238 continue;
239 if (cssNode !== cssNode.parent.name) 239 if (cssNode !== cssNode.parent.name)
240 continue; 240 continue;
241 var sassNode = this._cssToSass.get(cssNode); 241 var sassNode = this._cssToSass.get(cssNode);
242 if (sassNode && cssNode.text.trim() !== sassNode.text.trim()) 242 if (sassNode && cssNode.text.trim() !== sassNode.text.trim())
243 return false; 243 return false;
244 } 244 }
245 return true; 245 return true;
246 } 246 }
247 } 247 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698