<\\/div>\\s*$/i);\n});\n\nit('should do deep copy', function() {\n\tvar clone = create('
text content
').cloneNode(true);\n\tproclaim.equal(htmlify(clone), '
text content
')\n})\n\nit('should do shallow copy', function() {\n\tvar clone = create('
text content
').cloneNode(false);\n\tproclaim.equal(htmlify(clone), '
')\n})\n\nit(\"should clone attributes in shallow mode\", function() {\n\tvar clone = create('
').cloneNode(false);\n\tproclaim.equal(clone.nodeName, \"DIV\");\n\tproclaim.equal(clone.innerHTML, '');\n\tproclaim.equal(clone.getAttribute('test'), 'test');\n\tproclaim.equal(clone.getAttribute('class'), 'foo');\n\tproclaim.equal(clone.className, 'foo');\n});\n\nit('should clone self-closing elements', function() {\n\tvar clone = create('
').cloneNode();\n\tproclaim.equal(clone.nodeName, \"BR\");\n\tproclaim.match(htmlify(clone), /^
$/);\n});\n\nit('should retain checked state of checkbox elements', function() {\n\tvar inp = create(\"
\");\n\tinp.checked = true;\n\tvar clone = inp.cloneNode();\n\tproclaim.equal(clone.nodeName, \"INPUT\");\n\tproclaim.equal(clone.checked, true);\n});\n\n/* TEST SKIPPED: this doesn't work in IE < 9, which results in <:nav>. Support for this could probably be added to the polyfill */\nit.skip('can clone HTML5 elements', function() {\n\tvar clone = document.createElement('nav').cloneNode();\n\tproclaim.equal(htmlify(clone), '
');\n});"}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.cloneNode/min.js b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.cloneNode/min.js
deleted file mode 100644
index 5608229..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.cloneNode/min.js
+++ /dev/null
@@ -1 +0,0 @@
-Element.prototype.cloneNode=function(e){return function(t){var c=e.call(this,t);return"checked"in this&&(c.checked=this.checked),c}}(Element.prototype.cloneNode);
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.cloneNode/raw.js b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.cloneNode/raw.js
deleted file mode 100644
index 7baa015..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.cloneNode/raw.js
+++ /dev/null
@@ -1,11 +0,0 @@
-
-// Element.prototype.cloneNode
-Element.prototype.cloneNode = (function(nativeFunc) {
- return function(deep) {
- var clone = nativeFunc.call(this, deep);
-
- if ('checked' in this) clone.checked = this.checked;
-
- return clone;
- };
-}(Element.prototype.cloneNode));
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.closest/meta.json b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.closest/meta.json
deleted file mode 100644
index 6af4967..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.closest/meta.json
+++ /dev/null
@@ -1 +0,0 @@
-{"aliases":["default-3.3","default-3.4","default-3.5","default-3.6","default","blissfuljs"],"browsers":{"bb":"*","android":"<5","chrome":"* - 41","ie":"*","ie_mob":"*","ios_saf":"<9","firefox":"6 - 34","opera":"<28","op_mini":"*","op_mob":"<33","safari":"<9","firefox_mob":"6 - 43"},"dependencies":["Element.prototype.matches"],"docs":"https://developer.mozilla.org/en-US/docs/Web/API/Element/closest","spec":"http://dom.spec.whatwg.org/#dom-element-closest","detectSource":"'document' in this && \"closest\" in document.documentElement","testSource":"","baseDir":"Element/prototype/closest","hasTests":true,"testsSource":"/* eslint-env mocha, browser*/\n/* global proclaim, it */\n\nit(\"should return the first ancestor that matches selectors\", function() {\n\tvar el = document.body.appendChild(document.createElement(\"p\"));\n\tvar firstInnerEl = document.createElement(\"a\");\n\tel.className = \"baz\";\n\n\tel.appendChild(firstInnerEl);\n\n\tvar closest = firstInnerEl.closest(\"p\");\n\tproclaim.equal(closest, el);\n\tproclaim.equal(closest.className, \"baz\");\n\n\tdocument.body.removeChild(el);\n});\n\nit(\"should return the first inclusive ancestor that matches selectors\", function() {\n\tvar el = document.body.appendChild(document.createElement(\"p\"));\n\tvar firstInnerEl = document.createElement(\"a\");\n\tel.className = \"baz\";\n\tfirstInnerEl.className = \"foo\";\n\n\tel.appendChild(firstInnerEl);\n\n\tvar closest = firstInnerEl.closest(\"a\");\n\tproclaim.equal(closest, firstInnerEl);\n\tproclaim.equal(closest.className, \"foo\");\n\n\tdocument.body.removeChild(el);\n});\n\nit(\"should return null if there are no matches\", function() {\n\tvar el = document.body.appendChild(document.createElement(\"a\"));\n\n\tproclaim.equal(el.closest(\"p\"), null);\n\n\tdocument.body.removeChild(el);\n});\n\n\n/* Skipped: This exception is actually thrown by querySelector, and cannot be thrown by\n * the polyfill, so this test will fail in some UAs. For more info see querySelector polyfill.\n */\nit.skip(\"should throw an error if the selector syntax is incorrect\", function() {\n\tvar el = document.body.appendChild(document.createElement(\"a\"));\n\n\tproclaim.throws(function () {\n\t\tel.closest(\"p
<\");\n\t});\n\n\tdocument.body.removeChild(el);\n});"}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.closest/min.js b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.closest/min.js
deleted file mode 100644
index 178e542..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.closest/min.js
+++ /dev/null
@@ -1 +0,0 @@
-Element.prototype.closest=function(t){for(var e=this;e;){if(e.matches(t))return e;e=e.parentElement}return null};
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.closest/raw.js b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.closest/raw.js
deleted file mode 100644
index fd55cb2..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.closest/raw.js
+++ /dev/null
@@ -1,12 +0,0 @@
-
-// Element.prototype.closest
-Element.prototype.closest = function closest(selector) {
- var node = this;
-
- while (node) {
- if (node.matches(selector)) return node;
- else node = node.parentElement;
- }
-
- return null;
-};
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.dataset/meta.json b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.dataset/meta.json
deleted file mode 100644
index ac3a548..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.dataset/meta.json
+++ /dev/null
@@ -1 +0,0 @@
-{"browsers":{"chrome":"< 8","firefox":"< 6","ie":"9 - 10","safari":"< 6","firefox_mob":"< 6"},"dependencies":["Object.defineProperty","Object.getOwnPropertyDescriptor","document.querySelector","Element"],"spec":"https://html.spec.whatwg.org/multipage/dom.html#dom-dataset","docs":"https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset","detectSource":"(function(){\n\tif (!document.documentElement.dataset) {\n\t\treturn false;\n\t}\n\tvar el = document.createElement('div');\n\tel.setAttribute(\"data-a-b\", \"c\");\n\treturn el.dataset && el.dataset.aB == \"c\";\n}())","testSource":"","baseDir":"Element/prototype/dataset","hasTests":true,"testsSource":"/* eslint-env mocha, browser*/\n/* global proclaim, it */\n\ndescribe('dataset', function () {\n\tvar element;\n\n\tbeforeEach(function() {\n\t\telement = document.createElement('div');\n\t\telement.innerHTML = ''\n\t\tdocument.body.appendChild(element);\n\t});\n\n\tafterEach(function() {\n\t\tdocument.body.removeChild(element);\n\t})\n\n\tit('get', function () {\n\n\t\tvar el = document.getElementById('dataset-tests');\n\n\t\tproclaim.equal(el.dataset.empty, '');\n\t\tproclaim.equal(el.dataset.id, '42');\n\t\tproclaim.equal(el.dataset.nameOfCheese, 'Red Leicester');\n\t});\n\n\tit('set', function () {\n\t\tvar el = document.getElementById('dataset-tests');\n\n\t\tel.dataset.empty = 'not-empty';\n\t\tproclaim.equal(el.dataset.empty, 'not-empty');\n\t\tproclaim.equal(el.getAttribute('data-empty'), 'not-empty');\n\t});\n});"}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.dataset/min.js b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.dataset/min.js
deleted file mode 100644
index e361bf0..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.dataset/min.js
+++ /dev/null
@@ -1 +0,0 @@
-Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var e=this,t=this.attributes,r={},n=0;ninvalid<:selector\");\n\t});\n\n\tdocument.body.removeChild(el);\n});\n */"}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.matches/min.js b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.matches/min.js
deleted file mode 100644
index 5617180..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.matches/min.js
+++ /dev/null
@@ -1 +0,0 @@
-Element.prototype.matches=Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||function(e){for(var t=this,o=(t.document||t.ownerDocument).querySelectorAll(e),r=0;o[r]&&o[r]!==t;)++r;return!!o[r]};
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.matches/raw.js b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.matches/raw.js
deleted file mode 100644
index 87b9e03..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.matches/raw.js
+++ /dev/null
@@ -1,14 +0,0 @@
-
-// Element.prototype.matches
-Element.prototype.matches = Element.prototype.webkitMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.mozMatchesSelector || function matches(selector) {
-
- var element = this;
- var elements = (element.document || element.ownerDocument).querySelectorAll(selector);
- var index = 0;
-
- while (elements[index] && elements[index] !== element) {
- ++index;
- }
-
- return !!elements[index];
-};
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.placeholder/meta.json b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.placeholder/meta.json
deleted file mode 100644
index cb1236d..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.placeholder/meta.json
+++ /dev/null
@@ -1 +0,0 @@
-{"aliases":["caniuse:input-placeholder","modernizr:placeholder"],"browsers":{"ie":"8 - 9"},"dependencies":["Object.defineProperty","document.querySelector","Element"],"detectSource":"'document' in this && \"placeholder\" in document.createElement(\"input\")","testSource":"","baseDir":"Element/prototype/placeholder","hasTests":false}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.placeholder/min.js b/polyfill-service-api/src/main/resources/polyfills/Element.prototype.placeholder/min.js
deleted file mode 100644
index f5cd420..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Element.prototype.placeholder/min.js
+++ /dev/null
@@ -1 +0,0 @@
-Object.defineProperty(Element.prototype,"placeholder",{get:function(){return this.getAttribute("placeholder")},set:function(e){if(e&&/^(input|textarea)$/i.test(this.nodeName)&&(!/^(input)$/i.test(this.nodeName)||/^(email|number|password|search|tel|text|url|)$/i.test(this.getAttribute("type")))){var t=this,n=document.createElement("ms-input"),i=n.appendChild(document.createElement("ms-placeholder")),o=n.runtimeStyle,a=i.runtimeStyle,r=t.currentStyle;i.appendChild(document.createTextNode(e)),o.display="inline-block",o.fontSize=r.fontSize,o.margin=r.margin,o.width=r.width,t.parentNode.insertBefore(n,t).appendChild(t),a.backgroundColor="transparent",a.fontFamily=r.fontFamily,a.fontSize=r.fontSize,a.fontWeight=r.fontWeight,a.margin="2px 0 0 2px",a.padding=r.padding,a.position="absolute",a.display=t.value?"none":"inline-block",t.runtimeStyle.margin="0",i.attachEvent("onclick",function(){t.focus()}),t.attachEvent("onkeypress",function(){a.display="none"}),t.attachEvent("onkeyup",function(){a.display=t.value?"none":"inline-block"}),Object.defineProperty(t,"placeholder",{get:function(){return i.innerHTML},set:function(e){i.innerHTML=e}})}}}),document.attachEvent("onreadystatechange",function(){if("complete"===document.readyState)for(var e=document.querySelectorAll("input,textarea"),t=0,n=e.length;t.hasAttribute
- prototype.hasAttribute = function hasAttribute(name) {
- return this.getAttribute(name) !== null;
- };
- }
-
- // Apply Element prototype to the pre-existing DOM as soon as the body element appears.
- function bodyCheck() {
- if (!(loopLimit--)) clearTimeout(interval);
- if (document.body && !document.body.prototype && /(complete|interactive)/.test(document.readyState)) {
- shiv(document, true);
- if (interval && document.body.prototype) clearTimeout(interval);
- return (!!document.body.prototype);
- }
- return false;
- }
- if (!bodyCheck(true)) {
- document.onreadystatechange = bodyCheck;
- interval = setInterval(bodyCheck, 25);
- }
-
- // Apply to any new elements created after load
- document.createElement = function createElement(nodeName) {
- var element = nativeCreateElement(String(nodeName).toLowerCase());
- return shiv(element);
- };
-
- // remove sandboxed iframe
- document.removeChild(vbody);
-}());
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event.DOMContentLoaded/meta.json b/polyfill-service-api/src/main/resources/polyfills/Event.DOMContentLoaded/meta.json
deleted file mode 100644
index 87adff4..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event.DOMContentLoaded/meta.json
+++ /dev/null
@@ -1 +0,0 @@
-{"aliases":["caniuse:domcontentloaded","default-3.3","default-3.4","default-3.5","default-3.6","default"],"browsers":{"ie":"6 - 8"},"dependencies":["Event"],"docs":"https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded","detectSource":"'addEventListener' in this","testSource":"","baseDir":"Event/DOMContentLoaded","hasTests":false}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event.DOMContentLoaded/min.js b/polyfill-service-api/src/main/resources/polyfills/Event.DOMContentLoaded/min.js
deleted file mode 100644
index 6b40fc1..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event.DOMContentLoaded/min.js
+++ /dev/null
@@ -1 +0,0 @@
-document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))});
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event.DOMContentLoaded/raw.js b/polyfill-service-api/src/main/resources/polyfills/Event.DOMContentLoaded/raw.js
deleted file mode 100644
index fd5daac..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event.DOMContentLoaded/raw.js
+++ /dev/null
@@ -1,9 +0,0 @@
-
-// Event.DOMContentLoaded
-document.attachEvent('onreadystatechange', function() {
- if (document.readyState === 'complete') {
- document.dispatchEvent(new Event('DOMContentLoaded', {
- bubbles: true
- }));
- }
-});
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event.focusin/meta.json b/polyfill-service-api/src/main/resources/polyfills/Event.focusin/meta.json
deleted file mode 100644
index 2be73ac..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event.focusin/meta.json
+++ /dev/null
@@ -1 +0,0 @@
-{"aliases":["default-3.3","default-3.4","default-3.5","default-3.6","default"],"browsers":{"firefox":"6 - *","firefox_mob":"6 - *"},"dependencies":["Event"],"docs":"https://developer.mozilla.org/en-US/docs/Web/Events/focusin","detectSource":"","testSource":"","baseDir":"Event/focusin","hasTests":true,"testsSource":"/* eslint-env mocha, browser*/\n/* global proclaim, it */\n\n/* The detect and tests for the focusin/focusout polyfill have been shown to not work reliably. See https://github.com/Financial-Times/polyfill-service/issues/213 for details. The polyfill itself appears to work fine, but events progrmamatically fired during page load while dev tools is open appear not to be observable by the polyfill, which makes the test and detect unreliable. We're continuing to serve the polyfill as it's pretty simple but would love to get some better insight into this problem. */\n\nit.skip('should dispatch the focusin event', function(done) {\n\tvar testEl = document.createElement('input');\n\ttestEl.id = 'test1';\n\tdocument.body.appendChild(testEl);\n\twindow.addEventListener('focusin', listener);\n\ttestEl.focus();\n\n\tfunction listener(e) {\n\t\tproclaim.equal(e.type, 'focusin');\n\t\tproclaim.equal(e.target, testEl);\n\t\twindow.removeEventListener('focusin', listener);\n\t\tdocument.body.removeChild(testEl);\n\t\tdone();\n\t}\n});\n\nit.skip('should dispatch the focusout event', function(done) {\n\tvar testEl2 = document.createElement('input');\n\ttestEl2.id = 'test2';\n\tdocument.body.appendChild(testEl2);\n\ttestEl2.focus();\n\twindow.addEventListener('focusout', listener);\n\ttestEl2.blur();\n\n\tfunction listener(e) {\n\t\tproclaim.equal(e.type, 'focusout');\n\t\tproclaim.equal(e.target, testEl2);\n\t\tdocument.body.removeChild(testEl2);\n\t\tdone();\n\t}\n});"}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event.focusin/min.js b/polyfill-service-api/src/main/resources/polyfills/Event.focusin/min.js
deleted file mode 100644
index f867f8c..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event.focusin/min.js
+++ /dev/null
@@ -1 +0,0 @@
-this.addEventListener("focus",function(e){e.target.dispatchEvent(new Event("focusin",{bubbles:!0,cancelable:!0}))},!0),this.addEventListener("blur",function(e){e.target.dispatchEvent(new Event("focusout",{bubbles:!0,cancelable:!0}))},!0);
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event.focusin/raw.js b/polyfill-service-api/src/main/resources/polyfills/Event.focusin/raw.js
deleted file mode 100644
index f13e94a..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event.focusin/raw.js
+++ /dev/null
@@ -1,15 +0,0 @@
-
-// Event.focusin
-this.addEventListener('focus', function (event) {
- event.target.dispatchEvent(new Event('focusin', {
- bubbles: true,
- cancelable: true
- }));
-}, true);
-
-this.addEventListener('blur', function (event) {
- event.target.dispatchEvent(new Event('focusout', {
- bubbles: true,
- cancelable: true
- }));
-}, true);
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event.hashchange/meta.json b/polyfill-service-api/src/main/resources/polyfills/Event.hashchange/meta.json
deleted file mode 100644
index f9b8afd..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event.hashchange/meta.json
+++ /dev/null
@@ -1 +0,0 @@
-{"aliases":["caniuse:hashchange","modernizr:hashchange","default-3.3","default-3.4","default-3.5","default-3.6","default"],"browsers":{"ie":"6 - 7","safari":"4","samsung_mob":"<5"},"dependencies":["Event"],"docs":"https://developer.mozilla.org/en-US/docs/Web/Events/hashchange","detectSource":"'onhashchange' in this && (this.onhashchange == null || typeof this.onhashchange === 'function')","testSource":"","baseDir":"Event/hashchange","hasTests":true,"testsSource":"/* eslint-env mocha, browser*/\n/* global proclaim, it */\n\nit('Should dispatch the hashchange event', function(done) {\n\n\tvar listener = function(e) {\n\t\tproclaim.equal(e.type, 'hashchange');\n\t\twindow.removeEventListener('hashchange', listener);\n\t\tdone();\n\t};\n\n\twindow.addEventListener('hashchange', listener);\n\n\twindow.location.hash = 'hashchange-test-'+Math.floor(Math.random()*1000000);\n});"}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event.hashchange/min.js b/polyfill-service-api/src/main/resources/polyfills/Event.hashchange/min.js
deleted file mode 100644
index 626930f..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event.hashchange/min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(n){function h(){a!==n.location.hash&&(a=n.location.hash,n.dispatchEvent(new Event("hashchange"))),setTimeout(h,500)}var a=n.location.hash;n.onhashchange=function(){},h()}(this);
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event.hashchange/raw.js b/polyfill-service-api/src/main/resources/polyfills/Event.hashchange/raw.js
deleted file mode 100644
index 51f1c19..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event.hashchange/raw.js
+++ /dev/null
@@ -1,20 +0,0 @@
-
-// Event.hashchange
-(function (global) {
- var hash = global.location.hash;
-
- function poll () {
- if (hash !== global.location.hash) {
- hash = global.location.hash;
-
- global.dispatchEvent(new Event('hashchange'));
- }
-
- setTimeout(poll, 500);
- };
-
- // Make sure a check for 'onhashchange' in window will pass (note: setting to undefined IE<9 causes 'Not implemented' error)
- global.onhashchange = function() {};
-
- poll();
-}(this));
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event/meta.json b/polyfill-service-api/src/main/resources/polyfills/Event/meta.json
deleted file mode 100644
index 8f52082..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event/meta.json
+++ /dev/null
@@ -1 +0,0 @@
-{"aliases":["default-3.3","default-3.4","default-3.5","default-3.6","default"],"browsers":{"firefox":"6 - 10","ie":"6 - 11","ie_mob":"10","opera":"10 - 11.5","safari":"4 - 7","firefox_mob":"6 - 10"},"dependencies":["Window","Document","Element","Object.defineProperty"],"docs":"https://developer.mozilla.org/en/docs/Web/API/Event","notes":["Where necessary, also adds the [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) methods `addEventListener`, `removeEventListener` and `dispatchEvent`."],"detectSource":"(function(global) {\n\n\tif (!('Event' in global)) return false;\n\tif (typeof global.Event === 'function') return true;\n\n\ttry {\n\n\t\t// In IE 9-11, the Event object exists but cannot be instantiated\n\t\tnew Event('click');\n\t\treturn true;\n\t} catch(e) {\n\t\treturn false;\n\t}\n}(this))","testSource":"","baseDir":"Event","hasTests":true,"testsSource":"/* eslint-env mocha, browser*/\n/* global proclaim, it */\n\n// Safari fails this test. However, no-one would ever do this\n// as it would just create an event that can never be dispatched/listened for\n// it doesn't cause any problem\nit.skip('should throw exception when instantiated with no parameters', function() {\n\tproclaim.throws(function() {\n\t\tnew Event();\n\t});\n});\n\nit('should have correct default properties', function() {\n\tvar testEvent = new Event('click');\n\tproclaim.equal(testEvent.type, 'click');\n\tproclaim.equal(testEvent.bubbles, false);\n\tproclaim.equal(testEvent.cancelable, false);\n});\n\nit('should modify default properties if optional EventInit parameter is passed', function() {\n\tvar testEvent = new Event('test', {\n\t\tbubbles: true,\n\t\tcancelable: true\n\t});\n\n\tproclaim.equal(testEvent.type, 'test');\n\tproclaim.equal(testEvent.bubbles, true);\n\tproclaim.equal(testEvent.cancelable, true);\n});\n\nit('should be able to fire an event that can be listened to', function(done) {\n\tvar testEvent = new Event('test', {\n\t\tbubbles: true,\n\t\tcancelable: true\n\t});\n\n\tvar testEl = document.createElement('div');\n\ttestEl.addEventListener('test', function(ev) {\n\t\tproclaim.equal(ev.type, 'test');\n\t\tproclaim.equal(ev.bubbles, true);\n\t\tproclaim.equal(ev.cancelable, true);\n\t\tdone();\n\t});\n\ttestEl.dispatchEvent(testEvent);\n});\n\nit('should bubble the event', function(done) {\n\tvar testEvent = new Event('test', {\n\t\tbubbles: true,\n\t\tcancelable: true\n\t});\n\n\tvar testEl = document.createElement('div');\n\tdocument.body.appendChild(testEl);\n\tdocument.body.addEventListener('test', function(ev) {\n\t\tproclaim.equal(ev.type, 'test');\n\t\tproclaim.equal(ev.bubbles, true);\n\t\tproclaim.equal(ev.cancelable, true);\n\t\tdone();\n\t});\n\ttestEl.dispatchEvent(testEvent);\n});\n\nit('should not trigger an event handler once removed', function() {\n\tvar testEvent = new Event('test', {\n\t\tbubbles: true,\n\t\tcancelable: true\n\t});\n\tvar listener = function() {\n\t\tthrow new Error('listener was fired, but should have been removed');\n\t};\n\n\tvar testEl = document.createElement('div');\n\ttestEl.addEventListener('test', listener);\n\ttestEl.removeEventListener('test', listener);\n\ttestEl.dispatchEvent(testEvent);\n});\n\nit('should trigger an event handler once added, removed, and added again', function () {\n\t// NOTE: The event must be a real DOM event or the\n\t// dispatchEvent polyfill will catch the fireEvent\n\t// error, simulate firing the event by running the\n\t// event listeners.\n\tvar fired = false;\n\tvar listener = function() {\n\t\tfired = true;\n\t\tdocument.removeEventListener('click', listener);\n\t};\n\n\tdocument.addEventListener('click', listener);\n\tdocument.removeEventListener('click', listener);\n\tdocument.addEventListener('click', listener);\n\t// click the document\n\tdocument.dispatchEvent(new Event('click'));\n\tproclaim.equal(fired, true);\n});\n\nit('should have the correct target when using delegation', function () {\n\tvar fired = false;\n\tvar el = document.body.firstChild;\n\tvar listener = function(e) {\n\t\tif (e.target === el) fired = true;\n\t\tdocument.removeEventListener('click', listener);\n\t};\n\n\tdocument.addEventListener('click', listener);\n\tel.dispatchEvent(new Event('click', {\n\t\tbubbles: true\n\t}));\n\tproclaim.equal(fired, true);\n});\n\nit('should successfully call window.addEventListener or throw exception', function() {\n\n\tvar eventsToTest = [\n\t\t'click',\n\t\t'dblclick',\n\t\t'keyup',\n\t\t'keypress',\n\t\t'keydown',\n\t\t'mousedown',\n\t\t'mouseup',\n\t\t'mousemove',\n\t\t'mouseover',\n\t\t'mouseenter',\n\t\t'mouseleave',\n\t\t'mouseout',\n\t\t'storage',\n\t\t'storagecommit',\n\t\t'textinput'\n\t];\n\n\tvar threwLast;\n\tvar threw;\n\tvar listener = function() {};\n\tfor(var i = 0; i < eventsToTest.length; i++) {\n\t\tvar eventType = eventsToTest[i];\n\t\ttry {\n\t\t\twindow.addEventListener(eventType, listener);\n\t\t\tthrew = false;\n\t\t} catch(ignore) {\n\t\t\tthrew = true;\n\t\t}\n\n\t\tif (typeof (threwLast) != 'undefined') {\n\t\t\tproclaim.equal(threw, threwLast);\n\t\t}\n\t\tthrewLast = threw;\n\t}\n});\n\nit('subclasses should be instances of Event if the UA implements DOM3', function () {\n\tvar a = document.createElement('a');\n\ta.addEventListener('click', function(ev) {\n\n\t\t// Supported in IE9+\n\t\tif ('MouseEvent' in window) {\n\t\t\tproclaim.isInstanceOf(ev, Event);\n\t\t}\n\t});\n\tdocument.body.appendChild(a);\n\ta.click();\n})"}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/Event/min.js b/polyfill-service-api/src/main/resources/polyfills/Event/min.js
deleted file mode 100644
index 5998e10..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/Event/min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){function e(e,t){for(var n=-1,o=e.length;++n does not appear to be accessible to JS in IE8, so in IE8 the only way to detect that the polyfill has applied is to use a non-standard global exposed by the polyfill */\n'HTMLPictureElement' in this || 'picturefill' in this","testSource":"","baseDir":"HTMLPictureElement","hasTests":false}
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/HTMLPictureElement/min.js b/polyfill-service-api/src/main/resources/polyfills/HTMLPictureElement/min.js
deleted file mode 100644
index 359db69..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/HTMLPictureElement/min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){var t=navigator.userAgent;e.HTMLPictureElement&&/ecko/.test(t)&&t.match(/rv\:(\d+)/)&&RegExp.$1<45&&addEventListener("resize",function(){var t,n=document.createElement("source"),r=function(e){var t,r,s=e.parentNode;"PICTURE"===s.nodeName.toUpperCase()?(t=n.cloneNode(),s.insertBefore(t,s.firstElementChild),setTimeout(function(){s.removeChild(t)})):(!e._pfLastSize||e.offsetWidth>e._pfLastSize)&&(e._pfLastSize=e.offsetWidth,r=e.sizes,e.sizes+=",100vw",setTimeout(function(){e.sizes=r}))},s=function(){var e,t=document.querySelectorAll("picture > img, img[srcset][sizes]");for(e=0;e2.7?a=n+1:(i=t-n,s=Math.pow(e-.6,1.5),c=i*s,r&&(c+=.1*s),a=e+c):a=n>1?Math.sqrt(e*t):e,a>n}function c(e){var t,n=g.getSet(e),r=!1;"pending"!==n&&(r=h,n&&(t=g.setRes(n),g.applySetCandidate(t,e))),e[g.ns].evaled=r}function a(e,t){return e.res-t.res}function o(e,t,n){var r;return!n&&t&&(n=e[g.ns].sets,n=n&&n[n.length-1]),r=u(t,n),r&&(t=g.makeUrl(t),e[g.ns].curSrc=t,e[g.ns].curCan=r,r.res||J(r,r.set.sizes)),r}function u(e,t){var n,r,s;if(e&&t)for(s=g.parseSet(t),e=g.makeUrl(e),n=0;nn;n++)s=c[n],s[g.ns]=!0,(i=s.getAttribute("srcset"))&&t.push({srcset:i,media:s.getAttribute("media"),type:s.getAttribute("type"),sizes:s.getAttribute("sizes")})}function l(e,t){function n(t){var n,r=t.exec(e.substring(l));return r?(n=r[0],l+=n.length,n):void 0}function s(){var e,n,r,s,a,o,u,d,l,p=!1,m={};for(s=0;sl?p=!0:n=l):Q.test(u)&&"h"===o?((r||n)&&(p=!0),0===d?p=!0:r=d):p=!0;p||(m.url=i,e&&(m.w=e),n&&(m.d=n),r&&(m.h=r),r||n||e||(m.d=1),1===m.d&&(t.has1x=!0),m.set=t,f.push(m))}for(var i,c,a,o,u,d=e.length,l=0,f=[];;){if(n(G),l>=d)return f;i=n(F),c=[],","===i.slice(-1)?(i=i.replace(W,""),s()):function(){for(n(j),a="",o="in descriptor";;){if(u=e.charAt(l),"in descriptor"===o)if(r(u))a&&(c.push(a),a="",o="after descriptor");else{if(","===u)return l+=1,a&&c.push(a),void s();if("("===u)a+=u,o="in parens";else{if(""===u)return a&&c.push(a),void s();a+=u}}else if("in parens"===o)if(")"===u)a+=u,o="in descriptor";else{if(""===u)return c.push(a),void s();a+=u}else if("after descriptor"===o)if(r(u));else{if(""===u)return void s();o="in descriptor",l-=1}l+=1}}()}}function f(e){var t,n,s,i,c,a,o=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,u=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;for(n=function(e){function t(){i&&(c.push(i),i="")}function n(){c[0]&&(a.push(c),c=[])}for(var s,i="",c=[],a=[],o=0,u=0,d=!1;;){if(""===(s=e.charAt(u)))return t(),n(),a;if(d){if("*"===s&&"/"===e[u+1]){d=!1,u+=2,t();continue}u+=1}else{if(r(s)){if(e.charAt(u-1)&&r(e.charAt(u-1))||!i){u+=1;continue}if(0===o){t(),u+=1;continue}s=" "}else if("("===s)o+=1;else if(")"===s)o-=1;else{if(","===s){t(),n(),u+=1;continue}if("/"===s&&"*"===e.charAt(u+1)){d=!0,u+=2;continue}}i+=s,u+=1}}}(e),s=n.length,t=0;s>t;t++)if(i=n[t],c=i[i.length-1],function(e){return!!(o.test(e)&&parseFloat(e)>=0)||(!!u.test(e)||("0"===e||"-0"===e||"+0"===e))}(c)){if(a=c,i.pop(),0===i.length)return a;if(i=i.join(" "),g.matchesMedia(i))return a}return"100vw"}t.createElement("picture");var p,m,h,g={},A=!1,v=function(){},w=t.createElement("img"),S=w.getAttribute,b=w.setAttribute,E=w.removeAttribute,y=t.documentElement,T={},M={algorithm:""},C="data-pfsrc",x=C+"set",R=navigator.userAgent,z=/rident/.test(R)||/ecko/.test(R)&&R.match(/rv\:(\d+)/)&&RegExp.$1>35,L="currentSrc",I=/\s+\+?\d+(e\d+)?w/,N=e.picturefillCFG,P="font-size:100%!important;",U=!0,k={},O={},D=e.devicePixelRatio,B={px:1,"in":96},H=t.createElement("a"),$=!1,j=/^[ \t\n\r\u000c]+/,G=/^[, \t\n\r\u000c]+/,F=/^[^ \t\n\r\u000c]+/,W=/[,]+$/,Q=/^\d+$/,q=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,_=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},V=function(e){var t={};return function(n){return n in t||(t[n]=e(n)),t[n]}},K=function(){var e=function(){for(var e=arguments,t=0,n=e[0];++t in e;)n=n.replace(e[t],e[++t]);return n},t=V(function(t){return"return "+e((t||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")+";"});return function(e,n){var r;if(!(e in k))if(k[e]=!1,n&&(r=e.match(/^([\d\.]+)(em|vw|px)$/)))k[e]=r[1]*B[r[2]];else try{k[e]=new Function("e",t(e))(B)}catch(s){}return k[e]}}(),J=function(e,t){return e.w?(e.cWidth=g.calcListLength(t||"100vw"),e.res=e.w/e.cWidth):e.res=e.d,e},X=function(e){if(A){var n,r,s,i=e||{};if(i.elements&&1===i.elements.nodeType&&("IMG"===i.elements.nodeName.toUpperCase()?i.elements=[i.elements]:(i.context=i.elements,i.elements=null)),n=i.elements||g.qsa(i.context||t,i.reevaluate||i.reselect?g.sel:g.selShort),s=n.length){for(g.setupRun(i),$=!0,r=0;s>r;r++)g.fillImg(n[r],i);g.teardownRun(i)}}};e.console&&console.warn,L in w||(L="src"),T["image/jpeg"]=!0,T["image/gif"]=!0,T["image/png"]=!0,T["image/svg+xml"]=t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"),g.ns=("pf"+(new Date).getTime()).substr(0,9),g.supSrcset="srcset"in w,g.supSizes="sizes"in w,g.supPicture=!!e.HTMLPictureElement,g.supSrcset&&g.supPicture&&!g.supSizes&&function(e){w.srcset="data:,a",e.src="data:,a",g.supSrcset=w.complete===e.complete,g.supPicture=g.supSrcset&&g.supPicture}(t.createElement("img")),g.supSrcset&&!g.supSizes?function(){var e="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",n=t.createElement("img"),r=function(){2===n.width&&(g.supSizes=!0),m=g.supSrcset&&!g.supSizes,A=!0,setTimeout(X)};n.onload=r,n.onerror=r,n.setAttribute("sizes","9px"),n.srcset=e+" 1w,data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw== 9w",n.src=e}():A=!0,g.selShort="picture>img,img[srcset]",g.sel=g.selShort,g.cfg=M,g.DPR=D||1,g.u=B,g.types=T,g.setSize=v,g.makeUrl=V(function(e){return H.href=e,H.href}),g.qsa=function(e,t){return"querySelector"in e?e.querySelectorAll(t):[]},g.matchesMedia=function(){return e.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?g.matchesMedia=function(e){return!e||matchMedia(e).matches}:g.matchesMedia=g.mMQ,g.matchesMedia.apply(this,arguments)},g.mMQ=function(e){return!e||K(e)},g.calcLength=function(e){var t=K(e,!0)||!1;return 0>t&&(t=!1),t},g.supportsType=function(e){return!e||T[e]},g.parseSize=V(function(e){var t=(e||"").match(/(\([^)]+\))?\s*(.+)/);return{media:t&&t[1],length:t&&t[2]}}),g.parseSet=function(e){return e.cands||(e.cands=l(e.srcset,e)),e.cands},g.getEmValue=function(){var e;if(!p&&(e=t.body)){var n=t.createElement("div"),r=y.style.cssText,s=e.style.cssText;n.style.cssText="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",y.style.cssText=P,e.style.cssText=P,e.appendChild(n),p=n.offsetWidth,e.removeChild(n),p=parseFloat(p,10),y.style.cssText=r,e.style.cssText=s}return p||16},g.calcListLength=function(e){if(!(e in O)||M.uT){var t=g.calcLength(f(e));O[e]=t||B.width}return O[e]},g.setRes=function(e){var t;if(e){t=g.parseSet(e);for(var n=0,r=t.length;r>n;n++)J(t[n],e.sizes)}return t},g.setRes.res=J,g.applySetCandidate=function(e,t){if(e.length){var n,r,s,c,u,d,l,f,p,m=t[g.ns],h=g.DPR;if(d=m.curSrc||t[L],l=m.curCan||o(t,d,e[0].set),l&&l.set===e[0].set&&((p=z&&!t.complete&&l.res-.1>h)||(l.cached=!0,l.res>=h&&(u=l))),!u)for(e.sort(a),c=e.length,u=e[c-1],r=0;c>r;r++)if(n=e[r],n.res>=h){s=r-1,u=e[s]&&(p||d!==g.makeUrl(n.url))&&i(e[s].res,n.res,h,e[s].cached)?e[s]:n;break}u&&(f=g.makeUrl(u.url),m.curSrc=f,m.curCan=u,f!==d&&g.setSrc(t,u),g.setSize(t))}},g.setSrc=function(e,t){var n;e.src=t.url,"image/svg+xml"===t.set.type&&(n=e.style.width,e.style.width=e.offsetWidth+1+"px",e.offsetWidth+1&&(e.style.width=n))},g.getSet=function(e){var t,n,r,s=!1,i=e[g.ns].sets;for(t=0;ti?n=setTimeout(s,t-i):(n=null,e())};return function(){r=new Date,n||(n=setTimeout(s,t))}}(a,99)),_(t,"readystatechange",s)}(),g.picturefill=X,g.fillImgs=X,g.teardownRun=v,X._=g,e.picturefillCFG={pf:g,push:function(e){var t=e.shift();"function"==typeof g[t]?g[t].apply(g,e):(M[t]=e[0],$&&g.fillImgs({reselect:!0}))}};for(;N&&N.length;)e.picturefillCFG.push(N.shift());e.picturefill=X,"object"==typeof module&&"object"==typeof module.exports?module.exports=X:"function"==typeof define&&define.amd&&define("picturefill",function(){return X}),g.supPicture||(T["image/webp"]=function(t,n){var r=new e.Image;return r.onerror=function(){T[t]=!1,X()},r.onload=function(){T[t]=1===r.width,X()},r.src=n,"pending"}("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="))}(window,document),function(e){"use strict";var t,n=0,r=function(){window.picturefill&&e(window.picturefill),(window.picturefill||n>9999)&&clearInterval(t),n++};t=setInterval(r,8),r()}(function(e){"use strict";var t=window.document,n=window.Element,r=window.MutationObserver,s=function(){},i={disconnect:s,take:s,observe:s,start:s,stop:s,connected:!1},c=/^loade|^c|^i/.test(t.readyState||""),a=e._;if(a.mutationSupport=!1,a.observer=i,Object.keys&&window.HTMLSourceElement&&t.addEventListener){var o,u,d,l,f={src:1,srcset:1,sizes:1,media:1},p=Object.keys(f),m={attributes:!0,childList:!0,subtree:!0,attributeFilter:p},h=n&&n.prototype,g={},A=function(e,t){g[e]=a[e],a[e]=t};h&&!h.matches&&(h.matches=h.matchesSelector||h.mozMatchesSelector||h.webkitMatchesSelector||h.msMatchesSelector),h&&h.matches&&(o=function(e,t){return e.matches(t)},a.mutationSupport=!(!Object.create||!Object.defineProperties)),a.mutationSupport&&(i.observe=function(){d&&(i.connected=!0,u&&u.observe(t.documentElement,m))},i.disconnect=function(){i.connected=!1,u&&u.disconnect()},i.take=function(){u?a.onMutations(u.takeRecords()):l&&l.take()},i.start=function(){d=!0,i.observe()},i.stop=function(){d=!1,i.disconnect()},A("setupRun",function(){return i.disconnect(),g.setupRun.apply(this,arguments)}),A("teardownRun",function(){var e=g.setupRun.apply(this,arguments);return i.observe(),e}),A("setSrc",function(){var e,t=i.connected;return i.disconnect(),e=g.setSrc.apply(this,arguments),t&&i.observe(),e}),a.onMutations=function(e){var t,n,r=[];for(t=0,n=e.length;n>t;t++)c&&"childList"===e[t].type?a.onSubtreeChange(e[t],r):"attributes"===e[t].type&&a.onAttrChange(e[t],r);r.length&&a.fillImgs({elements:r,reevaluate:!0})},a.onSubtreeChange=function(e,t){a.findAddedMutations(e.addedNodes,t),a.findRemovedMutations(e.removedNodes,e.target,t)},a.findAddedMutations=function(e,t){var n,r,s,i;for(n=0,r=e.length;r>n;n++)s=e[n],1===s.nodeType&&(i=s.nodeName.toUpperCase(),"PICTURE"===i?a.addToElements(s.getElementsByTagName("img")[0],t):"IMG"===i&&o(s,a.selShort)?a.addToElements(s,t):"SOURCE"===i?a.addImgForSource(s,s.parentNode,t):a.addToElements(a.qsa(s,a.selShort),t))},a.findRemovedMutations=function(e,t,n){var r,s,i;for(r=0,s=e.length;s>r;r++)i=e[r],1===i.nodeType&&"SOURCE"===i.nodeName.toUpperCase()&&a.addImgForSource(i,t,n)},a.addImgForSource=function(e,t,n){t&&"PICTURE"!==(t.nodeName||"").toUpperCase()&&((t=t.parentNode)&&"PICTURE"===(t.nodeName||"").toUpperCase()||(t=null)),t&&a.addToElements(t.getElementsByTagName("img")[0],n)},a.addToElements=function(e,t){var n,r;if(e)if("length"in e&&!e.nodeType)for(n=0,r=e.length;r>n;n++)a.addToElements(e[n],t);else e.parentNode&&-1===t.indexOf(e)&&t.push(e)},a.onAttrChange=function(e,t){var n,r=e.target[a.ns];r||"srcset"!==e.attributeName||"IMG"!==(n=e.target.nodeName.toUpperCase())?r&&(n||(n=e.target.nodeName.toUpperCase()),"IMG"===n?(e.attributeName in r&&(r[e.attributeName]=void 0),a.addToElements(e.target,t)):"SOURCE"===n&&a.addImgForSource(e.target,e.target.parentNode,t)):a.addToElements(e.target,t)},a.supPicture||(r&&!a.testMutationEvents?u=new r(a.onMutations):(l=function(){var e=!1,t=[],n=window.setImmediate||window.setTimeout;return function(r){e||(e=!0,l.take||(l.take=function(){t.length&&(a.onMutations(t),t=[]),e=!1}),n(l.take)),t.push(r)}}(),t.documentElement.addEventListener("DOMNodeInserted",function(e){i.connected&&c&&l({type:"childList",addedNodes:[e.target],removedNodes:[]})},!0),t.documentElement.addEventListener("DOMNodeRemoved",function(e){i.connected&&c&&"SOURCE"===(e.target||{}).nodeName&&l({type:"childList",addedNodes:[],removedNodes:[e.target],target:e.target.parentNode})},!0),t.documentElement.addEventListener("DOMAttrModified",function(e){i.connected&&f[e.attrName]&&l({type:"attributes",target:e.target,attributeName:e.attrName})},!0)),window.HTMLImageElement&&Object.defineProperties&&function(){var e=t.createElement("img"),n=[],r=e.getAttribute,s=e.setAttribute,i={src:1};a.supSrcset&&!a.supSizes&&(i.srcset=1),Object.defineProperties(HTMLImageElement.prototype,{getAttribute:{value:function(e){var t;return i[e]&&(t=this[a.ns])&&void 0!==t[e]?t[e]:r.apply(this,arguments)},writeable:!0,enumerable:!0,configurable:!0}}),a.supSrcset||n.push("srcset"),a.supSizes||n.push("sizes"),n.forEach(function(e){Object.defineProperty(HTMLImageElement.prototype,e,{set:function(t){s.call(this,e,t)},get:function(){return r.call(this,e)||""},enumerable:!0,configurable:!0})}),"currentSrc"in e||function(){var e,n=function(e,t){null==t&&(t=e.src||""),Object.defineProperty(e,"pfCurrentSrc",{value:t,writable:!0})},r=n;a.supSrcset&&window.devicePixelRatio&&(e=function(e,t){return(e.d||e.w||e.res)-(t.d||t.w||t.res)},n=function(t){var n,s,i,c,o=t[a.ns];if(o&&o.supported&&o.srcset&&o.sets&&(s=a.parseSet(o.sets[0]))&&s.sort){for(s.sort(e),i=s.length,c=s[i-1],n=0;i>n;n++)if(s[n].d>=window.devicePixelRatio){c=s[n];break}c&&(c=a.makeUrl(c.url))}r(t,c)}),t.addEventListener("load",function(e){"IMG"===e.target.nodeName.toUpperCase()&&n(e.target)},!0),Object.defineProperty(HTMLImageElement.prototype,"currentSrc",{set:function(){window.console&&console.warn&&console.warn("currentSrc can't be set on img element")},get:function(){return this.complete&&n(this),this.src||this.srcset?this.pfCurrentSrc||"":""},enumerable:!0,configurable:!0})}(),!window.HTMLSourceElement||"srcset"in t.createElement("source")||["srcset","sizes"].forEach(function(e){Object.defineProperty(window.HTMLSourceElement.prototype,e,{set:function(t){this.setAttribute(e,t)},get:function(){return this.getAttribute(e)||""},enumerable:!0,configurable:!0})})}(),i.start()),c||t.addEventListener("DOMContentLoaded",function(){c=!0}))}});
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/HTMLPictureElement/raw.js b/polyfill-service-api/src/main/resources/polyfills/HTMLPictureElement/raw.js
deleted file mode 100644
index e3cd467..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/HTMLPictureElement/raw.js
+++ /dev/null
@@ -1,11 +0,0 @@
-
-// HTMLPictureElement
-/*! picturefill - v3.0.2 - 2016-02-12
- * https://scottjehl.github.io/picturefill/
- * Copyright (c) 2016 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT
- */
-!function(a){var b=navigator.userAgent;a.HTMLPictureElement&&/ecko/.test(b)&&b.match(/rv\:(\d+)/)&&RegExp.$1<45&&addEventListener("resize",function(){var b,c=document.createElement("source"),d=function(a){var b,d,e=a.parentNode;"PICTURE"===e.nodeName.toUpperCase()?(b=c.cloneNode(),e.insertBefore(b,e.firstElementChild),setTimeout(function(){e.removeChild(b)})):(!a._pfLastSize||a.offsetWidth>a._pfLastSize)&&(a._pfLastSize=a.offsetWidth,d=a.sizes,a.sizes+=",100vw",setTimeout(function(){a.sizes=d}))},e=function(){var a,b=document.querySelectorAll("picture > img, img[srcset][sizes]");for(a=0;a2.7?h=c+1:(f=b-c,e=Math.pow(a-.6,1.5),g=f*e,d&&(g+=.1*e),h=a+g):h=c>1?Math.sqrt(a*b):a,h>c}function h(a){var b,c=s.getSet(a),d=!1;"pending"!==c&&(d=r,c&&(b=s.setRes(c),s.applySetCandidate(b,a))),a[s.ns].evaled=d}function i(a,b){return a.res-b.res}function j(a,b,c){var d;return!c&&b&&(c=a[s.ns].sets,c=c&&c[c.length-1]),d=k(b,c),d&&(b=s.makeUrl(b),a[s.ns].curSrc=b,a[s.ns].curCan=d,d.res||aa(d,d.set.sizes)),d}function k(a,b){var c,d,e;if(a&&b)for(e=s.parseSet(b),a=s.makeUrl(a),c=0;cc;c++)e=g[c],e[s.ns]=!0,f=e.getAttribute("srcset"),f&&b.push({srcset:f,media:e.getAttribute("media"),type:e.getAttribute("type"),sizes:e.getAttribute("sizes")})}function m(a,b){function c(b){var c,d=b.exec(a.substring(m));return d?(c=d[0],m+=c.length,c):void 0}function e(){var a,c,d,e,f,i,j,k,l,m=!1,o={};for(e=0;el?m=!0:c=l):X.test(j)&&"h"===i?((d||c)&&(m=!0),0===k?m=!0:d=k):m=!0;m||(o.url=g,a&&(o.w=a),c&&(o.d=c),d&&(o.h=d),d||c||a||(o.d=1),1===o.d&&(b.has1x=!0),o.set=b,n.push(o))}function f(){for(c(T),i="",j="in descriptor";;){if(k=a.charAt(m),"in descriptor"===j)if(d(k))i&&(h.push(i),i="",j="after descriptor");else{if(","===k)return m+=1,i&&h.push(i),void e();if("("===k)i+=k,j="in parens";else{if(""===k)return i&&h.push(i),void e();i+=k}}else if("in parens"===j)if(")"===k)i+=k,j="in descriptor";else{if(""===k)return h.push(i),void e();i+=k}else if("after descriptor"===j)if(d(k));else{if(""===k)return void e();j="in descriptor",m-=1}m+=1}}for(var g,h,i,j,k,l=a.length,m=0,n=[];;){if(c(U),m>=l)return n;g=c(V),h=[],","===g.slice(-1)?(g=g.replace(W,""),e()):f()}}function n(a){function b(a){function b(){f&&(g.push(f),f="")}function c(){g[0]&&(h.push(g),g=[])}for(var e,f="",g=[],h=[],i=0,j=0,k=!1;;){if(e=a.charAt(j),""===e)return b(),c(),h;if(k){if("*"===e&&"/"===a[j+1]){k=!1,j+=2,b();continue}j+=1}else{if(d(e)){if(a.charAt(j-1)&&d(a.charAt(j-1))||!f){j+=1;continue}if(0===i){b(),j+=1;continue}e=" "}else if("("===e)i+=1;else if(")"===e)i-=1;else{if(","===e){b(),c(),j+=1;continue}if("/"===e&&"*"===a.charAt(j+1)){k=!0,j+=2;continue}}f+=e,j+=1}}}function c(a){return k.test(a)&&parseFloat(a)>=0?!0:l.test(a)?!0:"0"===a||"-0"===a||"+0"===a?!0:!1}var e,f,g,h,i,j,k=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,l=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;for(f=b(a),g=f.length,e=0;g>e;e++)if(h=f[e],i=h[h.length-1],c(i)){if(j=i,h.pop(),0===h.length)return j;if(h=h.join(" "),s.matchesMedia(h))return j}return"100vw"}b.createElement("picture");var o,p,q,r,s={},t=!1,u=function(){},v=b.createElement("img"),w=v.getAttribute,x=v.setAttribute,y=v.removeAttribute,z=b.documentElement,A={},B={algorithm:""},C="data-pfsrc",D=C+"set",E=navigator.userAgent,F=/rident/.test(E)||/ecko/.test(E)&&E.match(/rv\:(\d+)/)&&RegExp.$1>35,G="currentSrc",H=/\s+\+?\d+(e\d+)?w/,I=/(\([^)]+\))?\s*(.+)/,J=a.picturefillCFG,K="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",L="font-size:100%!important;",M=!0,N={},O={},P=a.devicePixelRatio,Q={px:1,"in":96},R=b.createElement("a"),S=!1,T=/^[ \t\n\r\u000c]+/,U=/^[, \t\n\r\u000c]+/,V=/^[^ \t\n\r\u000c]+/,W=/[,]+$/,X=/^\d+$/,Y=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,Z=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d||!1):a.attachEvent&&a.attachEvent("on"+b,c)},$=function(a){var b={};return function(c){return c in b||(b[c]=a(c)),b[c]}},_=function(){var a=/^([\d\.]+)(em|vw|px)$/,b=function(){for(var a=arguments,b=0,c=a[0];++b in a;)c=c.replace(a[b],a[++b]);return c},c=$(function(a){return"return "+b((a||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")+";"});return function(b,d){var e;if(!(b in N))if(N[b]=!1,d&&(e=b.match(a)))N[b]=e[1]*Q[e[2]];else try{N[b]=new Function("e",c(b))(Q)}catch(f){}return N[b]}}(),aa=function(a,b){return a.w?(a.cWidth=s.calcListLength(b||"100vw"),a.res=a.w/a.cWidth):a.res=a.d,a},ba=function(a){if(t){var c,d,e,f=a||{};if(f.elements&&1===f.elements.nodeType&&("IMG"===f.elements.nodeName.toUpperCase()?f.elements=[f.elements]:(f.context=f.elements,f.elements=null)),c=f.elements||s.qsa(f.context||b,f.reevaluate||f.reselect?s.sel:s.selShort),e=c.length){for(s.setupRun(f),S=!0,d=0;e>d;d++)s.fillImg(c[d],f);s.teardownRun(f)}}};o=a.console&&console.warn?function(a){console.warn(a)}:u,G in v||(G="src"),A["image/jpeg"]=!0,A["image/gif"]=!0,A["image/png"]=!0,A["image/svg+xml"]=b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"),s.ns=("pf"+(new Date).getTime()).substr(0,9),s.supSrcset="srcset"in v,s.supSizes="sizes"in v,s.supPicture=!!a.HTMLPictureElement,s.supSrcset&&s.supPicture&&!s.supSizes&&!function(a){v.srcset="data:,a",a.src="data:,a",s.supSrcset=v.complete===a.complete,s.supPicture=s.supSrcset&&s.supPicture}(b.createElement("img")),s.supSrcset&&!s.supSizes?!function(){var a="data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw==",c="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d=b.createElement("img"),e=function(){var a=d.width;2===a&&(s.supSizes=!0),q=s.supSrcset&&!s.supSizes,t=!0,setTimeout(ba)};d.onload=e,d.onerror=e,d.setAttribute("sizes","9px"),d.srcset=c+" 1w,"+a+" 9w",d.src=c}():t=!0,s.selShort="picture>img,img[srcset]",s.sel=s.selShort,s.cfg=B,s.DPR=P||1,s.u=Q,s.types=A,s.setSize=u,s.makeUrl=$(function(a){return R.href=a,R.href}),s.qsa=function(a,b){return"querySelector"in a?a.querySelectorAll(b):[]},s.matchesMedia=function(){return a.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?s.matchesMedia=function(a){return!a||matchMedia(a).matches}:s.matchesMedia=s.mMQ,s.matchesMedia.apply(this,arguments)},s.mMQ=function(a){return a?_(a):!0},s.calcLength=function(a){var b=_(a,!0)||!1;return 0>b&&(b=!1),b},s.supportsType=function(a){return a?A[a]:!0},s.parseSize=$(function(a){var b=(a||"").match(I);return{media:b&&b[1],length:b&&b[2]}}),s.parseSet=function(a){return a.cands||(a.cands=m(a.srcset,a)),a.cands},s.getEmValue=function(){var a;if(!p&&(a=b.body)){var c=b.createElement("div"),d=z.style.cssText,e=a.style.cssText;c.style.cssText=K,z.style.cssText=L,a.style.cssText=L,a.appendChild(c),p=c.offsetWidth,a.removeChild(c),p=parseFloat(p,10),z.style.cssText=d,a.style.cssText=e}return p||16},s.calcListLength=function(a){if(!(a in O)||B.uT){var b=s.calcLength(n(a));O[a]=b?b:Q.width}return O[a]},s.setRes=function(a){var b;if(a){b=s.parseSet(a);for(var c=0,d=b.length;d>c;c++)aa(b[c],a.sizes)}return b},s.setRes.res=aa,s.applySetCandidate=function(a,b){if(a.length){var c,d,e,f,h,k,l,m,n,o=b[s.ns],p=s.DPR;if(k=o.curSrc||b[G],l=o.curCan||j(b,k,a[0].set),l&&l.set===a[0].set&&(n=F&&!b.complete&&l.res-.1>p,n||(l.cached=!0,l.res>=p&&(h=l))),!h)for(a.sort(i),f=a.length,h=a[f-1],d=0;f>d;d++)if(c=a[d],c.res>=p){e=d-1,h=a[e]&&(n||k!==s.makeUrl(c.url))&&g(a[e].res,c.res,p,a[e].cached)?a[e]:c;break}h&&(m=s.makeUrl(h.url),o.curSrc=m,o.curCan=h,m!==k&&s.setSrc(b,h),s.setSize(b))}},s.setSrc=function(a,b){var c;a.src=b.url,"image/svg+xml"===b.set.type&&(c=a.style.width,a.style.width=a.offsetWidth+1+"px",a.offsetWidth+1&&(a.style.width=c))},s.getSet=function(a){var b,c,d,e=!1,f=a[s.ns].sets;for(b=0;bf?c=setTimeout(e,b-f):(c=null,a())};return function(){d=new Date,c||(c=setTimeout(e,b))}},h=z.clientHeight,i=function(){M=Math.max(a.innerWidth||0,z.clientWidth)!==Q.width||z.clientHeight!==h,h=z.clientHeight,M&&s.fillImgs()};Z(a,"resize",g(i,99)),Z(b,"readystatechange",e)}(),s.picturefill=ba,s.fillImgs=ba,s.teardownRun=u,ba._=s,a.picturefillCFG={pf:s,push:function(a){var b=a.shift();"function"==typeof s[b]?s[b].apply(s,a):(B[b]=a[0],S&&s.fillImgs({reselect:!0}))}};for(;J&&J.length;)a.picturefillCFG.push(J.shift());a.picturefill=ba,"object"==typeof module&&"object"==typeof module.exports?module.exports=ba:"function"==typeof define&&define.amd&&define("picturefill",function(){return ba}),s.supPicture||(A["image/webp"]=e("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="))}(window,document);/*! picturefill - v3.0.2 - 2016-02-12
- * https://scottjehl.github.io/picturefill/
- * Copyright (c) 2016 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT
- */
-!function(a){"use strict";var b,c=0,d=function(){window.picturefill&&a(window.picturefill),(window.picturefill||c>9999)&&clearInterval(b),c++};b=setInterval(d,8),d()}(function(a){"use strict";var b=window.document,c=window.Element,d=window.MutationObserver,e=function(){},f={disconnect:e,take:e,observe:e,start:e,stop:e,connected:!1},g=/^loade|^c|^i/.test(b.readyState||""),h=a._;if(h.mutationSupport=!1,h.observer=f,Object.keys&&window.HTMLSourceElement&&b.addEventListener){var i,j,k,l,m={src:1,srcset:1,sizes:1,media:1},n=Object.keys(m),o={attributes:!0,childList:!0,subtree:!0,attributeFilter:n},p=c&&c.prototype,q={},r=function(a,b){q[a]=h[a],h[a]=b};p&&!p.matches&&(p.matches=p.matchesSelector||p.mozMatchesSelector||p.webkitMatchesSelector||p.msMatchesSelector),p&&p.matches&&(i=function(a,b){return a.matches(b)},h.mutationSupport=!(!Object.create||!Object.defineProperties)),h.mutationSupport&&(f.observe=function(){k&&(f.connected=!0,j&&j.observe(b.documentElement,o))},f.disconnect=function(){f.connected=!1,j&&j.disconnect()},f.take=function(){j?h.onMutations(j.takeRecords()):l&&l.take()},f.start=function(){k=!0,f.observe()},f.stop=function(){k=!1,f.disconnect()},r("setupRun",function(){return f.disconnect(),q.setupRun.apply(this,arguments)}),r("teardownRun",function(){var a=q.setupRun.apply(this,arguments);return f.observe(),a}),r("setSrc",function(){var a,b=f.connected;return f.disconnect(),a=q.setSrc.apply(this,arguments),b&&f.observe(),a}),h.onMutations=function(a){var b,c,d=[];for(b=0,c=a.length;c>b;b++)g&&"childList"===a[b].type?h.onSubtreeChange(a[b],d):"attributes"===a[b].type&&h.onAttrChange(a[b],d);d.length&&h.fillImgs({elements:d,reevaluate:!0})},h.onSubtreeChange=function(a,b){h.findAddedMutations(a.addedNodes,b),h.findRemovedMutations(a.removedNodes,a.target,b)},h.findAddedMutations=function(a,b){var c,d,e,f;for(c=0,d=a.length;d>c;c++)e=a[c],1===e.nodeType&&(f=e.nodeName.toUpperCase(),"PICTURE"===f?h.addToElements(e.getElementsByTagName("img")[0],b):"IMG"===f&&i(e,h.selShort)?h.addToElements(e,b):"SOURCE"===f?h.addImgForSource(e,e.parentNode,b):h.addToElements(h.qsa(e,h.selShort),b))},h.findRemovedMutations=function(a,b,c){var d,e,f;for(d=0,e=a.length;e>d;d++)f=a[d],1===f.nodeType&&"SOURCE"===f.nodeName.toUpperCase()&&h.addImgForSource(f,b,c)},h.addImgForSource=function(a,b,c){b&&"PICTURE"!==(b.nodeName||"").toUpperCase()&&(b=b.parentNode,b&&"PICTURE"===(b.nodeName||"").toUpperCase()||(b=null)),b&&h.addToElements(b.getElementsByTagName("img")[0],c)},h.addToElements=function(a,b){var c,d;if(a)if("length"in a&&!a.nodeType)for(c=0,d=a.length;d>c;c++)h.addToElements(a[c],b);else a.parentNode&&-1===b.indexOf(a)&&b.push(a)},h.onAttrChange=function(a,b){var c,d=a.target[h.ns];d||"srcset"!==a.attributeName||"IMG"!==(c=a.target.nodeName.toUpperCase())?d&&(c||(c=a.target.nodeName.toUpperCase()),"IMG"===c?(a.attributeName in d&&(d[a.attributeName]=void 0),h.addToElements(a.target,b)):"SOURCE"===c&&h.addImgForSource(a.target,a.target.parentNode,b)):h.addToElements(a.target,b)},h.supPicture||(d&&!h.testMutationEvents?j=new d(h.onMutations):(l=function(){var a=!1,b=[],c=window.setImmediate||window.setTimeout;return function(d){a||(a=!0,l.take||(l.take=function(){b.length&&(h.onMutations(b),b=[]),a=!1}),c(l.take)),b.push(d)}}(),b.documentElement.addEventListener("DOMNodeInserted",function(a){f.connected&&g&&l({type:"childList",addedNodes:[a.target],removedNodes:[]})},!0),b.documentElement.addEventListener("DOMNodeRemoved",function(a){f.connected&&g&&"SOURCE"===(a.target||{}).nodeName&&l({type:"childList",addedNodes:[],removedNodes:[a.target],target:a.target.parentNode})},!0),b.documentElement.addEventListener("DOMAttrModified",function(a){f.connected&&m[a.attrName]&&l({type:"attributes",target:a.target,attributeName:a.attrName})},!0)),window.HTMLImageElement&&Object.defineProperties&&!function(){var a=b.createElement("img"),c=[],d=a.getAttribute,e=a.setAttribute,f={src:1};h.supSrcset&&!h.supSizes&&(f.srcset=1),Object.defineProperties(HTMLImageElement.prototype,{getAttribute:{value:function(a){var b;return f[a]&&(b=this[h.ns])&&void 0!==b[a]?b[a]:d.apply(this,arguments)},writeable:!0,enumerable:!0,configurable:!0}}),h.supSrcset||c.push("srcset"),h.supSizes||c.push("sizes"),c.forEach(function(a){Object.defineProperty(HTMLImageElement.prototype,a,{set:function(b){e.call(this,a,b)},get:function(){return d.call(this,a)||""},enumerable:!0,configurable:!0})}),"currentSrc"in a||!function(){var a,c=function(a,b){null==b&&(b=a.src||""),Object.defineProperty(a,"pfCurrentSrc",{value:b,writable:!0})},d=c;h.supSrcset&&window.devicePixelRatio&&(a=function(a,b){var c=a.d||a.w||a.res,d=b.d||b.w||b.res;return c-d},c=function(b){var c,e,f,g,i=b[h.ns];if(i&&i.supported&&i.srcset&&i.sets&&(e=h.parseSet(i.sets[0]))&&e.sort){for(e.sort(a),f=e.length,g=e[f-1],c=0;f>c;c++)if(e[c].d>=window.devicePixelRatio){g=e[c];break}g&&(g=h.makeUrl(g.url))}d(b,g)}),b.addEventListener("load",function(a){"IMG"===a.target.nodeName.toUpperCase()&&c(a.target)},!0),Object.defineProperty(HTMLImageElement.prototype,"currentSrc",{set:function(){window.console&&console.warn&&console.warn("currentSrc can't be set on img element")},get:function(){return this.complete&&c(this),this.src||this.srcset?this.pfCurrentSrc||"":""},enumerable:!0,configurable:!0})}(),!window.HTMLSourceElement||"srcset"in b.createElement("source")||["srcset","sizes"].forEach(function(a){Object.defineProperty(window.HTMLSourceElement.prototype,a,{set:function(b){this.setAttribute(a,b)},get:function(){return this.getAttribute(a)||""},enumerable:!0,configurable:!0})})}(),f.start()),g||b.addEventListener("DOMContentLoaded",function(){g=!0}))}});
\ No newline at end of file
diff --git a/polyfill-service-api/src/main/resources/polyfills/IntersectionObserver/meta.json b/polyfill-service-api/src/main/resources/polyfills/IntersectionObserver/meta.json
deleted file mode 100644
index 53e060f..0000000
--- a/polyfill-service-api/src/main/resources/polyfills/IntersectionObserver/meta.json
+++ /dev/null
@@ -1 +0,0 @@
-{"aliases":[],"browsers":{"android":"4.4 - *","bb":"7 - 10","chrome":"<51","firefox":"<52","firefox_mob":"47 - *","ie":"7 - *","ie_mob":"11 - *","ios_saf":"7 - *","op_mini":"17 - *","opera":"*","safari":"6 - *","samsung_mob":"*"},"dependencies":["getComputedStyle","Array.isArray","Array.prototype.filter","Array.prototype.forEach","Array.prototype.indexOf","Array.prototype.map","Array.prototype.some","Event","Function.prototype.bind","perfomance.now"],"docs":"https://github.com/WICG/IntersectionObserver/blob/master/explainer.md","spec":"http://rawgit.com/WICG/IntersectionObserver/master/index.html","notes":[],"repo":"https://github.com/WICG/IntersectionObserver","install":{"module":"intersection-observer","paths":["intersection-observer"]},"detectSource":"\"IntersectionObserver\" in this","testSource":"","baseDir":"IntersectionObserver","hasTests":true,"testsSource":"/* eslint-env mocha, browser*/\n/* global proclaim, it */\n\nbefore(function(done) {\n var head = head = document.head || document.getElementsByTagName('head')[0];\n var scriptEl = document.createElement('script');\n var readywait = null;\n scriptEl.src = 'https://cdnjs.cloudflare.com/ajax/libs/sinon.js/1.15.4/sinon.min.js';\n scriptEl.onload = function() {\n clearTimeout(readywait);\n done();\n };\n readywait = setInterval(function() {\n if ('sinon' in window) {\n clearTimeout(readywait);\n done();\n }\n }, 500);\n head.appendChild(scriptEl);\n});\n\nthis.timeout(10000);\n\n/* The following copy-paste from https://raw.githubusercontent.com/philipwalton/IntersectionObserver/ddc47f358db7624ac52a524451ef9f2a3d5ce8f7/polyfill/intersection-observer-test.js */\n\n\n/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n// Sets the timeout to three times the poll interval to ensure all updates\n// happen (especially in slower browsers). Native implementations get the\n// standard 100ms timeout defined in the spec.\nvar ASYNC_TIMEOUT = IntersectionObserver.prototype.THROTTLE_TIMEOUT * 3 || 100;\n\n\nvar io;\nvar noop = function() {};\n\n\n// References to DOM elements, which are accessible to any test\n// and reset prior to each test so state isn't shared.\nvar rootEl;\nvar grandParentEl;\nvar parentEl;\nvar targetEl1;\nvar targetEl2;\nvar targetEl3;\nvar targetEl4;\n\n\ndescribe('IntersectionObserver', function() {\n\n before(function() {\n // If the browser running the tests doesn't support MutationObserver,\n // fall back to polling.\n if (!('MutationObserver' in window)) {\n IntersectionObserver.prototype.POLL_INTERVAL =\n IntersectionObserver.prototype.THROTTLE_TIMEOUT || 100;\n }\n });\n\n\n beforeEach(function() {\n addStyles();\n addFixtures();\n });\n\n\n afterEach(function() {\n if (io && 'disconnect' in io) io.disconnect();\n io = null;\n\n removeStyles();\n removeFixtures();\n });\n\n\n describe('constructor', function() {\n\n it('throws when callback is not a function', function() {\n proclaim.throws(function() {\n io = new IntersectionObserver(null);\n }, /function/i);\n });\n\n\n it('instantiates root correctly', function() {\n io = new IntersectionObserver(noop);\n proclaim.equal(io.root, null);\n\n io = new IntersectionObserver(noop, {root: rootEl});\n proclaim.equal(io.root, rootEl);\n });\n\n\n it('throws when root is not an Element', function() {\n proclaim.throws(function() {\n io = new IntersectionObserver(noop, {root: 'foo'});\n }, /element/i);\n });\n\n\n it('instantiates rootMargin correctly', function() {\n io = new IntersectionObserver(noop, {rootMargin: '10px'});\n proclaim.equal(io.rootMargin, '10px 10px 10px 10px');\n\n io = new IntersectionObserver(noop, {rootMargin: '10px -5%'});\n proclaim.equal(io.rootMargin, '10px -5% 10px -5%');\n\n io = new IntersectionObserver(noop, {rootMargin: '10px 20% 0px'});\n proclaim.equal(io.rootMargin, '10px 20% 0px 20%');\n\n io = new IntersectionObserver(noop, {rootMargin: '0px 0px -5% 5px'});\n proclaim.equal(io.rootMargin, '0px 0px -5% 5px');\n\n // TODO(philipwalton): the polyfill supports fractional pixel and\n // percentage values, but the native Chrome implementation does not,\n // at least not in what it reports `rootMargin` to be.\n if (!supportsNativeIntersectionObserver()) {\n io = new IntersectionObserver(noop, {rootMargin: '-2.5% -8.5px'});\n proclaim.equal(io.rootMargin, '-2.5% -8.5px -2.5% -8.5px');\n }\n });\n\n\n it('throws when rootMargin is not in pixels or pecernt', function() {\n proclaim.throws(function() {\n io = new IntersectionObserver(noop, {rootMargin: '0'});\n }, /pixels.*percent/i);\n });\n\n\n // Chrome's implementation in version 51 doesn't include the thresholds\n // property, but versions 52+ do.\n if ('thresholds' in IntersectionObserver.prototype) {\n it('instantiates thresholds correctly', function() {\n io = new IntersectionObserver(noop);\n proclaim.deepEqual(io.thresholds, [0]);\n\n io = new IntersectionObserver(noop, {threshold: 0.5});\n proclaim.deepEqual(io.thresholds, [0.5]);\n\n io = new IntersectionObserver(noop, {threshold: [0.25, 0.5, 0.75]});\n proclaim.deepEqual(io.thresholds, [0.25, 0.5, 0.75]);\n\n io = new IntersectionObserver(noop, {threshold: [1, .5, 0]});\n proclaim.deepEqual(io.thresholds, [0, .5, 1]);\n });\n }\n\n\n it('throws when a threshold value is not between 0 and 1', function() {\n proclaim.throws(function() {\n io = new IntersectionObserver(noop, {threshold: [0, -1]});\n }, /threshold/i);\n });\n\n });\n\n\n describe('observe', function() {\n\n it('throws when target is not an Element', function() {\n proclaim.throws(function() {\n io = new IntersectionObserver(noop);\n io.observe(null);\n }, /element/i);\n });\n\n\n it('triggers if target intersects when observing begins', function(done) {\n io = new IntersectionObserver(function(records) {\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 1);\n done();\n }, {root: rootEl});\n io.observe(targetEl1);\n });\n\n\n it('triggers with the correct arguments', function(done) {\n io = new IntersectionObserver(function(records, observer) {\n proclaim.equal(records.length, 1);\n proclaim.isInstanceOf(records[0], IntersectionObserverEntry);\n proclaim.equal(observer, io);\n proclaim.equal(this, io);\n done();\n }, {root: rootEl});\n io.observe(targetEl1);\n });\n\n\n it('does not trigger if target does not intersect when observing begins',\n function(done) {\n\n var spy = sinon.spy();\n io = new IntersectionObserver(spy, {root: rootEl});\n\n targetEl2.style.top = '-40px';\n io.observe(targetEl2);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 0);\n done();\n }, ASYNC_TIMEOUT);\n });\n\n\n it('handles container elements with non-visible overflow',\n function(done) {\n\n var spy = sinon.spy();\n io = new IntersectionObserver(spy, {root: rootEl});\n\n runSequence([\n function(done) {\n io.observe(targetEl1);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 1);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 1);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n targetEl1.style.left = '-40px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 2);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 0);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n parentEl.style.overflow = 'visible';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 3);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 1);\n done();\n }, ASYNC_TIMEOUT);\n }\n ], done);\n });\n\n\n it('observes one target at a single threshold correctly', function(done) {\n\n var spy = sinon.spy();\n io = new IntersectionObserver(spy, {root: rootEl, threshold: 0.5});\n\n runSequence([\n function(done) {\n targetEl1.style.left = '-5px';\n io.observe(targetEl1);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 1);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.greaterThan(records[0].intersectionRatio, 0.5);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n targetEl1.style.left = '-15px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 2);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.lessThan(records[0].intersectionRatio, 0.5);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n targetEl1.style.left = '-25px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 2);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n targetEl1.style.left = '-10px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 3);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 0.5);\n done();\n }, ASYNC_TIMEOUT);\n }\n ], done);\n\n });\n\n\n it('observes multiple targets at multiple thresholds correctly',\n function(done) {\n\n var spy = sinon.spy();\n io = new IntersectionObserver(spy, {\n root: rootEl,\n threshold: [1, 0.5, 0]\n });\n\n runSequence([\n function(done) {\n targetEl1.style.top = '0px';\n targetEl1.style.left = '-15px';\n targetEl2.style.top = '-5px';\n targetEl2.style.left = '0px';\n targetEl3.style.top = '0px';\n targetEl3.style.left = '205px';\n io.observe(targetEl1);\n io.observe(targetEl2);\n io.observe(targetEl3);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 1);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 2);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[0].intersectionRatio, 0.25);\n proclaim.equal(records[1].target, targetEl2);\n proclaim.equal(records[1].intersectionRatio, 0.75);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n targetEl1.style.top = '0px';\n targetEl1.style.left = '-5px';\n targetEl2.style.top = '-15px';\n targetEl2.style.left = '0px';\n targetEl3.style.top = '0px';\n targetEl3.style.left = '195px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 2);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 3);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[0].intersectionRatio, 0.75);\n proclaim.equal(records[1].target, targetEl2);\n proclaim.equal(records[1].intersectionRatio, 0.25);\n proclaim.equal(records[2].target, targetEl3);\n proclaim.equal(records[2].intersectionRatio, 0.25);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n targetEl1.style.top = '0px';\n targetEl1.style.left = '5px';\n targetEl2.style.top = '-25px';\n targetEl2.style.left = '0px';\n targetEl3.style.top = '0px';\n targetEl3.style.left = '185px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 3);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 3);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[0].intersectionRatio, 1);\n proclaim.equal(records[1].target, targetEl2);\n proclaim.equal(records[1].intersectionRatio, 0);\n proclaim.equal(records[2].target, targetEl3);\n proclaim.equal(records[2].intersectionRatio, 0.75);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n targetEl1.style.top = '0px';\n targetEl1.style.left = '15px';\n targetEl2.style.top = '-35px';\n targetEl2.style.left = '0px';\n targetEl3.style.top = '0px';\n targetEl3.style.left = '175px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 4);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].target, targetEl3);\n proclaim.equal(records[0].intersectionRatio, 1);\n done();\n }, ASYNC_TIMEOUT);\n }\n ], done);\n });\n\n\n it('handles rootMargin properly', function(done) {\n\n parentEl.style.overflow = 'visible';\n targetEl1.style.top = '0px';\n targetEl1.style.left = '-20px';\n targetEl2.style.top = '-20px';\n targetEl2.style.left = '0px';\n targetEl3.style.top = '0px';\n targetEl3.style.left = '200px';\n targetEl4.style.top = '180px';\n targetEl4.style.left = '180px';\n\n runSequence([\n function(done) {\n io = new IntersectionObserver(function(records) {\n records = sortRecords(records);\n proclaim.equal(records.length, 4);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[0].intersectionRatio, 1);\n proclaim.equal(records[1].target, targetEl2);\n proclaim.equal(records[1].intersectionRatio, .5);\n proclaim.equal(records[2].target, targetEl3);\n proclaim.equal(records[2].intersectionRatio, .5);\n proclaim.equal(records[3].target, targetEl4);\n proclaim.equal(records[3].intersectionRatio, 1);\n io.disconnect();\n done();\n }, {root: rootEl, rootMargin: '10px'});\n\n io.observe(targetEl1);\n io.observe(targetEl2);\n io.observe(targetEl3);\n io.observe(targetEl4);\n\n // Force a new frame to fix https://crbug.com/612323\n window.requestAnimationFrame && requestAnimationFrame(function(){});\n },\n function(done) {\n io = new IntersectionObserver(function(records) {\n records = sortRecords(records);\n proclaim.equal(records.length, 3);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[0].intersectionRatio, 0.5);\n proclaim.equal(records[1].target, targetEl3);\n proclaim.equal(records[1].intersectionRatio, 0.5);\n proclaim.equal(records[2].target, targetEl4);\n proclaim.equal(records[2].intersectionRatio, 0.5);\n io.disconnect();\n done();\n }, {root: rootEl, rootMargin: '-10px 10%'});\n\n io.observe(targetEl1);\n io.observe(targetEl2);\n io.observe(targetEl3);\n io.observe(targetEl4);\n\n // Force a new frame to fix https://crbug.com/612323\n window.requestAnimationFrame && requestAnimationFrame(function(){});\n },\n function(done) {\n io = new IntersectionObserver(function(records) {\n records = sortRecords(records);\n proclaim.equal(records.length, 2);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[0].intersectionRatio, 0.5);\n proclaim.equal(records[1].target, targetEl4);\n proclaim.equal(records[1].intersectionRatio, 0.5);\n io.disconnect();\n done();\n }, {root: rootEl, rootMargin: '-5% -2.5% 0px'});\n\n io.observe(targetEl1);\n io.observe(targetEl2);\n io.observe(targetEl3);\n io.observe(targetEl4);\n\n // Force a new frame to fix https://crbug.com/612323\n window.requestAnimationFrame && requestAnimationFrame(function(){});\n },\n function(done) {\n io = new IntersectionObserver(function(records) {\n records = sortRecords(records);\n proclaim.equal(records.length, 3);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[0].intersectionRatio, 0.5);\n proclaim.equal(records[1].target, targetEl2);\n proclaim.equal(records[1].intersectionRatio, 0.5);\n proclaim.equal(records[2].target, targetEl4);\n proclaim.equal(records[2].intersectionRatio, 0.25);\n io.disconnect();\n done();\n }, {root: rootEl, rootMargin: '5% -2.5% -10px -190px'});\n\n io.observe(targetEl1);\n io.observe(targetEl2);\n io.observe(targetEl3);\n io.observe(targetEl4);\n\n // Force a new frame to fix https://crbug.com/612323\n window.requestAnimationFrame && requestAnimationFrame(function(){});\n }\n ], done);\n });\n\n\n it('handles targets on the boundary of root', function(done) {\n\n var spy = sinon.spy();\n io = new IntersectionObserver(spy, {root: rootEl});\n\n runSequence([\n function(done) {\n targetEl1.style.top = '0px';\n targetEl1.style.left = '-21px';\n targetEl2.style.top = '-20px';\n targetEl2.style.left = '0px';\n io.observe(targetEl1);\n io.observe(targetEl2);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 1);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 0);\n proclaim.equal(records[0].target, targetEl2);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n targetEl1.style.top = '0px';\n targetEl1.style.left = '-20px';\n targetEl2.style.top = '-21px';\n targetEl2.style.left = '0px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 2);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 2);\n proclaim.equal(records[0].intersectionRatio, 0);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[1].intersectionRatio, 0);\n proclaim.equal(records[1].target, targetEl2);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n targetEl1.style.top = '-20px';\n targetEl1.style.left = '200px';\n targetEl2.style.top = '200px';\n targetEl2.style.left = '200px';\n\n setTimeout(function() {\n proclaim.equal(spy.callCount, 3);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 0);\n proclaim.equal(records[0].target, targetEl2);\n done();\n }, ASYNC_TIMEOUT);\n }\n ], done);\n\n });\n\n\n it('handles zero-size targets within the root coordinate space',\n function(done) {\n\n io = new IntersectionObserver(function(records) {\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 0);\n done();\n }, {root: rootEl});\n\n targetEl1.style.top = '0px';\n targetEl1.style.left = '0px';\n targetEl1.style.width = '0px';\n targetEl1.style.height = '0px';\n io.observe(targetEl1);\n });\n\n\n it('handles root/target elements not yet in the DOM', function(done) {\n\n rootEl.parentNode.removeChild(rootEl);\n targetEl1.parentNode.removeChild(targetEl1);\n\n var spy = sinon.spy();\n io = new IntersectionObserver(spy, {root: rootEl});\n\n runSequence([\n function(done) {\n io.observe(targetEl1);\n setTimeout(done, 0);\n },\n function(done) {\n document.getElementById('fixtures').appendChild(rootEl);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 0);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n parentEl.insertBefore(targetEl1, targetEl2);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 1);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 1);\n proclaim.equal(records[0].target, targetEl1);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n grandParentEl.parentNode.removeChild(grandParentEl);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 2);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 0);\n proclaim.equal(records[0].target, targetEl1);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n rootEl.appendChild(targetEl1);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 3);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 1);\n proclaim.equal(records[0].target, targetEl1);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n rootEl.parentNode.removeChild(rootEl);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 4);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 0);\n proclaim.equal(records[0].target, targetEl1);\n done();\n }, ASYNC_TIMEOUT);\n }\n ], done);\n });\n\n\n it('handles sub-root element scrolling', function(done) {\n io = new IntersectionObserver(function(records) {\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].intersectionRatio, 1);\n done();\n }, {root: rootEl});\n\n io.observe(targetEl3);\n setTimeout(function() {\n parentEl.scrollLeft = 40;\n }, 0);\n });\n\n\n // Only run this test in browsers that support CSS transitions.\n if ('transform' in document.documentElement.style &&\n 'transform' in document.documentElement.style) {\n\n it('supports CSS transitions and transforms', function(done) {\n\n targetEl1.style.top = '220px';\n targetEl1.style.left = '220px';\n\n io = new IntersectionObserver(function(records) {\n proclaim.equal(records.length, 1);\n // Chrome's native implementation sometimes incorrectly reports\n // the intersection ratio as a number > 1.\n proclaim.lessThanOrEqual(records[0].intersectionRatio, 1);\n done();\n }, {root: rootEl, threshold: [1]});\n\n // CSS transitions that are slower than the default throttle timeout\n // require polling to detect, which can be set on a per-instance basis.\n if (!supportsNativeIntersectionObserver()) {\n io.POLL_INTERVAL = 100;\n }\n\n io.observe(targetEl1);\n setTimeout(function() {\n targetEl1.style.transform = 'translateX(-40px) translateY(-40px)';\n }, 0);\n });\n }\n\n\n it('uses the viewport when no root is specified', function(done) {\n io = new IntersectionObserver(function(records) {\n var viewportWidth = document.documentElement.clientWidth || document.body.clientWidth;\n var viewportHeight = document.documentElement.clientHeight || document.body.clientHeight;\n\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].rootBounds.top, 0);\n proclaim.equal(records[0].rootBounds.left, 0);\n proclaim.equal(records[0].rootBounds.right, viewportWidth);\n proclaim.equal(records[0].rootBounds.width, viewportWidth);\n proclaim.equal(records[0].rootBounds.bottom, viewportHeight);\n proclaim.equal(records[0].rootBounds.height, viewportHeight);\n done();\n });\n\n // Ensures targetEl1 is visible in the viewport before observing.\n window.scrollTo(0, 0);\n rootEl.style.position = 'absolute';\n rootEl.style.top = '0px';\n rootEl.style.left = '0px';\n\n io.observe(targetEl1);\n });\n\n });\n\n\n describe('takeRecords', function() {\n\n it('supports getting records before the callback is invoked',\n function(done) {\n\n var lastestRecords = [];\n io = new IntersectionObserver(function(records) {\n lastestRecords = lastestRecords.concat(records);\n }, {root: rootEl});\n io.observe(targetEl1);\n\n window.requestAnimationFrame && requestAnimationFrame(function() {\n lastestRecords = lastestRecords.concat(io.takeRecords());\n });\n\n setTimeout(function() {\n proclaim.equal(lastestRecords.length, 1);\n proclaim.equal(lastestRecords[0].intersectionRatio, 1);\n done();\n }, ASYNC_TIMEOUT);\n });\n\n });\n\n\n describe('unobserve', function() {\n\n it('removes targets from the internal store', function(done) {\n\n var spy = sinon.spy();\n io = new IntersectionObserver(spy, {root: rootEl});\n\n runSequence([\n function(done) {\n targetEl1.style.top = targetEl2.style.top = '0px';\n targetEl1.style.left = targetEl2.style.left = '0px';\n io.observe(targetEl1);\n io.observe(targetEl2);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 1);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 2);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[0].intersectionRatio, 1);\n proclaim.equal(records[1].target, targetEl2);\n proclaim.equal(records[1].intersectionRatio, 1);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n io.unobserve(targetEl1);\n targetEl1.style.top = targetEl2.style.top = '0px';\n targetEl1.style.left = targetEl2.style.left = '-40px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 2);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 1);\n proclaim.equal(records[0].target, targetEl2);\n proclaim.equal(records[0].intersectionRatio, 0);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n io.unobserve(targetEl2);\n targetEl1.style.top = targetEl2.style.top = '0px';\n targetEl1.style.left = targetEl2.style.left = '0px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 2);\n done();\n }, ASYNC_TIMEOUT);\n }\n ], done);\n\n });\n\n });\n\n describe('disconnect', function() {\n\n it('removes all targets and stops listening for changes', function(done) {\n\n var spy = sinon.spy();\n io = new IntersectionObserver(spy, {root: rootEl});\n\n runSequence([\n function(done) {\n targetEl1.style.top = targetEl2.style.top = '0px';\n targetEl1.style.left = targetEl2.style.left = '0px';\n io.observe(targetEl1);\n io.observe(targetEl2);\n setTimeout(function() {\n proclaim.equal(spy.callCount, 1);\n var records = sortRecords(spy.lastCall.args[0]);\n proclaim.equal(records.length, 2);\n proclaim.equal(records[0].target, targetEl1);\n proclaim.equal(records[0].intersectionRatio, 1);\n proclaim.equal(records[1].target, targetEl2);\n proclaim.equal(records[1].intersectionRatio, 1);\n done();\n }, ASYNC_TIMEOUT);\n },\n function(done) {\n io.disconnect();\n targetEl1.style.top = targetEl2.style.top = '0px';\n targetEl1.style.left = targetEl2.style.left = '-40px';\n setTimeout(function() {\n proclaim.equal(spy.callCount, 1);\n done();\n }, ASYNC_TIMEOUT);\n }\n ], done);\n\n });\n\n });\n\n});\n\n\n/**\n * Runs a sequence of function and when finished invokes the done callback.\n * Each function in the sequence is invoked with its own done function and\n * it should call that function once it's complete.\n * @param {Array} functions An array of async functions.\n * @param {Function} done A final callback to be invoked once all function\n * have run.\n */\nfunction runSequence(functions, done) {\n var next = functions.shift();\n if (next) {\n next(function() {\n runSequence(functions, done);\n });\n } else {\n done && done();\n }\n}\n\n\n/**\n * Returns whether or not the current browser has native support for\n * IntersectionObserver.\n * @return {boolean} True if native support is detected.\n */\nfunction supportsNativeIntersectionObserver() {\n return 'IntersectionObserver' in window &&\n window.IntersectionObserver.toString().indexOf('[native code]') > -1;\n}\n\n\n/**\n * Sorts an array of records alphebetically by ascending ID. Since the current\n * native implementation doesn't sort change entries by `observe` order, we do\n * that ourselves for the non-polyfill case. Since all tests call observe\n * on targets in sequential order, this should always match.\n * https://crbug.com/613679\n * @param {Array} entries The entries to sort.\n * @return {Array} The sorted array.\n */\nfunction sortRecords(entries) {\n if (supportsNativeIntersectionObserver()) {\n entries = entries.sort(function(a, b) {\n return a.target.id < b.target.id ? -1 : 1;\n });\n }\n return entries;\n}\n\n\n/**\n * Adds the common styles used by all tests to the page.\n */\nfunction addStyles() {\n var styles = document.createElement('style');\n styles.id = 'styles';\n document.documentElement.appendChild(styles);\n\n var cssText =\n '#root {' +\n ' position: relative;' +\n ' width: 400px;' +\n ' height: 200px;' +\n ' background: #eee' +\n '}' +\n '#grand-parent {' +\n ' position: relative;' +\n ' width: 200px;' +\n ' height: 200px;' +\n '}' +\n '#parent {' +\n ' position: absolute;' +\n ' top: 0px;' +\n ' left: 200px;' +\n ' overflow: hidden;' +\n ' width: 200px;' +\n ' height: 200px;' +\n ' background: #ddd;' +\n '}' +\n '#target1, #target2, #target3, #target4 {' +\n ' position: absolute;' +\n ' top: 0px;' +\n ' left: 0px;' +\n ' width: 20px;' +\n ' height: 20px;' +\n ' transform: translateX(0px) translateY(0px);' +\n ' transition: transform .5s;' +\n ' background: #f00;' +\n '}';\n\n // IE8 doesn't allow setting innerHTML on a