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

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

Issue 29362481: Issue 4600 - Change CSS property matching to be case insensitive (Closed) Base URL: https://bitbucket.org/fhd/adblockpluscore
Patch Set: Created Nov. 11, 2016, 4:52 p.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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (rule.type != rule.STYLE_RULE) 88 if (rule.type != rule.STYLE_RULE)
89 continue; 89 continue;
90 90
91 var style = this.stringifyStyle(rule.style); 91 var style = this.stringifyStyle(rule.style);
92 for (var j = 0; j < this.patterns.length; j++) 92 for (var j = 0; j < this.patterns.length; j++)
93 { 93 {
94 var pattern = this.patterns[j]; 94 var pattern = this.patterns[j];
95 var regexp = pattern.regexp; 95 var regexp = pattern.regexp;
96 96
97 if (typeof regexp == "string") 97 if (typeof regexp == "string")
98 regexp = pattern.regexp = new RegExp(regexp); 98 regexp = pattern.regexp = new RegExp(regexp, "i");
99 99
100 if (regexp.test(style)) 100 if (regexp.test(style))
101 { 101 {
102 var subSelectors = splitSelector(rule.selectorText); 102 var subSelectors = splitSelector(rule.selectorText);
103 for (var k = 0; k < subSelectors.length; k++) 103 for (var k = 0; k < subSelectors.length; k++)
104 selectors.push(pattern.prefix + subSelectors[k] + pattern.suffix); 104 selectors.push(pattern.prefix + subSelectors[k] + pattern.suffix);
105 filters[pattern.text] = true; 105 filters[pattern.text] = true;
106 } 106 }
107 } 107 }
108 } 108 }
(...skipping 27 matching lines...) Expand all
136 apply: function() 136 apply: function()
137 { 137 {
138 if (this.patterns.length > 0) 138 if (this.patterns.length > 0)
139 { 139 {
140 var document = this.window.document; 140 var document = this.window.document;
141 this.addSelectors(document.styleSheets); 141 this.addSelectors(document.styleSheets);
142 document.addEventListener("load", this.onLoad.bind(this), true); 142 document.addEventListener("load", this.onLoad.bind(this), true);
143 } 143 }
144 } 144 }
145 }; 145 };
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