Przeglądaj źródła

fixed computing of attribute "empty"

Gildas 7 lat temu
rodzic
commit
42aff24025
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      lib/single-file/doc-helper.js

+ 1 - 0
lib/single-file/doc-helper.js

@@ -269,6 +269,7 @@ this.docHelper = this.docHelper || (() => {
 				const computedStyle = win.getComputedStyle(imageElement);
 				if (computedStyle) {
 					imageData.size = getSize(win, imageElement);
+					imageData.empty = imageElement.naturalWidth <= 1 && imageElement.naturalHeight <= 1;
 					if ((!computedStyle.getPropertyValue("background-image") || computedStyle.getPropertyValue("background-image") == "none") && imageData.size.pxWidth > 1 && imageData.size.pxHeight > 1) {
 						imageData.replaceable = true;
 						imageData.objectFit = computedStyle.getPropertyValue("object-fit");