Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes a strange Firefox issue.

  • Loading branch information...
commit f9f7fe42cbb165a4021eeb616c6990914b83079d 1 parent db572fa
@ialexi ialexi authored Charles Jolley committed
Showing with 20 additions and 1 deletion.
  1. +20 −1 frameworks/foundation/system/utils.js
View
21 frameworks/foundation/system/utils.js
@@ -12,7 +12,11 @@ SC.mixin( /** @scope SC */ {
_downloadFrames: 0, // count of download frames inserted into document
- _copy_computed_props: ["maxWidth", "maxHeight", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "fontFamily", "fontSize", "fontStyle", "fontWeight"],
+ _copy_computed_props: [
+ "maxWidth", "maxHeight", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom",
+ "fontFamily", "fontSize", "fontStyle", "fontWeight", "fontVariant", "lineHeight",
+ "whiteSpace"
+ ],
/**
Starts a download of the file at the named path.
@@ -330,6 +334,21 @@ SC.mixin( /** @scope SC */ {
element.style[prop] = val;
}
+ // and why does firefox specifically need "font" set?
+ var cs = element.style; // cached style
+ if (cs.font === "") {
+ var font = "";
+ if (cs.fontStyle) font += cs.fontStyle + " ";
+ if (cs.fontVariant) font += cs.fontVariant + " ";
+ if (cs.fontWeight) font += cs.fontWeight + " ";
+ if (cs.fontSize) font += cs.fontSize; else font += "10px"; //force a default
+ if (cs.lineHeight) font += "/" + cs.lineHeight;
+ font += " ";
+ if (cs.fontFamily) font += cs.fontFamily; else cs += "sans-serif";
+
+ element.style.font = font;
+ }
+
SC.mixin(element.style, {
left: "0px", top: "0px", position: "absolute", bottom: "auto", right: "auto", width: "auto", height: "auto"
});
Please sign in to comment.
Something went wrong with that request. Please try again.