fix: fall back to documentElement is body is not existing

This commit is contained in:
Chen Fengyuan 2017-12-17 18:26:35 +08:00
parent fd4e721ad5
commit 35200de34a

View File

@ -526,7 +526,7 @@ export function getImageNaturalSizes(image, callback) {
}
const newImage = document.createElement('img');
const { body } = document;
const body = document.body || document.documentElement;
newImage.onload = () => {
callback(newImage.width, newImage.height);