Răsfoiți Sursa

fixed test for Firefox

Gildas 7 ani în urmă
părinte
comite
4b559a89a2
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      lib/single-file/doc-helper.js

+ 2 - 2
lib/single-file/doc-helper.js

@@ -162,8 +162,8 @@ this.docHelper = this.docHelper || (() => {
 				imageElement.setAttribute(imagesAttributeName(options.sessionId), imageElementIndex);
 				let imageData;
 				const computedStyle = getComputedStyle(imageElement);
-				const paddingIsSet = computedStyle.padding != "0px";
-				const marginIsSet = computedStyle.margin != "0px";
+				const paddingIsSet = computedStyle.padding && computedStyle.padding != "0px";
+				const marginIsSet = computedStyle.margin && computedStyle.margin != "0px";
 				if (imageElement.src && !paddingIsSet && !marginIsSet) {
 					let naturalWidth = imageElement.naturalWidth;
 					let naturalHeight = imageElement.naturalHeight;