|
|
@@ -172,17 +172,36 @@ this.docHelper = this.docHelper || (() => {
|
|
|
naturalHeight = imgElement.height;
|
|
|
imgElement.remove();
|
|
|
}
|
|
|
+ const marginValue = imageElement.style.getPropertyValue("margin");
|
|
|
+ const marginPriority = imageElement.style.getPropertyPriority("margin");
|
|
|
+ const paddingValue = imageElement.style.getPropertyValue("padding");
|
|
|
+ const paddingPriority = imageElement.style.getPropertyPriority("padding");
|
|
|
+ imageElement.style.setProperty("margin", "0", "important");
|
|
|
+ imageElement.style.setProperty("padding", "0", "important");
|
|
|
+ const clientWidth = imageElement.clientWidth;
|
|
|
+ const clientHeight = imageElement.clientHeight;
|
|
|
+ if (marginValue || marginPriority) {
|
|
|
+ imageElement.style.setProperty("margin", marginValue, marginPriority);
|
|
|
+ } else {
|
|
|
+ imageElement.style.removeProperty("margin");
|
|
|
+ }
|
|
|
+ if (paddingValue || paddingPriority) {
|
|
|
+ imageElement.style.setProperty("padding", paddingValue, paddingPriority);
|
|
|
+ } else {
|
|
|
+ imageElement.style.removeProperty("padding");
|
|
|
+ }
|
|
|
+ imageElement.style.removeProperty("padding");
|
|
|
imageData = {
|
|
|
width: imageElement.width,
|
|
|
height: imageElement.height,
|
|
|
- clientWidth: imageElement.clientWidth,
|
|
|
- clientHeight: imageElement.clientHeight,
|
|
|
+ clientWidth,
|
|
|
+ clientHeight,
|
|
|
naturalWidth,
|
|
|
- naturalHeight
|
|
|
+ naturalHeight
|
|
|
};
|
|
|
}
|
|
|
data.push(imageData);
|
|
|
- });
|
|
|
+ });
|
|
|
return data;
|
|
|
}
|
|
|
}
|