diff --git a/src/HTMLImports.js b/src/HTMLImports.js index 7e904ff..42c2b93 100644 --- a/src/HTMLImports.js +++ b/src/HTMLImports.js @@ -115,11 +115,9 @@ var importer = { importer.preload(document); } // store import record - elt.import = { - href: url, - ownerNode: elt, - content: document - }; + elt.import = document; + elt.import.href = url; + elt.import.ownerNode = elt; // store document resource elt.content = resource = document; } diff --git a/src/Parser.js b/src/Parser.js index 93c9c8c..b58ba2a 100644 --- a/src/Parser.js +++ b/src/Parser.js @@ -48,8 +48,10 @@ var importParser = { }, parseLink: function(linkElt) { if (isDocumentLink(linkElt)) { - if (linkElt.content) { - importParser.parse(linkElt.content); + if (linkElt.import) { + importParser.parse(linkElt.import); + // fire load event + linkElt.dispatchEvent(new CustomEvent('load')); } } else { this.parseGeneric(linkElt);