| Index: pkg/custom_element/lib/custom-elements.debug.js
|
| diff --git a/pkg/custom_element/lib/custom-elements.debug.js b/pkg/custom_element/lib/custom-elements.debug.js
|
| index a391b8ac3da3a22a4ad7839ae54c1dd472c6d992..07e93804514da025fc5db252325e12e9436c61c0 100644
|
| --- a/pkg/custom_element/lib/custom-elements.debug.js
|
| +++ b/pkg/custom_element/lib/custom-elements.debug.js
|
| @@ -1436,4 +1436,33 @@ if (HTMLElement.prototype.createShadowRoot) {
|
| return root;
|
| }
|
| }
|
| +
|
| +
|
| +// Patch to allow custom elements and shadow dom to work together, from:
|
| +// https://github.com/Polymer/platform/blob/master/src/patches-custom-elements.js
|
| +if (window.ShadowDOMPolyfill) {
|
| + function nop() {};
|
| +
|
| + // disable shadow dom watching
|
| + CustomElements.watchShadow = nop;
|
| + CustomElements.watchAllShadows = nop;
|
| +
|
| + // ensure wrapped inputs for these functions
|
| + var fns = ['upgradeAll', 'upgradeSubtree', 'observeDocument',
|
| + 'upgradeDocument'];
|
| +
|
| + // cache originals
|
| + var original = {};
|
| + fns.forEach(function(fn) {
|
| + original[fn] = CustomElements[fn];
|
| + });
|
| +
|
| + // override
|
| + fns.forEach(function(fn) {
|
| + CustomElements[fn] = function(inNode) {
|
| + return original[fn](ShadowDOMPolyfill.wrapIfNeeded(inNode));
|
| + };
|
| + });
|
| +}
|
| +
|
| })();
|
|
|