fixes issue#7: use _currentScript (from the polyfills) to get the ownerDocument. if polyfills do not exist, use currentScript instead.