FEATURE: polyfill intersection observer for IE11 / iOS Safari

This feature is used for defer loading of images and in future for post cloaking

This gives us a polyfill so we can safely use the feature in problem browsers

The polyfill supports "polling" but it does not appear we need it yet.

If we discover anything odd here, consider setting poll interval per:

https://github.com/w3c/IntersectionObserver/tree/master/polyfill

```
var io = new IntersectionObserver(callback);
io.POLL_INTERVAL = 100; // Time in milliseconds.
```

Keeping the mutation observer cause we often mutate the DOM
This commit is contained in:
Sam
2018-12-12 15:36:08 +11:00
parent e564fe1866
commit 0ca61242b8
5 changed files with 737 additions and 1 deletions

View File

@ -56,7 +56,7 @@ task 'javascript:update' do
}, {
source: 'jquery.cookie/jquery.cookie.js'
}, {
source: 'jQuery/dist/jquery.js'
source: 'jquery/dist/jquery.js'
}, {
source: 'jquery-tags-input/src/jquery.tagsinput.js'
}, {
@ -65,6 +65,9 @@ task 'javascript:update' do
source: 'mousetrap/mousetrap.js'
}, {
source: 'resumablejs/resumable.js'
}, {
# TODO: drop when we eventually drop IE11, this will land in iOS in version 13
source: 'intersection-observer/intersection-observer.js'
}
]