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

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

Issue 1944593002: DevTools: [SASS] extract exact property name and value ranges (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2-switch-css
Patch Set: Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/gonzales/SCSSParser.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * @implements {WebInspector.SourceMapFactory} 7 * @implements {WebInspector.SourceMapFactory}
8 */ 8 */
9 WebInspector.SASSSourceMapFactory = function() 9 WebInspector.SASSSourceMapFactory = function()
10 { 10 {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 map.compiledModel().visit(onNode); 63 map.compiledModel().visit(onNode);
64 return valid ? map : null; 64 return valid ? map : null;
65 65
66 /** 66 /**
67 * @param {!WebInspector.SASSSupport.Node} cssNode 67 * @param {!WebInspector.SASSSupport.Node} cssNode
68 */ 68 */
69 function onNode(cssNode) 69 function onNode(cssNode)
70 { 70 {
71 if (!(cssNode instanceof WebInspector.SASSSupport.TextNode)) 71 if (!(cssNode instanceof WebInspector.SASSSupport.TextNode))
72 return; 72 return;
73 var entry = sourceMap.findEntry(cssNode.range.endLine, cssNode.range .endColumn); 73 var entry = sourceMap.findEntry(cssNode.range.startLine, cssNode.ran ge.startColumn);
74 if (!entry || !entry.sourceURL || typeof entry.sourceLineNumber === "undefined" || typeof entry.sourceColumnNumber === "undefined") 74 if (!entry || !entry.sourceURL || typeof entry.sourceLineNumber === "undefined" || typeof entry.sourceColumnNumber === "undefined")
75 return; 75 return;
76 var sassAST = models.get(entry.sourceURL); 76 var sassAST = models.get(entry.sourceURL);
77 if (!sassAST) 77 if (!sassAST)
78 return; 78 return;
79 var sassNode = sassAST.findNodeForPosition(entry.sourceLineNumber, e ntry.sourceColumnNumber); 79 var sassNode = sassAST.findNodeForPosition(entry.sourceLineNumber, e ntry.sourceColumnNumber);
80 if (!sassNode) 80 if (!sassNode)
81 return; 81 return;
82 if (cssNode.parent && (cssNode.parent instanceof WebInspector.SASSSu pport.Property) && cssNode === cssNode.parent.name) 82 if (cssNode.parent && (cssNode.parent instanceof WebInspector.SASSSu pport.Property) && cssNode === cssNode.parent.name)
83 valid = valid && cssNode.text.trim() === sassNode.text.trim(); 83 valid = valid && cssNode.text.trim() === sassNode.text.trim();
84 map.addMapping(cssNode, sassNode); 84 map.addMapping(cssNode, sassNode);
85 } 85 }
86 }, 86 },
87 } 87 }
88 88
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/gonzales/SCSSParser.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698