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

Commit 046cda3

Browse files
committed
Remove CustomElements.watchAllShadows. Platform repo now overrides createShadowRoot and handles this automatically. Fixes issue #24.
Also fixes CustomElements build.
1 parent b2d460e commit 046cda3

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

src/CustomElements.js

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ if (useNative) {
4141
scope.upgradeElement = nop;
4242

4343
scope.watchShadow = nop;
44-
scope.watchAllShadows = nop;
4544
scope.upgrade = nop;
4645
scope.upgradeAll = nop;
4746
scope.upgradeSubtree = nop;

src/Observer.js

+1-23
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@ license that can be found in the LICENSE file.
66

77
(function(scope){
88

9-
/*
10-
if (HTMLElement.prototype.webkitShadowRoot) {
11-
Object.defineProperty(HTMLElement.prototype, 'shadowRoot', {
12-
get: function() {
13-
return this.webkitShadowRoot;
14-
}
15-
};
16-
}
17-
*/
9+
var logFlags = window.logFlags || {};
1810

1911
// walk the subtree rooted at node, applying 'find(element, data)' function
2012
// to each element
@@ -197,13 +189,6 @@ function watchRoot(root) {
197189
}
198190
}
199191

200-
function watchAllShadows(node) {
201-
watchShadow(node);
202-
forSubtree(node, function(e) {
203-
watchShadow(node);
204-
});
205-
}
206-
207192
function filter(inNode) {
208193
switch (inNode.localName) {
209194
case 'style':
@@ -239,11 +224,6 @@ function handler(mutations) {
239224
if (filter(n)) {
240225
return;
241226
}
242-
// watch shadow-roots on nodes that have had them attached manually
243-
// TODO(sjmiles): remove if createShadowRoot is overridden
244-
// TODO(sjmiles): removed as an optimization, manual shadow roots
245-
// must be watched explicitly
246-
//watchAllShadows(n);
247227
// nodes added may need lifecycle management
248228
addedNode(n);
249229
});
@@ -287,8 +267,6 @@ function upgradeDocument(document) {
287267
// exports
288268

289269
scope.watchShadow = watchShadow;
290-
scope.watchAllShadows = watchAllShadows;
291-
292270
scope.upgradeAll = addedNode;
293271
scope.upgradeSubtree = addedSubtree;
294272

0 commit comments

Comments
 (0)