Skip to content

Commit

Permalink
fix: handle undefined style properties in jsdom (fix #7444) (#8281)
Browse files Browse the repository at this point in the history
  • Loading branch information
industral authored and yyx990803 committed Oct 24, 2018
1 parent 038ed86 commit 5cfdf1a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/platforms/web/runtime/transition-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,12 @@ export function getTransitionInfo (el: Element, expectedType?: ?string): {
hasTransform: boolean;
} {
const styles: any = window.getComputedStyle(el)
const transitionDelays: Array<string> = styles[transitionProp + 'Delay'].split(', ')
const transitionDurations: Array<string> = styles[transitionProp + 'Duration'].split(', ')
// JSDOM may return undefined for transition properties
const transitionDelays: Array<string> = (styles[transitionProp + 'Delay'] || '').split(', ')
const transitionDurations: Array<string> = (styles[transitionProp + 'Duration'] || '').split(', ')
const transitionTimeout: number = getTimeout(transitionDelays, transitionDurations)
const animationDelays: Array<string> = styles[animationProp + 'Delay'].split(', ')
const animationDurations: Array<string> = styles[animationProp + 'Duration'].split(', ')
const animationDelays: Array<string> = (styles[animationProp + 'Delay'] || '').split(', ')
const animationDurations: Array<string> = (styles[animationProp + 'Duration'] || '').split(', ')
const animationTimeout: number = getTimeout(animationDelays, animationDurations)

let type: ?string
Expand Down

0 comments on commit 5cfdf1a

Please sign in to comment.