From 3ce44130d4b1f04d8d528c526ddce18d71388c34 Mon Sep 17 00:00:00 2001 From: Tomek Wytrebowicz Date: Mon, 16 Jun 2014 13:48:18 +0200 Subject: [PATCH] comment the need of `ownerDocument` ajaxorg/ace#2003 --- lib/ace/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ace/config.js b/lib/ace/config.js index 1a60fbde..f4e4c89a 100644 --- a/lib/ace/config.js +++ b/lib/ace/config.js @@ -153,7 +153,8 @@ function init(packaged) { var scriptOptions = {}; var scriptUrl = ""; - var currentScript = (document.currentScript || document._currentScript ); + // Use currentScript.ownerDocument in case this file was loaded from imported document. (HTML Imports) + var currentScript = (document.currentScript || document._currentScript ); // native or polyfill var currentDocument = currentScript && currentScript.ownerDocument || document; var scripts = currentDocument.getElementsByTagName("script");