[cp-patches] FYI: More CSS work

Roman Kennke roman at kennke.org
Fri Nov 17 22:13:42 UTC 2006

This implements relative fonts for the HTML renderer. It can parse and
handle font sizes measured in 'em' and '%' now, as well as the 'larger'
and 'smaller' keywords.

It also fixes some minor glitches and can now render the japi pages
almost perfect:


2006-11-17  Roman Kennke  <kennke at aicas.com>

        * gnu/javax/swing/text/html/css/CSSParser.java
        (parseDeclaration): Trim string before reporting.
        * gnu/javax/swing/text/html/css/FontSize.java
        (size): New field.
        (isRelative): New field.
        (sizeIndex): New field.
        (FontSize): Initialize new fields.
        (getValue): Changed to call getValue(int).
        (getValue(int)): New method. Implements relative font sizes.
        (isRelative): New method.
        (mapAbsolute): Store index.
        (mapEM): New helper method.
        (mapLarger): New helper method.
        (mapPercent): New helper method.
        (mapRelative): New helper method.
        (mapSmaller): New helper method.
        (mapValue): New helper method.
        * javax/swing/text/html/CSS.java
        (parseBackgroundShorthand): Create CSSColor directly.
        * javax/swing/text/html/StyleSheet.java
        (addRule): Invalidate resolved styles.
        (getFont): Call new getFontSize() method to resolve relative
        font sizes.
        (getFontSize): New helper method. Resolves relative font sizes.
        (translateHTMLToCSS): Create CSS objects directly.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 14040 bytes
Desc: not available
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20061117/6e055f31/patch.bin

More information about the Classpath-patches mailing list