-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for #153. The process of putting template content into shadowRoot…
… is now: 1. create instance of template content 2. bind it 3. append to shadowRoot Previously it was 1, 3, 2 which could lead to attribute values having values with {{}} in them while being in dom. This can create issues like images loading with incorrect urls.
- Loading branch information
Steve Orvell
committed
May 22, 2013
1 parent
cf10031
commit bd0bd6e
Showing
2 changed files
with
56 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>attribute mustaches</title> | ||
<script src="../../polymer.js"></script> | ||
<script src="../../tools/test/htmltest.js"></script> | ||
<script src="../../node_modules/chai/chai.js"></script> | ||
</head> | ||
<body> | ||
<x-test id="test"></x-test> | ||
<element name="x-target" attributes="src"> | ||
<script> | ||
Polymer.register(this, { | ||
// force an mdv binding | ||
bind: function() { | ||
Element.prototype.bind.apply(this, arguments); | ||
}, | ||
insertedCallback: function() { | ||
this.testSrcForMustache(); | ||
}, | ||
attributeChangedCallback: function(name, oldValue) { | ||
this.testSrcForMustache(); | ||
if (this.getAttribute(name) === '../testSource') { | ||
done(); | ||
} | ||
}, | ||
testSrcForMustache: function() { | ||
chai.assert.notMatch(this.getAttribute('src'), Polymer.bindPattern, | ||
'attribute does not contain {{...}}'); | ||
} | ||
}); | ||
</script> | ||
</element> | ||
|
||
<element name="x-test"> | ||
<template> | ||
<x-target id="target" src="../{{src}}"></x-target> | ||
</template> | ||
<script> | ||
Polymer.register(this, { | ||
src: 'testSource' | ||
}); | ||
</script> | ||
</element> | ||
</body> | ||
</html> |