Renames `noAggressiveMerging` option into `aggressiveMerging`.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Fri, 10 Oct 2014 06:35:33 +0000 (07:35 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Fri, 10 Oct 2014 20:28:49 +0000 (21:28 +0100)
History.md
README.md
bin/cleancss
lib/clean.js
test/integration-test.js

index 4cbb4b1..bc9d9d7 100644 (file)
@@ -6,6 +6,7 @@
 * Reworks minification to tokenize first then minify.
   See [changes](https://github.com/jakubpawlowicz/clean-css/compare/b06f37d...dd8c14a).
 * Renames `noAdvanced` option into `advanced`.
+* Renames `noAggressiveMerging` option into `aggressiveMerging`.
 * Speeds up advanced processing by shortening optimize loop.
 * Fixed issue [#360](https://github.com/GoalSmashers/clean-css/issues/360) - adds 7 extra CSS colors.
 
index 6591391..6e11e2f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -31,6 +31,7 @@ npm install clean-css
 #### Module interface
 
 * `noAdvanced` became `advanced` - make sure to reverse the value;
+* `noAggressiveMerging` became `aggressiveMerging` - make sure to reverse the value;
 * no longer possible to use `CleanCSS` as a function as `new CleanCSS` is always required;
 
 ### How to upgrade clean-css from 1.x to 2.x?
@@ -131,13 +132,13 @@ CleanCSS constructor accepts a hash as a parameter, i.e.,
 `new CleanCSS(options).minify(source)` with the following options available:
 
 * `advanced` - set to false to disable advanced optimizations - selector & property merging, reduction, etc.
+* `aggressiveMerging` - set to false to disable aggressive merging of properties.
 * `benchmark` - turns on benchmarking mode measuring time spent on cleaning up (run `npm run bench` to see example)
 * `compatibility` - Force compatibility mode to `ie7` or `ie8`. Defaults to not set.
 * `debug` - set to true to get minification statistics under `stats` property (see `test/custom-test.js` for examples)
 * `inliner` - a hash of options for `@import` inliner, see test/protocol-imports-test.js for examples
 * `keepBreaks` - whether to keep line breaks (default is false)
 * `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one only, `0` for removing all
-* `noAggressiveMerging` - set to true to disable aggressive merging of properties.
 * `noRebase` - whether to skip URLs rebasing
 * `processImport` - whether to process `@import` rules
 * `relativeTo` - path to __resolve__ relative `@import` rules and URLs
index ace2f25..ef94f66 100755 (executable)
@@ -77,7 +77,7 @@ if (commands.skipRebase)
 if (commands.skipAdvanced)
   cleanOptions.advanced = false;
 if (commands.skipAggressiveMerging)
-  cleanOptions.noAggressiveMerging = true;
+  cleanOptions.aggressiveMerging = false;
 if (commands.compatibility)
   cleanOptions.compatibility = commands.compatibility;
 if (commands.roundingPrecision !== undefined)
index c6712aa..791e170 100644 (file)
@@ -19,13 +19,13 @@ var CleanCSS = module.exports = function CleanCSS(options) {
 
   this.options = {
     advanced: options.advanced === undefined ? true : false,
+    aggressiveMerging: undefined === options.aggressiveMerging ? true : false,
     benchmark: options.benchmark,
     compatibility: options.compatibility,
     debug: options.debug,
     inliner: options.inliner,
     keepBreaks: options.keepBreaks || false,
     keepSpecialComments: 'keepSpecialComments' in options ? options.keepSpecialComments : '*',
-    noAggressiveMerging: options.noAggressiveMerging,
     noRebase: options.noRebase,
     processImport: undefined === options.processImport ? true : false,
     relativeTo: options.relativeTo,
@@ -120,7 +120,7 @@ function minify(data) {
     keepBreaks: options.keepBreaks,
     advanced: options.advanced,
     compatibility: options.compatibility,
-    aggressiveMerging: !options.noAggressiveMerging,
+    aggressiveMerging: options.aggressiveMerging,
     roundingPrecision: options.roundingPrecision
   }, context);
 
index 1eef650..636a91f 100644 (file)
@@ -1594,7 +1594,7 @@ title']{display:block}",
       'a{background:red;display:block;background:white}',
       'a{display:block;background:#fff}'
     ]
-  }, { noAggressiveMerging: true }),
+  }, { aggressiveMerging: false }),
   'same selectors': cssContext({
     'of two non-adjacent selectors': '.one{color:red}.two{color:#00f}.one{font-weight:700}',
     'of two adjacent single selectors': [