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

Unified Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 404763002: DevTools: Inject styleSheetId in WebInspector.CSSLocation constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/elements/StylesSidebarPane.js
diff --git a/Source/devtools/front_end/elements/StylesSidebarPane.js b/Source/devtools/front_end/elements/StylesSidebarPane.js
index b00fb3c486c31603d884cc0eace4d9cb67fb8470..86a519d01177e9d260fa48146fb0a98a07113ce5 100644
--- a/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -1195,14 +1195,14 @@ WebInspector.StylePropertiesSection.prototype = {
var lineNumber = media.lineNumberInSource();
var columnNumber = media.columnNumberInSource();
console.assert(typeof lineNumber !== "undefined" && typeof columnNumber !== "undefined");
- rawLocation = new WebInspector.CSSLocation(this._parentPane._target, media.sourceURL, lineNumber, columnNumber);
+ rawLocation = new WebInspector.CSSLocation(this._parentPane._target, mediaHeader.id, media.sourceURL, lineNumber, columnNumber);
}
}
var anchor;
- if (rawLocation)
- anchor = this._parentPane._linkifier.linkifyCSSLocation(mediaHeader.id, rawLocation);
- else {
+ if (rawLocation) {
+ anchor = this._parentPane._linkifier.linkifyCSSLocation(rawLocation);
+ } else {
// The "linkedStylesheet" case.
anchor = WebInspector.linkifyResourceAsNode(media.sourceURL, undefined, "subtitle", media.sourceURL);
}
@@ -1448,7 +1448,6 @@ WebInspector.StylePropertiesSection.prototype = {
var isSelectorMatching = matchingSelectors[currentMatch] === i;
if (isSelectorMatching)
++currentMatch;
- var rawLocation = new WebInspector.CSSLocation(this._parentPane._target, rule.sourceURL, rule.lineNumberInSource(i), rule.columnNumberInSource(i));
var matchingSelectorClass = isSelectorMatching ? " selector-matches" : "";
var selectorElement = document.createElement("span");
selectorElement.className = "simple-selector" + matchingSelectorClass;
@@ -1523,8 +1522,8 @@ WebInspector.StylePropertiesSection.prototype = {
if (this.styleRule.sourceURL) {
var firstMatchingIndex = this.styleRule.rule.matchingSelectors && this.rule.matchingSelectors.length ? this.rule.matchingSelectors[0] : 0;
- var matchingSelectorLocation = new WebInspector.CSSLocation(this._parentPane._target, this.styleRule.sourceURL, this.rule.lineNumberInSource(firstMatchingIndex), this.rule.columnNumberInSource(firstMatchingIndex));
- return this._parentPane._linkifier.linkifyCSSLocation(this.rule.styleSheetId, matchingSelectorLocation) || linkifyUncopyable(this.styleRule.sourceURL, this.rule.lineNumberInSource());
+ var matchingSelectorLocation = new WebInspector.CSSLocation(this._parentPane._target, this.rule.styleSheetId, this.styleRule.sourceURL, this.rule.lineNumberInSource(firstMatchingIndex), this.rule.columnNumberInSource(firstMatchingIndex));
+ return this._parentPane._linkifier.linkifyCSSLocation(matchingSelectorLocation) || linkifyUncopyable(this.styleRule.sourceURL, this.rule.lineNumberInSource());
}
if (!this.rule)

Powered by Google App Engine
This is Rietveld 408576698