Skip to content

Commit

Permalink
Minor simplifications/comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jul 3, 2019
1 parent f0cbc83 commit 4f9fda0
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/mixins/property-effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -2703,12 +2703,12 @@ export const PropertyEffects = dedupingMixin(superClass => {
// effects are run; if this template was not nested in another
// template, use the root template (the first stamped one) as the
// parent. Note, `parent` is the `templateInfo` instance for this
// template's containing template, which was set up in
// `applyTemplateContent`. While a given template's `parent` is
// given, it is only added to the parent list at the point that it is
// being bound, since a template may or may not ever be stamped, and
// may be stamped more than once (in which case it will be in the
// tree more than once).
// template's parent (containing) template, which was set up in
// `applyTemplateContent`. While a given template's `parent` is set
// apriori, it is only added to the parent list at the point that it
// is being bound, since a template may or may not ever be stamped,
// and may be stamped more than once (in which case instances of the
// template info will be in the tree under its parent more than once).
const parent = templateInfo.parent || this.__templateInfo;
const previous = parent.lastChild;
parent.lastChild = templateInfo;
Expand Down Expand Up @@ -2807,7 +2807,7 @@ export const PropertyEffects = dedupingMixin(superClass => {
* @protected
*/
_removeBoundDom(dom) {
// Unlink template info; Note that while the child is unlinked from its
// Unlink template info; Note that while the child is unlinked from its
// parent list, a template's `parent` reference is never removed, since
// this is is determined by the tree structure and applied at
// `applyTemplateContent` time.
Expand Down Expand Up @@ -2964,10 +2964,12 @@ export const PropertyEffects = dedupingMixin(superClass => {
// onto the parent (dom-if/repeat element)'s nodeInfo
if (removeNestedTemplates && (isDomIf || isDomRepeat)) {
parent.removeChild(node);
nodeInfo.parentInfo.templateInfo = nestedTemplateInfo;
// Ensure the parent dom-if/repeat is noted since it now has bindings;
// it may not have been if it did not have its own bindings
// Use the parent's nodeInfo (for the dom-if/repeat) to record the
// templateInfo, and use that for any host property bindings below
nodeInfo = nodeInfo.parentInfo;
nodeInfo.templateInfo = nestedTemplateInfo;
// Ensure the parent dom-if/repeat is noted since it now may have host
// bindings; it may not have been if it did not have its own bindings
nodeInfo.noted = true;
noted = false;
}
Expand Down

0 comments on commit 4f9fda0

Please sign in to comment.