Chromium Code Reviews| Index: sky/framework/inspector/css-agent.sky |
| diff --git a/sky/framework/inspector/css-agent.sky b/sky/framework/inspector/css-agent.sky |
| index c9d31a1cadf9f0af0cee063a23ca6ae76111a05b..83911b990e1a2485ffcd78f9c228e322a1174d75 100644 |
| --- a/sky/framework/inspector/css-agent.sky |
| +++ b/sky/framework/inspector/css-agent.sky |
| @@ -1,49 +1,51 @@ |
| <script> |
| -function CSS(domAgent) { |
| - this.domAgent_ = domAgent; |
| -} |
| +class CSS { |
| + constructor(domAgent) { |
| + this.domAgent_ = domAgent; |
|
esprehn
2015/01/14 02:03:22
Object.preventExtensions(this);
|
| + } |
| -CSS.prototype.enable = function() { |
| -}; |
| + enable() { |
| + } |
| -CSS.prototype.getInlineStylesForNode = function(params) { |
| - return { |
| + getInlineStylesForNode(params) { |
| + return { |
| "inlineStyle": { |
| - "cssProperties": [], |
| - "shorthandEntries": [], |
| - "styleSheetId": "0", |
| - "range": { |
| - "startLine": 0, |
| - "startColumn": 0, |
| - "endLine": 0, |
| - "endColumn": 0 |
| - }, |
| - "cssText": "", |
| - } |
| + "cssProperties": [], |
| + "shorthandEntries": [], |
| + "styleSheetId": "0", |
| + "range": { |
| + "startLine": 0, |
| + "startColumn": 0, |
| + "endLine": 0, |
| + "endColumn": 0 |
| + }, |
| + "cssText": "", |
| + } |
| + }; |
| } |
| -} |
| -CSS.prototype.getComputedStyleForNode = function(params) { |
| - var node = this.domAgent_.getNodeForId(params.nodeId); |
| - if (!node){ |
| - console.log("Error, missing node" + params.nodeId); |
| - return { "computedStyle": [] }; |
| - } |
| - var style = window.getComputedStyle(node, null); |
| - if (!style){ |
| - console.log("Error, no computed style for " + params.nodeId + " " + node); |
| - return { "computedStyle": [] }; |
| - } |
| - var computedStyles = []; |
| - for (var i = 0; i < style.length; i++) { |
| - var name = style.item(i); |
| - computedStyles.push({ |
| - "name": name, |
| - "value": style.getPropertyValue(name), |
| - }); |
| - } |
| - return { |
| - "computedStyle": computedStyles, |
| + getComputedStyleForNode(params) { |
| + var node = this.domAgent_.getNodeForId(params.nodeId); |
| + if (!node){ |
| + console.log("Error, missing node" + params.nodeId); |
| + return { "computedStyle": [] }; |
| + } |
| + var style = window.getComputedStyle(node, null); |
| + if (!style){ |
| + console.log("Error, no computed style for " + params.nodeId + " " + node); |
| + return { "computedStyle": [] }; |
| + } |
| + var computedStyles = []; |
| + for (var i = 0; i < style.length; i++) { |
| + var name = style.item(i); |
| + computedStyles.push({ |
| + "name": name, |
| + "value": style.getPropertyValue(name), |
| + }); |
| + } |
| + return { |
| + "computedStyle": computedStyles, |
| + }; |
| } |
| } |