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

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

Issue 29338602: Issue 2401 - Fix checking of CSS rule type in order to be compatible with Firefox (Closed)
Patch Set: Created March 18, 2016, 11:28 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 splitSelector(selector) 1 function splitSelector(selector)
2 { 2 {
3 if (selector.indexOf(",") == -1) 3 if (selector.indexOf(",") == -1)
4 return [selector]; 4 return [selector];
5 5
6 var selectors = []; 6 var selectors = [];
7 var start = 0; 7 var start = 0;
8 var level = 0; 8 var level = 0;
9 var sep = ""; 9 var sep = "";
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 findSelectors: function(stylesheet, selectors) 59 findSelectors: function(stylesheet, selectors)
60 { 60 {
61 var rules = stylesheet.cssRules; 61 var rules = stylesheet.cssRules;
62 if (!rules) 62 if (!rules)
63 return; 63 return;
64 64
65 for (var i = 0; i < rules.length; i++) 65 for (var i = 0; i < rules.length; i++)
66 { 66 {
67 var rule = rules[i]; 67 var rule = rules[i];
68 if (rule.type != this.window.CSSRule.STYLE_RULE) 68 if (rule.type != rule.STYLE_RULE)
69 continue; 69 continue;
70 70
71 var style = this.stringifyStyle(rule.style); 71 var style = this.stringifyStyle(rule.style);
72 for (var j = 0; j < this.patterns.length; j++) 72 for (var j = 0; j < this.patterns.length; j++)
73 { 73 {
74 var pattern = this.patterns[j]; 74 var pattern = this.patterns[j];
75 var regexp = pattern.regexp; 75 var regexp = pattern.regexp;
76 76
77 if (typeof regexp == "string") 77 if (typeof regexp == "string")
78 regexp = pattern.regexp = new RegExp(regexp); 78 regexp = pattern.regexp = new RegExp(regexp);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 apply: function() 120 apply: function()
121 { 121 {
122 if (this.patterns.length > 0) 122 if (this.patterns.length > 0)
123 { 123 {
124 var document = this.window.document; 124 var document = this.window.document;
125 this.addSelectors(document.styleSheets); 125 this.addSelectors(document.styleSheets);
126 document.addEventListener("load", this.onLoad.bind(this), true); 126 document.addEventListener("load", this.onLoad.bind(this), true);
127 } 127 }
128 } 128 }
129 }; 129 };
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