From b9fd923585eaee3afac77ae84b090ae9ad6a8966 Mon Sep 17 00:00:00 2001 From: Steve Orvell Date: Mon, 11 Nov 2013 14:33:57 -0800 Subject: [PATCH] Workaround for https://code.google.com/p/chromium/issues/detail?id=229142 that should allow templates in the main document to resolve paths relative to it. --- src/dom.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/dom.js b/src/dom.js index fcee0e5..c62a756 100644 --- a/src/dom.js +++ b/src/dom.js @@ -93,6 +93,17 @@ })(); } + // TODO(sorvell): workaround for bug: + // https://code.google.com/p/chromium/issues/detail?id=229142 + // remove when this bug is addressed + // give main document templates a base that allows them to fetch eagerly + // resolved paths relative to the main document + var template = document.createElement('template'); + var base = document.createElement('base'); + base.href = document.baseURI; + template.content.ownerDocument.appendChild(base); + + // utility function createDOM(inTagOrNode, inHTML, inAttrs) {