diff options
author | pfeldman <pfeldman@chromium.org> | 2015-12-14 16:19:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-15 00:20:43 +0000 |
commit | 80b21c78d9b898185a0da875a95079bfb392865f (patch) | |
tree | 36eb854a51b21c1c366e0ff3ae61c2be1825830e /third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js | |
parent | 8525c868f0b175ee926751857c8a47593e0ee4e8 (diff) | |
download | chromium_src-80b21c78d9b898185a0da875a95079bfb392865f.zip chromium_src-80b21c78d9b898185a0da875a95079bfb392865f.tar.gz chromium_src-80b21c78d9b898185a0da875a95079bfb392865f.tar.bz2 |
DevTools: refactor CSSLocation to be based on the header, not id.
BUG=569457
NOTRY=true
Review URL: https://codereview.chromium.org/1521333002
Cr-Commit-Position: refs/heads/master@{#365130}
Diffstat (limited to 'third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js')
-rw-r--r-- | third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js index ec4c6aa..540e7d2 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js @@ -628,18 +628,16 @@ WebInspector.CSSStyleModel.prototype = { /** * @constructor * @extends {WebInspector.SDKObject} - * @param {!WebInspector.CSSStyleModel} cssModel - * @param {!CSSAgent.StyleSheetId} styleSheetId - * @param {string} url + * @param {!WebInspector.CSSStyleSheetHeader} header * @param {number} lineNumber * @param {number=} columnNumber */ -WebInspector.CSSLocation = function(cssModel, styleSheetId, url, lineNumber, columnNumber) +WebInspector.CSSLocation = function(header, lineNumber, columnNumber) { - WebInspector.SDKObject.call(this, cssModel.target()); - this._cssModel = cssModel; - this.styleSheetId = styleSheetId; - this.url = url; + WebInspector.SDKObject.call(this, header.target()); + this._header = header; + this.styleSheetId = header.id; + this.url = header.resourceURL(); this.lineNumber = lineNumber; this.columnNumber = columnNumber || 0; } @@ -650,7 +648,7 @@ WebInspector.CSSLocation.prototype = { */ cssModel: function() { - return this._cssModel; + return this._header.cssModel(); }, __proto__: WebInspector.SDKObject.prototype @@ -1741,10 +1739,11 @@ WebInspector.CSSMedia.prototype = { */ rawLocation: function() { - if (!this.header() || this.lineNumberInSource() === undefined) + var header = this.header(); + if (!header || this.lineNumberInSource() === undefined) return null; var lineNumber = Number(this.lineNumberInSource()); - return new WebInspector.CSSLocation(this._cssModel, this.header().id, this.sourceURL, lineNumber, this.columnNumberInSource()); + return new WebInspector.CSSLocation(header, lineNumber, this.columnNumberInSource()); } } |