From cc0e9dfa46c78fdc5a5294f392af020b68bbef68 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Tue, 1 Mar 2016 18:30:08 +1100 Subject: [PATCH] Ensure that dom-bind always waits until DOMContentLoaded to render. This 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. --- src/lib/template/dom-bind.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/template/dom-bind.html b/src/lib/template/dom-bind.html index 025e6b11fb..58b051bc00 100644 --- a/src/lib/template/dom-bind.html +++ b/src/lib/template/dom-bind.html @@ -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(); + } }); },