| Index: Source/core/css/parser/CSSPropertyParser.cpp
|
| diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
|
| index 44d4a11799e1f3955d745b6643d136329b31d4bf..e4e5b3915c02dbad75061f5c99fcccbaf07aab79 100644
|
| --- a/Source/core/css/parser/CSSPropertyParser.cpp
|
| +++ b/Source/core/css/parser/CSSPropertyParser.cpp
|
| @@ -55,6 +55,7 @@
|
| #include "core/css/CSSLineBoxContainValue.h"
|
| #include "core/css/CSSParserValues.h"
|
| #include "core/css/CSSPrimitiveValue.h"
|
| +#include "core/css/CSSPrimitiveValueMappings.h"
|
| #include "core/css/CSSPropertySourceData.h"
|
| #include "core/css/CSSReflectValue.h"
|
| #include "core/css/CSSSVGDocumentValue.h"
|
| @@ -1413,11 +1414,9 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
|
| case CSSPropertyFont:
|
| // [ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]?
|
| // 'font-family' ] | caption | icon | menu | message-box | small-caption | status-bar | inherit
|
| - if (id >= CSSValueCaption && id <= CSSValueStatusBar)
|
| - validPrimitive = true;
|
| - else
|
| - return parseFont(important);
|
| - break;
|
| + if (num == 1 && id >= CSSValueCaption && id <= CSSValueStatusBar)
|
| + return parseKeywordBasedFont(important);
|
| + return parseFont(important);
|
| case CSSPropertyListStyle:
|
| return parseShorthand(propId, listStyleShorthand(), important);
|
| case CSSPropertyWebkitColumns:
|
| @@ -4519,6 +4518,33 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseBasicShape()
|
| return cssValuePool().createValue(shape.release());
|
| }
|
|
|
| +// [ 'caption' | 'icon' | 'menu' | 'message-box' | 'small-caption' | 'status-bar' | '-webkit-mini-control' | '-webkit-small-control' | '-webkit-control' ]
|
| +bool CSSPropertyParser::parseKeywordBasedFont(bool important)
|
| +{
|
| + ASSERT(m_valueList->size() == 1);
|
| +
|
| + CSSParserValue* value = m_valueList->valueAt(0);
|
| + CSSValueID id = value->id;
|
| + ASSERT(id >= CSSValueCaption && id <= CSSValueStatusBar);
|
| +
|
| + FontDescription fontDescription;
|
| + RenderTheme::theme().systemFont(id, fontDescription);
|
| + RefPtr<CSSValueList> familyList = CSSValueList::createCommaSeparated();
|
| + familyList->append(cssValuePool().createFontFamilyValue(fontDescription.firstFamily().family()));
|
| +
|
| + ShorthandScope scope(this, CSSPropertyFont);
|
| + addProperty(CSSPropertyFontFamily, familyList, important, false);
|
| + addProperty(CSSPropertyFontStyle, cssValuePool().createIdentifierValue(fontDescription.style() == FontStyleItalic ? CSSValueItalic : CSSValueNormal), important, false);
|
| + addProperty(CSSPropertyFontVariant, cssValuePool().createIdentifierValue(fontDescription.variant() == FontVariantSmallCaps ? CSSValueSmallCaps : CSSValueNormal), important, false);
|
| + addProperty(CSSPropertyFontWeight, cssValuePool().createValue(fontDescription.weight()), important, false);
|
| + CSSParserValue fontSizeValue;
|
| + fontSizeValue.setFromNumber(fontDescription.specifiedSize(), CSSPrimitiveValue::CSS_PX);
|
| + addProperty(CSSPropertyFontSize, parseValidPrimitive(fontSizeValue.id, &fontSizeValue), important, false);
|
| + addProperty(CSSPropertyLineHeight, cssValuePool().createIdentifierValue(CSSValueNormal), important, false);
|
| +
|
| + return true;
|
| +}
|
| +
|
| // [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family'
|
| bool CSSPropertyParser::parseFont(bool important)
|
| {
|
|
|