| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 }; |
| LEFT | RIGHT |