Skip to content

Commit

Permalink
Ensure that dom-bind always waits until DOMContentLoaded to render. T…
Browse files Browse the repository at this point in the history
…his ensures a script can install api on the dom-bind prior to it rendering. Previously dom-bind waited for first render, but an early parser yield can make this occur unexpectedly early.
  • Loading branch information
Steven Orvell committed Mar 1, 2016
1 parent 91873c1 commit cc0e9df
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/template/dom-bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@
// have resolved
var self = this;
Polymer.RenderStatus.whenReady(function() {
self._markImportsReady();
if (document.readyState == 'loading') {
document.addEventListener('DOMContentLoaded', function() {
self._markImportsReady();
});
} else {
self._markImportsReady();
}
});
},

Expand Down

0 comments on commit cc0e9df

Please sign in to comment.