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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 } 1029 }
1030 }; 1030 };
1031 1031
1032 SDK.CSSLocation = class { 1032 SDK.CSSLocation = class {
1033 /** 1033 /**
1034 * @param {!SDK.CSSStyleSheetHeader} header 1034 * @param {!SDK.CSSStyleSheetHeader} header
1035 * @param {number} lineNumber 1035 * @param {number} lineNumber
1036 * @param {number=} columnNumber 1036 * @param {number=} columnNumber
1037 */ 1037 */
1038 constructor(header, lineNumber, columnNumber) { 1038 constructor(header, lineNumber, columnNumber) {
1039 this._header = header; 1039 this._cssModel = header.cssModel();
1040 this.styleSheetId = header.id; 1040 this.styleSheetId = header.id;
1041 this.url = header.resourceURL(); 1041 this.url = header.resourceURL();
1042 this.lineNumber = lineNumber; 1042 this.lineNumber = lineNumber;
1043 this.columnNumber = columnNumber || 0; 1043 this.columnNumber = columnNumber || 0;
1044 } 1044 }
1045 1045
1046 /** 1046 /**
1047 * @return {!SDK.CSSModel} 1047 * @return {!SDK.CSSModel}
1048 */ 1048 */
1049 cssModel() { 1049 cssModel() {
1050 return this._header.cssModel(); 1050 return this._cssModel;
1051 } 1051 }
1052 1052
1053 /** 1053 /**
1054 * @return {!SDK.CSSStyleSheetHeader} 1054 * @return {?SDK.CSSStyleSheetHeader}
1055 */ 1055 */
1056 header() { 1056 header() {
1057 return this._header; 1057 return this.styleSheetId ? this._cssModel.styleSheetHeaderForId(this.styleSh eetId) : null;
lushnikov 2017/02/16 02:40:03 don't check for this.styleSheetId
dgozman 2017/02/16 18:25:52 Done.
1058 } 1058 }
1059 }; 1059 };
1060 1060
1061 /** 1061 /**
1062 * @implements {Protocol.CSSDispatcher} 1062 * @implements {Protocol.CSSDispatcher}
1063 * @unrestricted 1063 * @unrestricted
1064 */ 1064 */
1065 SDK.CSSDispatcher = class { 1065 SDK.CSSDispatcher = class {
1066 /** 1066 /**
1067 * @param {!SDK.CSSModel} cssModel 1067 * @param {!SDK.CSSModel} cssModel
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 SDK.CSSModel.InlineStyleResult = class { 1167 SDK.CSSModel.InlineStyleResult = class {
1168 /** 1168 /**
1169 * @param {?SDK.CSSStyleDeclaration} inlineStyle 1169 * @param {?SDK.CSSStyleDeclaration} inlineStyle
1170 * @param {?SDK.CSSStyleDeclaration} attributesStyle 1170 * @param {?SDK.CSSStyleDeclaration} attributesStyle
1171 */ 1171 */
1172 constructor(inlineStyle, attributesStyle) { 1172 constructor(inlineStyle, attributesStyle) {
1173 this.inlineStyle = inlineStyle; 1173 this.inlineStyle = inlineStyle;
1174 this.attributesStyle = attributesStyle; 1174 this.attributesStyle = attributesStyle;
1175 } 1175 }
1176 }; 1176 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698