OLD | NEW |
| (Empty) |
1 <script> | |
2 class CSS { | |
3 constructor(domAgent) { | |
4 this.domAgent_ = domAgent; | |
5 Object.preventExtensions(this); | |
6 } | |
7 | |
8 enable() { | |
9 } | |
10 | |
11 getInlineStylesForNode(params) { | |
12 return { | |
13 "inlineStyle": { | |
14 "cssProperties": [], | |
15 "shorthandEntries": [], | |
16 "styleSheetId": "0", | |
17 "range": { | |
18 "startLine": 0, | |
19 "startColumn": 0, | |
20 "endLine": 0, | |
21 "endColumn": 0 | |
22 }, | |
23 "cssText": "", | |
24 } | |
25 }; | |
26 } | |
27 | |
28 getComputedStyleForNode(params) { | |
29 var node = this.domAgent_.getNodeForId(params.nodeId); | |
30 if (!node){ | |
31 console.log("Error, missing node" + params.nodeId); | |
32 return { "computedStyle": [] }; | |
33 } | |
34 var style = window.getComputedStyle(node, null); | |
35 if (!style){ | |
36 console.log("Error, no computed style for " + params.nodeId + " " + node); | |
37 return { "computedStyle": [] }; | |
38 } | |
39 var computedStyles = []; | |
40 for (var i = 0; i < style.length; i++) { | |
41 var name = style.item(i); | |
42 computedStyles.push({ | |
43 "name": name, | |
44 "value": style.getPropertyValue(name), | |
45 }); | |
46 } | |
47 return { | |
48 "computedStyle": computedStyles, | |
49 }; | |
50 } | |
51 } | |
52 | |
53 module.exports = CSS; | |
54 </script> | |
OLD | NEW |