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

Side by Side Diff: sky/framework/inspector/css-agent.sky

Issue 837933003: Convert the inspector framework to use ES6 classes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Remove empty ctors Created 5 years, 11 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
« no previous file with comments | « sky/framework/inspector/console-agent.sky ('k') | sky/framework/inspector/dom-agent.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <script> 1 <script>
2 function CSS(domAgent) { 2 class CSS {
3 this.domAgent_ = domAgent; 3 constructor(domAgent) {
4 } 4 this.domAgent_ = domAgent;
esprehn 2015/01/14 02:03:22 Object.preventExtensions(this);
5 }
5 6
6 CSS.prototype.enable = function() { 7 enable() {
7 }; 8 }
8 9
9 CSS.prototype.getInlineStylesForNode = function(params) { 10 getInlineStylesForNode(params) {
10 return { 11 return {
11 "inlineStyle": { 12 "inlineStyle": {
12 "cssProperties": [], 13 "cssProperties": [],
13 "shorthandEntries": [], 14 "shorthandEntries": [],
14 "styleSheetId": "0", 15 "styleSheetId": "0",
15 "range": { 16 "range": {
16 "startLine": 0, 17 "startLine": 0,
17 "startColumn": 0, 18 "startColumn": 0,
18 "endLine": 0, 19 "endLine": 0,
19 "endColumn": 0 20 "endColumn": 0
20 }, 21 },
21 "cssText": "", 22 "cssText": "",
23 }
24 };
25 }
26
27 getComputedStyleForNode(params) {
28 var node = this.domAgent_.getNodeForId(params.nodeId);
29 if (!node){
30 console.log("Error, missing node" + params.nodeId);
31 return { "computedStyle": [] };
22 } 32 }
33 var style = window.getComputedStyle(node, null);
34 if (!style){
35 console.log("Error, no computed style for " + params.nodeId + " " + node);
36 return { "computedStyle": [] };
37 }
38 var computedStyles = [];
39 for (var i = 0; i < style.length; i++) {
40 var name = style.item(i);
41 computedStyles.push({
42 "name": name,
43 "value": style.getPropertyValue(name),
44 });
45 }
46 return {
47 "computedStyle": computedStyles,
48 };
23 } 49 }
24 } 50 }
25 51
26 CSS.prototype.getComputedStyleForNode = function(params) {
27 var node = this.domAgent_.getNodeForId(params.nodeId);
28 if (!node){
29 console.log("Error, missing node" + params.nodeId);
30 return { "computedStyle": [] };
31 }
32 var style = window.getComputedStyle(node, null);
33 if (!style){
34 console.log("Error, no computed style for " + params.nodeId + " " + node);
35 return { "computedStyle": [] };
36 }
37 var computedStyles = [];
38 for (var i = 0; i < style.length; i++) {
39 var name = style.item(i);
40 computedStyles.push({
41 "name": name,
42 "value": style.getPropertyValue(name),
43 });
44 }
45 return {
46 "computedStyle": computedStyles,
47 }
48 }
49
50 module.exports = CSS; 52 module.exports = CSS;
51 </script> 53 </script>
OLDNEW
« no previous file with comments | « sky/framework/inspector/console-agent.sky ('k') | sky/framework/inspector/dom-agent.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698