Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: chrome/content/cssProperties.js

Issue 29332572: Issue 2397 - Remove redundant load + apply calls (Closed)
Patch Set: Created Dec. 12, 2015, 9:42 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld