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

Unified Diff: include.preload.js

Issue 4759827771293696: Issue 2528 - Don't parse CSS selectors that have no comma (Closed)
Patch Set: Created May 15, 2015, 11:32 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
===================================================================
--- a/include.preload.js
+++ b/include.preload.js
@@ -151,23 +151,27 @@
{
var selector = selectors[i];
var start = 0;
- var sep = "";
- for (var j = 0; j < selector.length; j++)
+ if (selector.indexOf(",") != -1)
{
Sebastian Noack 2015/05/15 11:33:49 Changes in this block are only due to indentation.
- var chr = selector[j];
- if (chr == "\\")
- j++;
- else if (chr == sep)
- sep = "";
- else if (sep == "")
+ var sep = "";
+
+ for (var j = 0; j < selector.length; j++)
{
- if (chr == '"' || chr == "'")
- sep = chr;
- else if (chr == ",")
+ var chr = selector[j];
+ if (chr == "\\")
+ j++;
+ else if (chr == sep)
+ sep = "";
+ else if (sep == "")
{
- result.push(prefix + selector.substring(start, j));
- start = j + 1;
+ if (chr == '"' || chr == "'")
+ sep = chr;
+ else if (chr == ",")
+ {
+ result.push(prefix + selector.substring(start, j));
+ start = j + 1;
+ }
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld