Skip to content

Commit

Permalink
Merge pull request clauderic#106 from funnel-mark/master
Browse files Browse the repository at this point in the history
fix: workaround for mozilla bug
  • Loading branch information
Claudéric Demers authored Dec 8, 2016
2 parents e6b34ab + fcb0e4f commit 7ad6e52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export const events = {

export const vendorPrefix = (function () {
if (typeof window === 'undefined' || typeof document === 'undefined') return ''; // server environment
let styles = window.getComputedStyle(document.documentElement, '');
// fix for:
// https://bugzilla.mozilla.org/show_bug.cgi?id=548397
// window.getComputedStyle() returns null inside an iframe with display: none
// in this case return an array with a fake mozilla style in it.
let styles = window.getComputedStyle(document.documentElement, '') || ['-moz-hidden-iframe'];
const pre = (Array.prototype.slice
.call(styles)
.join('')
Expand Down

0 comments on commit 7ad6e52

Please sign in to comment.