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

Commit

Permalink
importNode patch updated to remove SD polyfill portion. It now works …
Browse files Browse the repository at this point in the history
…with importNode.
  • Loading branch information
sorvell committed Nov 21, 2013
1 parent 5ca7595 commit 64a92f2
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/patches-mdv.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,8 @@ window.addEventListener('WebComponentsReady', function() {
if (window.CustomElements && !CustomElements.useNative) {
var originalImportNode = Document.prototype.importNode;
Document.prototype.importNode = function(node, deep) {
// TODO(sorvell): remove these conditionals when polyfill supports importNode
// https://github.com/Polymer/ShadowDOM/issues/317
if (window.ShadowDOMPolyfill) {
node = ShadowDOMPolyfill.unwrap(node);
}
var imported = originalImportNode.call(this, node, deep);
CustomElements.upgradeAll(imported);
if (window.ShadowDOMPolyfill) {
imported = ShadowDOMPolyfill.wrap(imported);
}
return imported;
}
}
Expand Down

1 comment on commit 64a92f2

@jmesserly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity -- could this patch be rolled into CustomElement polyfill now that it doesn't have a Shadow DOM dependency?
(since importNode is an already existing DOM API: https://developer.mozilla.org/en-US/docs/Web/API/document.importNode, I don't think this patch is MDV-specific)

Please sign in to comment.