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.