|
|
@@ -305,10 +305,14 @@ this.docHelper = this.docHelper || (() => {
|
|
|
paddingRight = getWidth("padding-right", computedStyle);
|
|
|
paddingTop = getWidth("padding-top", computedStyle);
|
|
|
paddingBottom = getWidth("padding-bottom", computedStyle);
|
|
|
- borderLeft = getWidth("border-left-width", computedStyle);
|
|
|
- borderRight = getWidth("border-right-width", computedStyle);
|
|
|
- borderTop = getWidth("border-top-width", computedStyle);
|
|
|
- borderBottom = getWidth("border-bottom-width", computedStyle);
|
|
|
+ if (computedStyle.getPropertyValue("box-sizing") == "content-box") {
|
|
|
+ borderLeft = getWidth("border-left-width", computedStyle);
|
|
|
+ borderRight = getWidth("border-right-width", computedStyle);
|
|
|
+ borderTop = getWidth("border-top-width", computedStyle);
|
|
|
+ borderBottom = getWidth("border-bottom-width", computedStyle);
|
|
|
+ } else {
|
|
|
+ borderLeft = borderRight = borderTop = borderBottom = 0;
|
|
|
+ }
|
|
|
const width = imageElement.clientWidth;
|
|
|
const height = imageElement.clientHeight;
|
|
|
if (width >= 0 && height >= 0 && paddingLeft >= 0 && paddingRight >= 0 && paddingTop >= 0 && paddingBottom >= 0 && borderLeft >= 0 && borderRight >= 0 && borderTop >= 0 && borderBottom >= 0) {
|