From 046cda3b37c7be8edd6dce06dfeff7593ed97119 Mon Sep 17 00:00:00 2001 From: Steve Orvell Date: Tue, 3 Sep 2013 11:04:29 -0700 Subject: [PATCH] Remove CustomElements.watchAllShadows. Platform repo now overrides createShadowRoot and handles this automatically. Fixes issue #24. Also fixes CustomElements build. --- src/CustomElements.js | 1 - src/Observer.js | 24 +----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/CustomElements.js b/src/CustomElements.js index d0b91b0..0250277 100644 --- a/src/CustomElements.js +++ b/src/CustomElements.js @@ -41,7 +41,6 @@ if (useNative) { scope.upgradeElement = nop; scope.watchShadow = nop; - scope.watchAllShadows = nop; scope.upgrade = nop; scope.upgradeAll = nop; scope.upgradeSubtree = nop; diff --git a/src/Observer.js b/src/Observer.js index 7fc9db7..893f7db 100644 --- a/src/Observer.js +++ b/src/Observer.js @@ -6,15 +6,7 @@ license that can be found in the LICENSE file. (function(scope){ -/* -if (HTMLElement.prototype.webkitShadowRoot) { - Object.defineProperty(HTMLElement.prototype, 'shadowRoot', { - get: function() { - return this.webkitShadowRoot; - } - }; -} -*/ +var logFlags = window.logFlags || {}; // walk the subtree rooted at node, applying 'find(element, data)' function // to each element @@ -197,13 +189,6 @@ function watchRoot(root) { } } -function watchAllShadows(node) { - watchShadow(node); - forSubtree(node, function(e) { - watchShadow(node); - }); -} - function filter(inNode) { switch (inNode.localName) { case 'style': @@ -239,11 +224,6 @@ function handler(mutations) { if (filter(n)) { return; } - // watch shadow-roots on nodes that have had them attached manually - // TODO(sjmiles): remove if createShadowRoot is overridden - // TODO(sjmiles): removed as an optimization, manual shadow roots - // must be watched explicitly - //watchAllShadows(n); // nodes added may need lifecycle management addedNode(n); }); @@ -287,8 +267,6 @@ function upgradeDocument(document) { // exports scope.watchShadow = watchShadow; -scope.watchAllShadows = watchAllShadows; - scope.upgradeAll = addedNode; scope.upgradeSubtree = addedSubtree;