Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure Google Closure advanced magnification doesn't step on its o…

…wn toes.

Keys need to be replaced in css files in decreasing length.
  • Loading branch information...
commit 94051fe54d442e36398fab3ff3dda6f1bb2b2d70 1 parent 7e8c4fa
jordan authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 projectManager/stockResources/BuildProject.js
View
5 projectManager/stockResources/BuildProject.js
@@ -246,11 +246,12 @@ function compile(buildSpecs) {
// file, then yanking out the styleExports - but that would be very very slow. This is just
// string replacement. Store the rename maps by length so that we can easily replace them
// in css without having problems where class names are prefixes of other class names -
- // we start at the longest class names and work our way to the shorter ones.
+ // we start at the shortest class names and work our way to the longer
+ // ones so that we don't "reclobber" something that was just renamed.
buildAdvancedRenameKeysForAppropriateCssUsage(buildSpecs, function(cssAppropriateKeyRenameMap) {
var subsetByOriginalSymbLength = orderKeyRenameMapByOriginalSymbolLength(cssAppropriateKeyRenameMap);
var styleSheetTransformer = function(styleSheet) {
- for (var keyLen = subsetByOriginalSymbLength.length - 1; keyLen >= 0; keyLen--) {
+ for (var keyLen = 0; keyLen < subsetByOriginalSymbLength.length; keyLen++) {
var renameMap = subsetByOriginalSymbLength[keyLen];
for (var symbol in renameMap) {
styleSheet = replaceAll(styleSheet, '.'+symbol + ' ', '.'+renameMap[symbol] + ' ');
Please sign in to comment.
Something went wrong with that request. Please try again.