Ver código fonte

fixed test for Firefox

Gildas 7 anos atrás
pai
commit
4b559a89a2
1 arquivos alterados com 2 adições e 2 exclusões
  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);
 				imageElement.setAttribute(imagesAttributeName(options.sessionId), imageElementIndex);
 				let imageData;
 				let imageData;
 				const computedStyle = getComputedStyle(imageElement);
 				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) {
 				if (imageElement.src && !paddingIsSet && !marginIsSet) {
 					let naturalWidth = imageElement.naturalWidth;
 					let naturalWidth = imageElement.naturalWidth;
 					let naturalHeight = imageElement.naturalHeight;
 					let naturalHeight = imageElement.naturalHeight;