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

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

Issue 2693383003: [DevTools] Refactor CSS live locations. (Closed)
Patch Set: Created 3 years, 10 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: third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js
index 25421fcfd9d585865a6d8e0982eb98e5f7f86814..974908e112743a7b506121e99bd9c2b395c3cc5c 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js
@@ -1036,7 +1036,7 @@ SDK.CSSLocation = class {
* @param {number=} columnNumber
*/
constructor(header, lineNumber, columnNumber) {
- this._header = header;
+ this._cssModel = header.cssModel();
this.styleSheetId = header.id;
this.url = header.resourceURL();
this.lineNumber = lineNumber;
@@ -1047,14 +1047,14 @@ SDK.CSSLocation = class {
* @return {!SDK.CSSModel}
*/
cssModel() {
- return this._header.cssModel();
+ return this._cssModel;
}
/**
- * @return {!SDK.CSSStyleSheetHeader}
+ * @return {?SDK.CSSStyleSheetHeader}
*/
header() {
- return this._header;
+ return this.styleSheetId ? this._cssModel.styleSheetHeaderForId(this.styleSheetId) : null;
lushnikov 2017/02/16 02:40:03 don't check for this.styleSheetId
dgozman 2017/02/16 18:25:52 Done.
}
};

Powered by Google App Engine
This is Rietveld 408576698