Permalink
Browse files

Add object-fit polyfill for Edge (#4182)

  • Loading branch information...
unarist authored and Gargron committed Jul 13, 2017
1 parent a906716 commit eeb5923e89c1b9040df37db8709e3450713c6019
Showing with 74 additions and 3 deletions.
  1. +1 −0 .postcssrc.yml
  2. +3 −0 app/javascript/mastodon/extra_polyfills.js
  3. +3 −2 app/javascript/mastodon/load_polyfills.js
  4. +2 −0 package.json
  5. +65 −1 yarn.lock
@@ -6,3 +6,4 @@ plugins:
- last 2 versions
- IE >= 11
- iOS >= 9
postcss-object-fit-images: {}
@@ -1,2 +1,5 @@
import 'intersection-observer';
import 'requestidlecallback';
import objectFitImages from 'object-fit-images';
objectFitImages();
@@ -20,11 +20,12 @@ function loadPolyfills() {
);
// Latest version of Firefox and Safari do not have IntersectionObserver.
// Edge does not have requestIdleCallback.
// Edge does not have requestIdleCallback and object-fit CSS property.
// This avoids shipping them all the polyfills.
const needsExtraPolyfills = !(
window.IntersectionObserver &&
window.requestIdleCallback
window.requestIdleCallback &&
'object-fit' in (new Image()).style
);
return Promise.all([
@@ -67,10 +67,12 @@
"node-sass": "^4.5.2",
"npmlog": "^4.1.2",
"object-assign": "^4.1.1",
"object-fit-images": "^3.2.3",
"offline-plugin": "^4.8.3",
"path-complete-extname": "^0.1.0",
"pg": "^6.4.0",
"postcss-loader": "^2.0.6",
"postcss-object-fit-images": "^1.1.2",
"postcss-smart-import": "^0.7.5",
"precss": "^2.0.0",
"prop-types": "^15.5.10",

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit eeb5923

Please sign in to comment.