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

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

Issue 2371133003: [Devtools] Lazily build reverse mappings (Closed)
Patch Set: Comments were addressed Created 4 years, 2 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 this.dispatchEventToListeners(WebInspector.CSSModel.Events.SourceMap Attached, header); 205 this.dispatchEventToListeners(WebInspector.CSSModel.Events.SourceMap Attached, header);
206 } 206 }
207 }, 207 },
208 208
209 /** 209 /**
210 * @param {!WebInspector.SourceMap} sourceMap 210 * @param {!WebInspector.SourceMap} sourceMap
211 * @return {?Runtime.Extension} 211 * @return {?Runtime.Extension}
212 */ 212 */
213 _factoryForSourceMap: function(sourceMap) 213 _factoryForSourceMap: function(sourceMap)
214 { 214 {
215 var sourceExtensions = new Set(sourceMap.sourceURLs().map(url => WebInsp ector.ParsedURL.extractExtension(url))); 215 var sourceExtensions = new Set();
216 for (var url of sourceMap.sourceURLs())
217 sourceExtensions.add(WebInspector.ParsedURL.extractExtension(url));
216 for (var runtimeExtension of self.runtime.extensions(WebInspector.Source MapFactory)) { 218 for (var runtimeExtension of self.runtime.extensions(WebInspector.Source MapFactory)) {
217 var supportedExtensions = new Set(runtimeExtension.descriptor()["ext ensions"]); 219 var supportedExtensions = new Set(runtimeExtension.descriptor()["ext ensions"]);
218 if (supportedExtensions.containsAll(sourceExtensions)) 220 if (supportedExtensions.containsAll(sourceExtensions))
219 return runtimeExtension; 221 return runtimeExtension;
220 } 222 }
221 return null; 223 return null;
222 }, 224 },
223 225
224 /** 226 /**
225 * @param {!WebInspector.CSSStyleSheetHeader} header 227 * @param {!WebInspector.CSSStyleSheetHeader} header
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 /** 1231 /**
1230 * @constructor 1232 * @constructor
1231 * @param {?WebInspector.CSSStyleDeclaration} inlineStyle 1233 * @param {?WebInspector.CSSStyleDeclaration} inlineStyle
1232 * @param {?WebInspector.CSSStyleDeclaration} attributesStyle 1234 * @param {?WebInspector.CSSStyleDeclaration} attributesStyle
1233 */ 1235 */
1234 WebInspector.CSSModel.InlineStyleResult = function(inlineStyle, attributesStyle) 1236 WebInspector.CSSModel.InlineStyleResult = function(inlineStyle, attributesStyle)
1235 { 1237 {
1236 this.inlineStyle = inlineStyle; 1238 this.inlineStyle = inlineStyle;
1237 this.attributesStyle = attributesStyle; 1239 this.attributesStyle = attributesStyle;
1238 } 1240 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698