OLD | NEW |
1 function CSSPropertyFilters(window, addSelectorsFunc) { | 1 function CSSPropertyFilters(window, addSelectorsFunc) { |
2 this.window = window; | 2 this.window = window; |
3 this.addSelectorsFunc = addSelectorsFunc; | 3 this.addSelectorsFunc = addSelectorsFunc; |
4 this.load(this.apply.bind(this)); | |
5 } | 4 } |
6 | 5 |
7 CSSPropertyFilters.prototype = { | 6 CSSPropertyFilters.prototype = { |
8 stringifyStyle: function(style) | 7 stringifyStyle: function(style) |
9 { | 8 { |
10 var styles = []; | 9 var styles = []; |
11 for (var i = 0; i < style.length; i++) | 10 for (var i = 0; i < style.length; i++) |
12 { | 11 { |
13 var property = style.item(i); | 12 var property = style.item(i); |
14 var value = style.getPropertyValue(property); | 13 var value = style.getPropertyValue(property); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 apply: function() | 78 apply: function() |
80 { | 79 { |
81 if (this.patterns.length > 0) | 80 if (this.patterns.length > 0) |
82 { | 81 { |
83 var document = this.window.document; | 82 var document = this.window.document; |
84 this.addSelectors(document.styleSheets); | 83 this.addSelectors(document.styleSheets); |
85 document.addEventListener("load", this.onLoad.bind(this), true); | 84 document.addEventListener("load", this.onLoad.bind(this), true); |
86 } | 85 } |
87 } | 86 } |
88 }; | 87 }; |
OLD | NEW |