diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-01-29 12:15:14 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-01-29 12:15:14 +0100 |
commit | b9dff569a1ea8c65b11decb91b8ee0a5e2325420 (patch) | |
tree | 70b1d642490d77d192bdf371b10c282d2ce82717 /src/cssparser.cc | |
parent | 714f44f6412ecf4cfd62abd9133210f0bf937e75 (diff) |
add (incomplete) support for the "font" shorthand
This commit makes simple stuff work, but does not implement all the
hairy details
(see http://www.w3.org/TR/CSS21/fonts.html#font-shorthand).
Diffstat (limited to 'src/cssparser.cc')
-rw-r--r-- | src/cssparser.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/cssparser.cc b/src/cssparser.cc index 03fc102c..3098f625 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -279,6 +279,15 @@ const CssProperty::Name Css_border_properties[12] = { CssProperty::CSS_PROPERTY_BORDER_RIGHT_COLOR }; +const CssProperty::Name Css_font_properties[] = { + CssProperty::CSS_PROPERTY_FONT_SIZE, + CssProperty::CSS_PROPERTY_FONT_STYLE, + CssProperty::CSS_PROPERTY_FONT_VARIANT, + CssProperty::CSS_PROPERTY_FONT_WEIGHT, + CssProperty::CSS_PROPERTY_FONT_FAMILY, + (CssProperty::Name) - 1 +}; + static const CssShorthandInfo Css_shorthand_info[CSS_SHORTHAND_NUM] = { {"background", CssShorthandInfo::CSS_SHORTHAND_MULTIPLE, Css_background_properties}, @@ -298,7 +307,8 @@ static const CssShorthandInfo Css_shorthand_info[CSS_SHORTHAND_NUM] = { Css_border_top_properties}, {"border-width", CssShorthandInfo::CSS_SHORTHAND_DIRECTIONS, Css_border_width_properties}, - {"font", CssShorthandInfo::CSS_SHORTHAND_FONT, NULL}, + {"font", CssShorthandInfo::CSS_SHORTHAND_FONT, + Css_font_properties}, {"list-style", CssShorthandInfo::CSS_SHORTHAND_MULTIPLE, Css_list_style_properties}, {"margin", CssShorthandInfo::CSS_SHORTHAND_DIRECTIONS, @@ -859,6 +869,9 @@ static void Css_parse_declaration(CssParser * parser, Css_next_token(parser); switch (Css_shorthand_info[sh_index].type) { + + case CssShorthandInfo::CSS_SHORTHAND_FONT: + /* \todo Implement details. */ case CssShorthandInfo::CSS_SHORTHAND_MULTIPLE: do { for (found = false, i = 0; @@ -951,10 +964,6 @@ static void Css_parse_declaration(CssParser * parser, } } while (found); break; - - case CssShorthandInfo::CSS_SHORTHAND_FONT: - /* todo: Not yet implemented. */ - break; } } } |