Skip to content

Commit

Permalink
Revert "fix enter transition flicker regression (fix #4576)"
Browse files Browse the repository at this point in the history
This reverts commit 89987e8.
  • Loading branch information
yyx990803 committed Dec 27, 2016
1 parent 2540c37 commit 0bb2d4e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion src/platforms/web/runtime/modules/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ export function enter (vnode: VNodeWithData, toggleDisplay: ?() => void) {
beforeEnterHook && beforeEnterHook(el)
if (expectsCSS) {
addTransitionClass(el, startClass)
addTransitionClass(el, activeClass)
nextFrame(() => {
removeTransitionClass(el, startClass)
addTransitionClass(el, activeClass)
if (!cb.cancelled && !userWantsControl) {
whenTransitionEnds(el, type, cb)
}
Expand Down
16 changes: 8 additions & 8 deletions test/unit/features/component/component-keep-alive.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ describe('Component keep-alive', () => {
expect(vm.$el.innerHTML).toBe('<!---->')
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test test-enter test-enter-active">two</div>'
'<div class="test test-enter">two</div>'
)
assertHookCalls(one, [1, 1, 1, 1, 0])
assertHookCalls(two, [1, 1, 1, 0, 0])
Expand Down Expand Up @@ -325,7 +325,7 @@ describe('Component keep-alive', () => {
expect(vm.$el.innerHTML).toBe('<!---->')
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test test-enter test-enter-active">one</div>'
'<div class="test test-enter">one</div>'
)
assertHookCalls(one, [1, 1, 2, 1, 0])
assertHookCalls(two, [1, 1, 1, 1, 0])
Expand Down Expand Up @@ -369,7 +369,7 @@ describe('Component keep-alive', () => {
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test">one</div>' +
'<div class="test test-enter test-enter-active">two</div>'
'<div class="test test-enter">two</div>'
)
assertHookCalls(one, [1, 1, 1, 1, 0])
assertHookCalls(two, [1, 1, 1, 0, 0])
Expand Down Expand Up @@ -404,7 +404,7 @@ describe('Component keep-alive', () => {
}).then(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test">two</div>' +
'<div class="test test-enter test-enter-active">one</div>'
'<div class="test test-enter">one</div>'
)
assertHookCalls(one, [1, 1, 2, 1, 0])
assertHookCalls(two, [1, 1, 1, 1, 0])
Expand Down Expand Up @@ -460,7 +460,7 @@ describe('Component keep-alive', () => {
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test">one</div>' +
'<div class="test test-enter test-enter-active">two</div>'
'<div class="test test-enter">two</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand All @@ -476,7 +476,7 @@ describe('Component keep-alive', () => {
// 3. a new "one" is created and entering
expect(vm.$el.innerHTML).toBe(
'<div class="test">two</div>' +
'<div class="test test-enter test-enter-active">one</div>'
'<div class="test test-enter">one</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down Expand Up @@ -528,7 +528,7 @@ describe('Component keep-alive', () => {
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test v-leave">foo</div>' +
'<div class="test test-enter test-enter-active">bar</div>'
'<div class="test test-enter">bar</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand All @@ -543,7 +543,7 @@ describe('Component keep-alive', () => {
}).then(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test test-leave">bar</div>' +
'<div class="test v-enter v-enter-active">foo</div>'
'<div class="test v-enter">foo</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down
14 changes: 7 additions & 7 deletions test/unit/features/transition/transition-group.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ if (!isIE9) {
expect(vm.$el.innerHTML).toBe(
`<span>` +
['a', 'b', 'c'].map(i => `<div class="test">${i}</div>`).join('') +
`<div class="test v-enter v-enter-active">d</div>` +
`<div class="test v-enter v-enter-active">e</div>` +
`<div class="test v-enter">d</div>` +
`<div class="test v-enter">e</div>` +
`</span>`
)
}).thenWaitFor(nextFrame).then(() => {
Expand Down Expand Up @@ -101,7 +101,7 @@ if (!isIE9) {
`<div class="test v-leave">a</div>` +
`<div class="test">b</div>` +
`<div class="test">c</div>` +
`<div class="test v-enter v-enter-active">d</div>` +
`<div class="test v-enter">d</div>` +
`</span>`
)
}).thenWaitFor(nextFrame).then(() => {
Expand Down Expand Up @@ -131,7 +131,7 @@ if (!isIE9) {
`<div class="test v-leave">a</div>` +
`<div class="test">b</div>` +
`<div class="test">c</div>` +
`<div class="test v-enter v-enter-active">d</div>` +
`<div class="test v-enter">d</div>` +
`</span>`
)
}).thenWaitFor(nextFrame).then(() => {
Expand All @@ -157,7 +157,7 @@ if (!isIE9) {
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe(
`<span>` +
vm.items.map(i => `<div class="test v-enter v-enter-active">${i}</div>`).join('') +
vm.items.map(i => `<div class="test v-enter">${i}</div>`).join('') +
`</span>`
)
}).thenWaitFor(nextFrame).then(() => {
Expand Down Expand Up @@ -216,7 +216,7 @@ if (!isIE9) {
`<div class="test">a</div>` +
`<div class="test">b</div>` +
`<div class="test">c</div>` +
`<div class="test v-enter v-enter-active">d</div>` +
`<div class="test v-enter">d</div>` +
`</span>`
)
expect(beforeEnterSpy.calls.count()).toBe(1)
Expand Down Expand Up @@ -270,7 +270,7 @@ if (!isIE9) {
waitForUpdate(() => {
expect(vm.$el.innerHTML.replace(/\s?style=""(\s?)/g, '$1')).toBe(
`<span>` +
`<div class="test group-enter group-enter-active">d</div>` +
`<div class="test group-enter">d</div>` +
`<div class="test">b</div>` +
`<div class="test group-move">a</div>` +
`<div class="test group-leave group-move">c</div>` +
Expand Down
18 changes: 9 additions & 9 deletions test/unit/features/transition/transition-mode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (!isIE9) {
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test v-leave">one</div>' +
'<div class="test v-enter v-enter-active">two</div>'
'<div class="test v-enter">two</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down Expand Up @@ -78,7 +78,7 @@ if (!isIE9) {
expect(vm.$el.innerHTML).toBe('<!---->')
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test test-enter test-enter-active">two</div>'
'<div class="test test-enter">two</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down Expand Up @@ -126,7 +126,7 @@ if (!isIE9) {
expect(vm.$el.innerHTML).toBe('<!---->')
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test test-enter test-enter-active">two</div>'
'<div class="test test-enter">two</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down Expand Up @@ -161,7 +161,7 @@ if (!isIE9) {
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test">one</div>' +
'<div class="test test-enter test-enter-active">two</div>'
'<div class="test test-enter">two</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down Expand Up @@ -211,7 +211,7 @@ if (!isIE9) {
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test">one</div>' +
'<div class="test test-enter test-enter-active">two</div>'
'<div class="test test-enter">two</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand All @@ -227,7 +227,7 @@ if (!isIE9) {
// 3. a new "one" is created and entering
expect(vm.$el.innerHTML).toBe(
'<div class="test">two</div>' +
'<div class="test test-enter test-enter-active">one</div>'
'<div class="test test-enter">one</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down Expand Up @@ -271,7 +271,7 @@ if (!isIE9) {
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test v-leave">one</div>' +
'<div class="test v-enter v-enter-active">two</div>'
'<div class="test v-enter">two</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down Expand Up @@ -315,7 +315,7 @@ if (!isIE9) {
expect(vm.$el.innerHTML).toBe('<!---->')
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test test-enter test-enter-active">two</div>'
'<div class="test test-enter">two</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down Expand Up @@ -349,7 +349,7 @@ if (!isIE9) {
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe(
'<div class="test">one</div>' +
'<div class="test test-enter test-enter-active">two</div>'
'<div class="test test-enter">two</div>'
)
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.innerHTML).toBe(
Expand Down
Loading

0 comments on commit 0bb2d4e

Please sign in to comment.