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

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

Issue 662523003: Add a very minimal CSSAgent (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
(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>
OLDNEW
« no previous file with comments | « no previous file | sky/framework/inspector/debug.sky » ('j') | sky/tests/inspector/css-computed-style.sky » ('J')

Powered by Google App Engine
This is Rietveld 408576698