Skip to content

Commit 0cf2502

Browse files
simplesmileryyx990803
authored andcommitted
Test non-prefixed attributes before prefixed (vuejs#2668)
1 parent f28260a commit 0cf2502

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/directives/internal/style.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ function prefix (prop) {
112112
}
113113
var i = prefixes.length
114114
var prefixed
115+
if (camel !== 'filter' && (camel in testEl.style)) {
116+
return {
117+
kebab: prop,
118+
camel: camel
119+
}
120+
}
115121
while (i--) {
116122
prefixed = camelPrefixes[i] + upper
117123
if (prefixed in testEl.style) {
@@ -121,10 +127,4 @@ function prefix (prop) {
121127
}
122128
}
123129
}
124-
if (camel in testEl.style) {
125-
return {
126-
kebab: prop,
127-
camel: camel
128-
}
129-
}
130130
}

test/unit/specs/directives/internal/style_spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,10 @@ describe(':style', function () {
121121
done()
122122
})
123123
})
124+
125+
// #2654
126+
it('background size with only one value', function () {
127+
dir.update({ backgroundSize: '100%' })
128+
expect(el.style.cssText.replace(/\s/g, '')).toBe('background-size:100%;')
129+
})
124130
})

0 commit comments

Comments
 (0)