# HG changeset patch # Parent a83aa0a73ee54ab58a6dc26b913ab4ee34df6fa3 RT-37787: Sizing fonts with CSS em can result in wrong size font being displayed diff -r a83aa0a73ee5 modules/graphics/src/main/java/javafx/scene/CssStyleHelper.java --- a/modules/graphics/src/main/java/javafx/scene/CssStyleHelper.java Thu Jul 03 15:09:13 2014 +0300 +++ b/modules/graphics/src/main/java/javafx/scene/CssStyleHelper.java Thu Jul 03 15:18:25 2014 -0400 @@ -1670,6 +1670,9 @@ } } + CalculatedValue parentCachedFont = getCachedFont(styleable.getStyleableParent()); + if (parentCachedFont == null) parentCachedFont = new CalculatedValue(Font.getDefault(), null, false); + // // Look up the font- properties // @@ -1722,7 +1725,7 @@ final CalculatedValue cv = calculateValue(fontShorthand, styleable, dummyFontProperty, - styleMap, states, styleable, cvFont); + styleMap, states, styleable, parentCachedFont); // cv could be SKIP if (cv.getValue() instanceof Font) { @@ -1761,9 +1764,10 @@ // 1) a style matching this node and is more specific than the font shorthand or // 2) an inherited style that is more specific than the font shorthand // and, therefore, we can use the fontSize style + final CalculatedValue cv = calculateValue(fontSize, styleable, dummyFontProperty, - styleMap, states, styleable, cvFont); + styleMap, states, styleable, parentCachedFont); if (cv.getValue() instanceof Double) { if (origin == null || origin.compareTo(fontSize.getOrigin()) <= 0) {