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

Unified Diff: Source/devtools/front_end/sdk/Linkifier.js

Issue 404763002: DevTools: Inject styleSheetId in WebInspector.CSSLocation constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased patch 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
« no previous file with comments | « Source/devtools/front_end/sdk/CSSStyleModel.js ('k') | Source/devtools/front_end/sdk/SASSSourceMapping.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/Linkifier.js
diff --git a/Source/devtools/front_end/sdk/Linkifier.js b/Source/devtools/front_end/sdk/Linkifier.js
index 9e25ecc72ac3958e854af0a702440325c586047a..d289526e8e11a373e79269009a25b95ea0fc9a1e 100644
--- a/Source/devtools/front_end/sdk/Linkifier.js
+++ b/Source/devtools/front_end/sdk/Linkifier.js
@@ -196,15 +196,14 @@ WebInspector.Linkifier.prototype = {
},
/**
- * @param {?CSSAgent.StyleSheetId} styleSheetId
* @param {!WebInspector.CSSLocation} rawLocation
* @param {string=} classes
* @return {?Element}
*/
- linkifyCSSLocation: function(styleSheetId, rawLocation, classes)
+ linkifyCSSLocation: function(rawLocation, classes)
{
var anchor = this._createAnchor(classes);
- var liveLocation = rawLocation.createLiveLocation(styleSheetId, this._updateAnchor.bind(this, anchor));
+ var liveLocation = rawLocation.createLiveLocation(this._updateAnchor.bind(this, anchor));
if (!liveLocation)
return null;
this._liveLocationsByTarget.get(rawLocation.target()).push({anchor: anchor, location: liveLocation});
@@ -212,6 +211,20 @@ WebInspector.Linkifier.prototype = {
},
/**
+ * @param {!WebInspector.CSSMedia} media
+ * @return {?Element}
+ */
+ linkifyMedia: function(media)
+ {
+ var location = media.rawLocation();
+ if (location)
+ return this.linkifyCSSLocation(location);
+
+ // The "linkedStylesheet" case.
+ return WebInspector.linkifyResourceAsNode(media.sourceURL, undefined, "subtitle", media.sourceURL);
+ },
+
+ /**
* @param {string=} classes
* @return {!Element}
*/
« no previous file with comments | « Source/devtools/front_end/sdk/CSSStyleModel.js ('k') | Source/devtools/front_end/sdk/SASSSourceMapping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698