OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 function CSS(domAgent) { |
| 3 this.domAgent_ = domAgent; |
| 4 } |
| 5 |
| 6 CSS.prototype.enable = function() { |
| 7 }; |
| 8 |
| 9 CSS.prototype.getInlineStylesForNode = function(params) { |
| 10 return { |
| 11 "inlineStyle": { |
| 12 "cssProperties": [], |
| 13 "shorthandEntries": [], |
| 14 "styleSheetId": "0", |
| 15 "range": { |
| 16 "startLine": 0, |
| 17 "startColumn": 0, |
| 18 "endLine": 0, |
| 19 "endColumn": 0 |
| 20 }, |
| 21 "cssText": "", |
| 22 } |
| 23 } |
| 24 } |
| 25 |
| 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 this.exports = CSS; |
| 51 </script> |
OLD | NEW |