Fixes #541 - outline-style auto in shorthand.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Wed, 22 Apr 2015 21:12:29 +0000 (22:12 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Wed, 22 Apr 2015 21:20:01 +0000 (22:20 +0100)
Apparently two values that overlap between style and color are 'auto'
and 'none'. We handled only the latter one correctly.

History.md
lib/properties/break-up.js
test/fixtures/bootstrap-min.css
test/properties/break-up-test.js

index 525524c..ee26831 100644 (file)
@@ -9,6 +9,11 @@
 * Moves URL rebasing & rewriting into lib/urls.
 * Fixed issue [#436](https://github.com/jakubpawlowicz/clean-css/issues/436) - refactors URI rewriting.
 
+[3.2.3 / 2015-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.2...3.2)
+==================
+
+* Fixed issue [#541](https://github.com/jakubpawlowicz/clean-css/issues/541) - `outline-style:auto` in shorthand.
+
 [3.2.2 / 2015-04-21](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.1...v3.2.2)
 ==================
 
index 3d8abcb..bfb95d3 100644 (file)
@@ -292,7 +292,7 @@ function widthStyleColor(property, compactable, validator) {
 
   if (values.length > 0) {
     matches = values.filter(_widthFilter(validator));
-    match = matches.length > 1 && matches[0] == 'none' ? matches[1] : matches[0];
+    match = matches.length > 1 && (matches[0] == 'none' || matches[0] == 'auto') ? matches[1] : matches[0];
     if (match) {
       width.value = [match];
       values.splice(values.indexOf(match), 1);
index c870aa6..ce44ad3 100644 (file)
@@ -318,7 +318,7 @@ body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line
 button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}
 a{color:#337ab7;text-decoration:none}
 a:focus,a:hover{color:#23527c;text-decoration:underline}
-a:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto;outline-offset:-2px}
+a:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}
 .carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}
 .img-rounded{border-radius:6px}
 .img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}
index 710df1d..e9f68ce 100644 (file)
@@ -686,6 +686,26 @@ vows.describe(breakUp)
           assert.deepEqual(components[2].value, [['1px']]);
         }
       },
+      'with auto style': {
+        'topic': function () {
+          return _breakUp([[['outline'], ['#fff'], ['auto'], ['1px']]]);
+        },
+        'has 3 components': function (components) {
+          assert.lengthOf(components, 3);
+        },
+        'has outline-color': function (components) {
+          assert.deepEqual(components[0].name, 'outline-color');
+          assert.deepEqual(components[0].value, [['#fff']]);
+        },
+        'has outline-style': function (components) {
+          assert.deepEqual(components[1].name, 'outline-style');
+          assert.deepEqual(components[1].value, [['auto']]);
+        },
+        'has outline-width': function (components) {
+          assert.deepEqual(components[2].name, 'outline-width');
+          assert.deepEqual(components[2].value, [['1px']]);
+        }
+      },
       'missing values': {
         'topic': function () {
           return _breakUp([[['outline'], ['solid']]]);