Ver código fonte

Test non-prefixed attributes before prefixed (#2668)

Denis Karabaza 10 anos atrás
pai
commit
0cf2502926

+ 6 - 6
src/directives/internal/style.js

@@ -112,6 +112,12 @@ function prefix (prop) {
   }
   var i = prefixes.length
   var prefixed
+  if (camel !== 'filter' && (camel in testEl.style)) {
+    return {
+      kebab: prop,
+      camel: camel
+    }
+  }
   while (i--) {
     prefixed = camelPrefixes[i] + upper
     if (prefixed in testEl.style) {
@@ -121,10 +127,4 @@ function prefix (prop) {
       }
     }
   }
-  if (camel in testEl.style) {
-    return {
-      kebab: prop,
-      camel: camel
-    }
-  }
 }

+ 6 - 0
test/unit/specs/directives/internal/style_spec.js

@@ -121,4 +121,10 @@ describe(':style', function () {
       done()
     })
   })
+
+  // #2654
+  it('background size with only one value', function () {
+    dir.update({ backgroundSize: '100%' })
+    expect(el.style.cssText.replace(/\s/g, '')).toBe('background-size:100%;')
+  })
 })