Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Remove CustomElements.watchAllShadows. Platform repo now overrides cr…
Browse files Browse the repository at this point in the history
…eateShadowRoot and handles this automatically. Fixes issue #24.

Also fixes CustomElements build.
  • Loading branch information
sorvell committed Sep 3, 2013
1 parent b2d460e commit 046cda3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
1 change: 0 additions & 1 deletion src/CustomElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ if (useNative) {
scope.upgradeElement = nop;

scope.watchShadow = nop;
scope.watchAllShadows = nop;
scope.upgrade = nop;
scope.upgradeAll = nop;
scope.upgradeSubtree = nop;
Expand Down
24 changes: 1 addition & 23 deletions src/Observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -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);
});
Expand Down Expand Up @@ -287,8 +267,6 @@ function upgradeDocument(document) {
// exports

scope.watchShadow = watchShadow;
scope.watchAllShadows = watchAllShadows;

scope.upgradeAll = addedNode;
scope.upgradeSubtree = addedSubtree;

Expand Down

0 comments on commit 046cda3

Please sign in to comment.