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

Delta Between Two Patch Sets: chrome/content/cssProperties.js

Issue 29336406: Issue 3654 - Properly split up selectors when applying CSS property filters (Closed)
Left Patch Set: Created Feb. 15, 2016, 5:17 p.m.
Right Patch Set: Undid unrelated whitespace change Created Feb. 15, 2016, 6:02 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 function splitSelector(selector) 1 function splitSelector(selector)
Sebastian Noack 2016/02/15 17:19:08 This logic has been copied (with some minor change
kzar 2016/02/15 17:30:14 Acknowledged. (Mind filing an issue for that?)
Sebastian Noack 2016/02/15 17:49:31 I attached the patch the same issue: https://coder
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
11 for (var i = 0; i < selector.length; i++) 11 for (var i = 0; i < selector.length; i++)
(...skipping 21 matching lines...) Expand all
33 } 33 }
34 34
35 selectors.push(selector.substring(start)); 35 selectors.push(selector.substring(start));
36 return selectors; 36 return selectors;
37 } 37 }
38 38
39 function CSSPropertyFilters(window, addSelectorsFunc) { 39 function CSSPropertyFilters(window, addSelectorsFunc) {
40 this.window = window; 40 this.window = window;
41 this.addSelectorsFunc = addSelectorsFunc; 41 this.addSelectorsFunc = addSelectorsFunc;
42 } 42 }
43
43 CSSPropertyFilters.prototype = { 44 CSSPropertyFilters.prototype = {
44 stringifyStyle: function(style) 45 stringifyStyle: function(style)
45 { 46 {
46 var styles = []; 47 var styles = [];
47 for (var i = 0; i < style.length; i++) 48 for (var i = 0; i < style.length; i++)
48 { 49 {
49 var property = style.item(i); 50 var property = style.item(i);
50 var value = style.getPropertyValue(property); 51 var value = style.getPropertyValue(property);
51 var priority = style.getPropertyPriority(property); 52 var priority = style.getPropertyPriority(property);
52 styles.push(property + ": " + value + (priority ? " !" + priority : "") + ";"); 53 styles.push(property + ": " + value + (priority ? " !" + priority : "") + ";");
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 apply: function() 120 apply: function()
120 { 121 {
121 if (this.patterns.length > 0) 122 if (this.patterns.length > 0)
122 { 123 {
123 var document = this.window.document; 124 var document = this.window.document;
124 this.addSelectors(document.styleSheets); 125 this.addSelectors(document.styleSheets);
125 document.addEventListener("load", this.onLoad.bind(this), true); 126 document.addEventListener("load", this.onLoad.bind(this), true);
126 } 127 }
127 } 128 }
128 }; 129 };
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld