diff --git a/src/lib/annotations/annotations.html b/src/lib/annotations/annotations.html index 81357e6c35..1128570dc9 100644 --- a/src/lib/annotations/annotations.html +++ b/src/lib/annotations/annotations.html @@ -154,9 +154,12 @@ _parseTextNodeAnnotation: function(node, list) { var parts = this._parseBindings(node.textContent); if (parts) { - // NOTE: use a space here so the textNode remains; some browsers - // (IE) evacipate an empty textNode. - node.textContent = ' '; + // Initialize the textContent with any literal parts + // NOTE: default to a space here so the textNode remains; some browsers + // (IE) evacipate an empty textNode following cloneNode/importNode. + node.textContent = parts.map(function(part) { + return part.literal; + }).join('') || ' '; var annote = { bindings: [{ kind: 'text', @@ -291,6 +294,13 @@ name = name.slice(0, -1); kind = 'attribute'; } + // Initialize attribute bindings with any literal parts + var literal = parts.map(function(part) { + return part.literal; + }).join(''); + if (kind == 'attribute') { + node.setAttribute(name, literal); + } // Clear attribute before removing, since IE won't allow removing // `value` attribute if it previously had a value (can't // unconditionally set '' before removing since attributes with `$` @@ -311,6 +321,7 @@ kind: kind, name: name, parts: parts, + literal: literal, isCompound: parts.length !== 1 }; } diff --git a/src/lib/bind/effects.html b/src/lib/bind/effects.html index af15b803db..2643164e67 100644 --- a/src/lib/bind/effects.html +++ b/src/lib/bind/effects.html @@ -21,10 +21,6 @@ !effect.parts[0].negate; }, - _compoundInitializationEffect: function(source, value, effect) { - this._applyEffectValue(effect); - }, - _annotationEffect: function(source, value, effect) { if (source != effect.value) { value = this._get(effect.value); diff --git a/src/standard/annotations.html b/src/standard/annotations.html index 8e969de4c8..50be217fd3 100644 --- a/src/standard/annotations.html +++ b/src/standard/annotations.html @@ -219,42 +219,51 @@ }, // push configuration references at configure time - _configureAnnotationReferences: function() { - this._configureTemplateContent(); - this._configureCompoundBindings(); - }, - - // nested template contents have been stored prototypically to avoid - // unnecessary duplication, here we put references to the - // indirected contents onto the nested template instances - _configureTemplateContent: function() { - this._notes.forEach(function(note, i) { + _configureAnnotationReferences: function(config) { + var notes = this._notes; + var nodes = this._nodes; + for (var i=0; i Test + {{text}} {{computeFromTrickyLiterals(3, 'tricky\,\'zot\'')}} @@ -364,6 +366,26 @@ }); + +