Skip to content

Commit

Permalink
Merge branch 'master' into legacy-undefined-noBatch
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Mar 28, 2019
2 parents 8a3b9c5 + b7c73bd commit 5309a86
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Beyond GitHub, we try to have a variety of different lines of communication open

* [Blog](https://blog.polymer-project.org/)
* [Twitter](https://twitter.com/polymer)
* [Google+ Community](https://plus.sandbox.google.com/u/0/communities/115626364525706131031?cfem=1)
* [Mailing list](https://groups.google.com/forum/#!forum/polymer-dev)
* [Slack channel](https://bit.ly/polymerslack)

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ Beyond GitHub, we try to have a variety of different lines of communication avai

* [Blog](https://blog.polymer-project.org/)
* [Twitter](https://twitter.com/polymer)
* [Google+ community](https://plus.google.com/communities/115626364525706131031)
* [Mailing list](https://groups.google.com/forum/#!forum/polymer-dev)
* [Slack channel](https://bit.ly/polymerslack)

Expand Down
20 changes: 6 additions & 14 deletions lib/mixins/template-stamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import '../utils/boot.js';

import { dedupingMixin } from '../utils/mixin.js';

const walker = document.createTreeWalker(document, NodeFilter.SHOW_ALL,
null, false);

// 1.x backwards-compatible auto-wrapper for template type extensions
// This is a clear layering violation and gives favored-nation status to
// dom-if and dom-repeat templates. This is a conceit we're choosing to keep
Expand Down Expand Up @@ -48,8 +45,7 @@ function findTemplateNode(root, nodeInfo) {
if (parent) {
// note: marginally faster than indexing via childNodes
// (http://jsperf.com/childnodes-lookup)
walker.currentNode = parent;
for (let n=walker.firstChild(), i=0; n; n=walker.nextSibling()) {
for (let n=parent.firstChild, i=0; n; n=n.nextSibling) {
if (nodeInfo.parentIndex === i++) {
return n;
}
Expand Down Expand Up @@ -239,8 +235,7 @@ export const TemplateStamp = dedupingMixin(
// For ShadyDom optimization, indicating there is an insertion point
templateInfo.hasInsertionPoint = true;
}
walker.currentNode = element;
if (walker.firstChild()) {
if (element.firstChild) {
noted = this._parseTemplateChildNodes(element, templateInfo, nodeInfo) || noted;
}
if (element.hasAttributes && element.hasAttributes()) {
Expand All @@ -266,8 +261,7 @@ export const TemplateStamp = dedupingMixin(
if (root.localName === 'script' || root.localName === 'style') {
return;
}
walker.currentNode = root;
for (let node=walker.firstChild(), parentIndex=0, next; node; node=next) {
for (let node=root.firstChild, parentIndex=0, next; node; node=next) {
// Wrap templates
if (node.localName == 'template') {
node = wrapTemplateExtension(node);
Expand All @@ -276,13 +270,12 @@ export const TemplateStamp = dedupingMixin(
// text nodes to be inexplicably split =(
// note that root.normalize() should work but does not so we do this
// manually.
walker.currentNode = node;
next = walker.nextSibling();
next = node.nextSibling;
if (node.nodeType === Node.TEXT_NODE) {
let /** Node */ n = next;
while (n && (n.nodeType === Node.TEXT_NODE)) {
node.textContent += n.textContent;
next = walker.nextSibling();
next = n.nextSibling;
root.removeChild(n);
n = next;
}
Expand All @@ -297,8 +290,7 @@ export const TemplateStamp = dedupingMixin(
childInfo.infoIndex = templateInfo.nodeInfoList.push(/** @type {!NodeInfo} */(childInfo)) - 1;
}
// Increment if not removed
walker.currentNode = node;
if (walker.parentNode()) {
if (node.parentNode) {
parentIndex++;
}
}
Expand Down

0 comments on commit 5309a86

Please sign in to comment.