-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78bc62a
commit cdd9584
Showing
3 changed files
with
50 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=================================================================== | ||
--- a/polyfills/ResizeObserver/polyfill.js | ||
+++ b/polyfills/ResizeObserver/polyfill.js | ||
@@ -1,8 +1,4 @@ | ||
-(function (global, factory) { | ||
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
- typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ResizeObserver = {})); | ||
-})(this, (function (exports) { 'use strict'; | ||
+(function (global) { | ||
|
||
var resizeObservers = []; | ||
|
||
@@ -109,7 +105,7 @@ | ||
|
||
var cache = new WeakMap(); | ||
var scrollRegexp = /auto|scroll/; | ||
- var verticalRegexp = /^tb|vertical/; | ||
+ var verticalRegexp = /^tb|^vertical/; | ||
var IE = (/msie|trident/i).test(global.navigator && global.navigator.userAgent); | ||
var parseDimension = function (pixel) { return parseFloat(pixel || '0'); }; | ||
var size = function (inlineSize, blockSize, switchSizes) { | ||
@@ -503,10 +499,7 @@ | ||
return ResizeObserver; | ||
}()); | ||
|
||
- exports.ResizeObserver = ResizeObserver; | ||
- exports.ResizeObserverEntry = ResizeObserverEntry; | ||
- exports.ResizeObserverSize = ResizeObserverSize; | ||
+ global.ResizeObserver = ResizeObserver; | ||
+ global.ResizeObserverEntry = ResizeObserverEntry; | ||
|
||
- Object.defineProperty(exports, '__esModule', { value: true }); | ||
- | ||
-})); | ||
+}(self)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
'use strict'; | ||
|
||
var fs = require('fs'); | ||
var diff = require('diff'); | ||
var process = require('process'); | ||
var path = require('path'); | ||
var resizeObserverPolyfillOutput = path.resolve('polyfills/ResizeObserver/polyfill.js'); | ||
|
||
var polyfill = fs.readFileSync(resizeObserverPolyfillOutput, 'utf-8'); | ||
polyfill += ';self.ResizeObserverEntry = ResizeObserver.ResizeObserverEntry;self.ResizeObserver=ResizeObserver.ResizeObserver;' | ||
fs.writeFileSync(resizeObserverPolyfillOutput, polyfill, 'utf-8'); | ||
var polyfill = fs.readFileSync(path.join(__dirname, './polyfill.js'), 'utf8'); | ||
var patch = fs.readFileSync(path.join(__dirname, './patch.jsdiff'), 'utf8'); | ||
|
||
var patched = diff.applyPatch(polyfill, patch); | ||
|
||
if (patched === false) {process.exit(1);} | ||
fs.writeFileSync(path.join(__dirname, './polyfill.js'), patched); |