| Index: chrome/content/cssProperties.js |
| =================================================================== |
| --- a/chrome/content/cssProperties.js |
| +++ b/chrome/content/cssProperties.js |
| @@ -31,18 +31,20 @@ function splitSelector(selector) |
| } |
| } |
| } |
| selectors.push(selector.substring(start)); |
| return selectors; |
| } |
| -function CSSPropertyFilters(window, addSelectorsFunc) { |
| +function CSSPropertyFilters(window, getFiltersFunc, addSelectorsFunc) |
| +{ |
| this.window = window; |
| + this.getFiltersFunc = getFiltersFunc; |
| this.addSelectorsFunc = addSelectorsFunc; |
| } |
| CSSPropertyFilters.prototype = { |
| stringifyStyle: function(style) |
| { |
| var styles = []; |
| for (var i = 0; i < style.length; i++) |
| @@ -117,27 +119,21 @@ CSSPropertyFilters.prototype = { |
| { |
| var stylesheet = event.target.sheet; |
| if (stylesheet) |
| this.addSelectors([stylesheet]); |
| }, |
| load: function(callback) |
| { |
| - ext.backgroundPage.sendMessage( |
| - { |
| - type: "filters.get", |
| - what: "cssproperties" |
| - }, |
| - function(patterns) |
| - { |
| - this.patterns = patterns; |
| - callback(); |
| - }.bind(this) |
| - ); |
| + this.getFiltersFunc(function(patterns) |
| + { |
| + this.patterns = patterns; |
| + callback(); |
| + }.bind(this)); |
| }, |
| apply: function() |
| { |
| if (this.patterns.length > 0) |
| { |
| var document = this.window.document; |
| this.addSelectors(document.styleSheets); |