From f3eb922de9991c9dff54eda19d6605098f499990 Mon Sep 17 00:00:00 2001 From: Steve Orvell Date: Wed, 18 Dec 2013 15:05:10 -0800 Subject: [PATCH] Refine timing related to calling Polymer() in main document scripts when polymer is imported. --- src/declaration/polymer-element.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/declaration/polymer-element.js b/src/declaration/polymer-element.js index 076a984..9909bc4 100644 --- a/src/declaration/polymer-element.js +++ b/src/declaration/polymer-element.js @@ -167,6 +167,16 @@ // make window.Polymer reference `element()` window.Polymer = element; + // Under the HTMLImports polyfill, scripts in the main document + // do not block on imports; we want to allow calls to Polymer in the main + // document. We do so via coordination with Platform: + var declarations = Platform.deliverDeclarations(); + if (declarations) { + for (var i=0, l=declarations.length, d; (i