private int getFontSize(ICSSStyle style, Object fontsizeobj) { int fontsize; if (fontsizeobj instanceof Length) { fontsize = ((Length) fontsizeobj).getValue(); } else { fontsize = style.getParentStyle().getCSSFont().getFontSize(); } return fontsize; }