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

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

Issue 1349293005: DevTools: slightly cleanup WI.CSSRule interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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/elements/StylesSidebarPane.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/CSSStyleModel.js
diff --git a/Source/devtools/front_end/sdk/CSSStyleModel.js b/Source/devtools/front_end/sdk/CSSStyleModel.js
index ca927eb50c67195b38353c8f5ce92c4201de1113..7eb8d379b63ff3a946c2895ff33e117c4ed80c97 100644
--- a/Source/devtools/front_end/sdk/CSSStyleModel.js
+++ b/Source/devtools/front_end/sdk/CSSStyleModel.js
@@ -1041,7 +1041,6 @@ WebInspector.CSSRule = function(cssModel, payload, matchingSelectors)
this.style.parentRule = this;
if (payload.media)
this.media = WebInspector.CSSMedia.parseMediaArrayPayload(cssModel, payload.media);
- this._setFrameId();
}
/**
@@ -1102,14 +1101,6 @@ WebInspector.CSSRule.prototype = {
this._sourceStyleSheetEditedWithMedia(/** @type {string} */ (oldMedia.parentStyleSheetId), oldMedia.range, newMedia.range, oldMedia, newMedia);
},
- _setFrameId: function()
- {
- if (!this.styleSheetId)
- return;
- var styleSheetHeader = this._cssModel.styleSheetHeaderForId(this.styleSheetId);
- this.frameId = styleSheetHeader.frameId;
- },
-
/**
* @return {string}
*/
@@ -1148,24 +1139,36 @@ WebInspector.CSSRule.prototype = {
return styleSheetHeader.columnNumberInSource(selector.range.startLine, selector.range.startColumn);
},
- get isUserAgent()
+ /**
+ * @return {boolean}
+ */
+ isUserAgent: function()
{
- return this.origin === "user-agent";
+ return this.origin === CSSAgent.StyleSheetOrigin.UserAgent;
},
- get isInjected()
+ /**
+ * @return {boolean}
+ */
+ isInjected: function()
{
- return this.origin === "injected";
+ return this.origin === CSSAgent.StyleSheetOrigin.Injected;
},
- get isViaInspector()
+ /**
+ * @return {boolean}
+ */
+ isViaInspector: function()
{
- return this.origin === "inspector";
+ return this.origin === CSSAgent.StyleSheetOrigin.Inspector;
},
- get isRegular()
+ /**
+ * @return {boolean}
+ */
+ isRegular: function()
{
- return this.origin === "regular";
+ return this.origin === CSSAgent.StyleSheetOrigin.Regular;
}
}
« no previous file with comments | « Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698