Procházet zdrojové kódy

use getPropertyValue

Gildas před 7 roky
rodič
revize
4adf5beaa4
1 změnil soubory, kde provedl 8 přidání a 8 odebrání
  1. 8 8
      lib/single-file/doc-helper.js

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

@@ -148,14 +148,14 @@ this.docHelper = this.docHelper || (() => {
 			getStyles(win, element, styles);
 			const computedStyle = win.getComputedStyle(element);
 			styles.set(element, {
-				display: computedStyle.display,
-				opacity: computedStyle.opacity,
-				visibility: computedStyle.visibility,
-				fontFamily: computedStyle.fontFamily,
-				fontWeight: getFontWeight(computedStyle.fontWeight),
-				fontStyle: computedStyle.fontStyle || "normal",
-				fontVariant: computedStyle.fontVariant || "normal",
-				whiteSpace: computedStyle.whiteSpace
+				display: computedStyle.getPropertyValue("display"),
+				opacity: computedStyle.getPropertyValue("opacity"),
+				visibility: computedStyle.getPropertyValue("visibility"),
+				fontFamily: computedStyle.getPropertyValue("font-family"),
+				fontWeight: getFontWeight(computedStyle.getPropertyValue("font-weight")),
+				fontStyle: computedStyle.getPropertyValue("font-style") || "normal",
+				fontVariant: computedStyle.getPropertyValue("font-variant") || "normal",
+				whiteSpace: computedStyle.getPropertyValue("white-space")
 			});
 		});
 		return styles;