Fixes #405 - background-size merging is off by default.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Thu, 18 Dec 2014 00:35:38 +0000 (00:35 +0000)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Thu, 18 Dec 2014 00:35:38 +0000 (00:35 +0000)
* That's to remedy issues in Chrome and older versions of Safari and stock Android browsers.
* If not for Chrome's issue then it would have been left on by default.

History.md
lib/utils/compatibility.js
test/fixtures/issue-312-min.css
test/integration-test.js
test/utils/compatibility-test.js

index 319f0e9..0998e3f 100644 (file)
@@ -27,6 +27,7 @@
 * Fixed issue [#400](https://github.com/GoalSmashers/clean-css/issues/400) - API to accept an array of filenames.
 * Fixed issue [#403](https://github.com/GoalSmashers/clean-css/issues/403) - tracking input files in source maps.
 * Fixed issue [#404](https://github.com/GoalSmashers/clean-css/issues/404) - no state sharing in API.
+* Fixed issue [#405](https://github.com/GoalSmashers/clean-css/issues/405) - disables default background-size merging.
 * Refixed issue [#304](https://github.com/GoalSmashers/clean-css/issues/304) - background position merging.
 
 [2.2.19 / 2014-11-20](https://github.com/jakubpawlowicz/clean-css/compare/v2.2.18...v2.2.19)
index 9f4cc6c..eaad4fa 100644 (file)
@@ -6,7 +6,7 @@ var DEFAULTS = {
       opacity: true // rgba / hsla
     },
     properties: {
-      backgroundSizeMerging: true, // background-size to shorthand
+      backgroundSizeMerging: false, // background-size to shorthand
       iePrefixHack: false, // underscore / asterisk prefix hacks on IE
       ieSuffixHack: false, // \9 suffix hacks on IE
       merging: true // merging properties into one
index cf91df9..84699e1 100644 (file)
@@ -1 +1 @@
-.envelope{background:url(one.png) top center/35px 4px repeat-x,url(one.png) bottom center/35px 4px repeat-x,url(two.png) 110% 10px/101px 61px no-repeat #eee}
+.envelope{background:url(one.png) top center repeat-x,url(one.png) bottom center repeat-x,url(two.png) 110% 10px no-repeat #eee;background-size:35px 4px,35px 4px,101px 61px}
\ No newline at end of file
index 7f6fff7..d7fcbae 100644 (file)
@@ -2195,13 +2195,15 @@ title']{display:block}",
     ],
     'with background-size property': [
       'a{background:none;background-image:url(1.png);background-size:28px 28px}',
-      'a{background:url(1.png) 0 0/28px 28px}'
+      'a{background:url(1.png);background-size:28px 28px}'
     ]
   }),
-  'background size with -properties.backgroundSizeMerging': cssContext({
-    'standard': 'div{background:url(image.png) center no-repeat;background-size:cover}',
-    'prefix': 'div{-webkit-background:url(image.png) center no-repeat;-webkit-background-size:cover}'
-  }, { compatibility: '-properties.backgroundSizeMerging' }),
+  'background size with +properties.backgroundSizeMerging': cssContext({
+    'with background-size property': [
+      'a{background:none;background-image:url(1.png);background-size:28px 28px}',
+      'a{background:url(1.png) 0 0/28px 28px}'
+    ]
+  }, { compatibility: '+properties.backgroundSizeMerging' }),
   'multiple backgrounds': cssContext({
     'should not produce longer values': 'p{background:no-repeat;background-position:100% 0,0 100%,100% 100%,50% 50%}'
   }),
index c74c370..48cd5cc 100644 (file)
@@ -10,7 +10,7 @@ vows.describe(Compatibility)
         assert.isFalse(options.properties.iePrefixHack);
         assert.isFalse(options.properties.ieSuffixHack);
         assert.isFalse(options.selectors.ie7Hack);
-        assert.isTrue(options.properties.backgroundSizeMerging);
+        assert.isFalse(options.properties.backgroundSizeMerging);
         assert.isTrue(options.properties.merging);
         assert.isTrue(options.units.rem);
         assert.isTrue(options.colors.opacity);
@@ -29,7 +29,7 @@ vows.describe(Compatibility)
         assert.isFalse(options.properties.iePrefixHack);
         assert.isFalse(options.properties.ieSuffixHack);
         assert.isFalse(options.selectors.ie7Hack);
-        assert.isTrue(options.properties.backgroundSizeMerging);
+        assert.isFalse(options.properties.backgroundSizeMerging);
         assert.isTrue(options.properties.merging);
         assert.isFalse(options.units.rem);
         assert.isTrue(options.colors.opacity);
@@ -91,7 +91,7 @@ vows.describe(Compatibility)
         assert.isTrue(options.properties.iePrefixHack);
         assert.isFalse(options.properties.ieSuffixHack);
         assert.isFalse(options.selectors.ie7Hack);
-        assert.isTrue(options.properties.backgroundSizeMerging);
+        assert.isFalse(options.properties.backgroundSizeMerging);
         assert.isTrue(options.properties.merging);
         assert.isTrue(options.units.rem);
         assert.isTrue(options.colors.opacity);
@@ -104,7 +104,7 @@ vows.describe(Compatibility)
         assert.isTrue(options.properties.iePrefixHack);
         assert.isFalse(options.properties.ieSuffixHack);
         assert.isFalse(options.selectors.ie7Hack);
-        assert.isTrue(options.properties.backgroundSizeMerging);
+        assert.isFalse(options.properties.backgroundSizeMerging);
         assert.isTrue(options.properties.merging);
         assert.isFalse(options.units.rem);
         assert.isTrue(options.colors.opacity);