Chromium Code Reviews| Index: Source/core/css/parser/CSSPropertyParser.cpp |
| diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp |
| index 89f31400a1c047514cc60219657d6f2a1bcab1c2..69634e75b238ae462ebca26e2e2057540715d290 100644 |
| --- a/Source/core/css/parser/CSSPropertyParser.cpp |
| +++ b/Source/core/css/parser/CSSPropertyParser.cpp |
| @@ -561,6 +561,13 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important) |
| return false; |
| return parseFontWeight(important); |
| } |
| + |
| + case CSSPropertyFontStretch: { // normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded |
|
ojan
2014/03/13 21:53:24
I know code around this does this comment thing, b
|
| + if (m_valueList->size() != 1) |
| + return false; |
| + return parseFontStretch(important); |
| + } |
| + |
| case CSSPropertyBorderSpacing: { |
| if (num == 1) { |
| ShorthandScope scope(this, CSSPropertyBorderSpacing); |
| @@ -1438,8 +1445,6 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important) |
| return false; |
| case CSSPropertyPage: |
| return parsePage(propId, important); |
| - case CSSPropertyFontStretch: |
| - return false; |
| // CSS Text Layout Module Level 3: Vertical writing support |
| case CSSPropertyWebkitTextEmphasis: |
| return parseShorthand(propId, webkitTextEmphasisShorthand(), important); |
| @@ -4535,6 +4540,7 @@ bool CSSPropertyParser::parseFont(bool important) |
| bool fontStyleParsed = false; |
| bool fontVariantParsed = false; |
| bool fontWeightParsed = false; |
| + bool fontStretchParsed = false; |
| CSSParserValue* value; |
| while ((value = m_valueList->current())) { |
| if (!fontStyleParsed && isValidKeywordPropertyAndValue(CSSPropertyFontStyle, value->id, m_context)) { |
| @@ -4544,10 +4550,13 @@ bool CSSPropertyParser::parseFont(bool important) |
| // Font variant in the shorthand is particular, it only accepts normal or small-caps. |
| addProperty(CSSPropertyFontVariant, cssValuePool().createIdentifierValue(value->id), important); |
| fontVariantParsed = true; |
| - } else if (!fontWeightParsed && parseFontWeight(important)) |
| + } else if (!fontWeightParsed && parseFontWeight(important)) { |
| fontWeightParsed = true; |
| - else |
| + } else if (!fontStretchParsed && parseFontStretch(important)) { |
| + fontStretchParsed = true; |
| + } else { |
| break; |
| + } |
| m_valueList->next(); |
| } |
| @@ -4560,6 +4569,8 @@ bool CSSPropertyParser::parseFont(bool important) |
| addProperty(CSSPropertyFontVariant, cssValuePool().createIdentifierValue(CSSValueNormal), important, true); |
| if (!fontWeightParsed) |
| addProperty(CSSPropertyFontWeight, cssValuePool().createIdentifierValue(CSSValueNormal), important, true); |
| + if (!fontStretchParsed) |
| + addProperty(CSSPropertyFontStretch, cssValuePool().createIdentifierValue(CSSValueNormal), important, true); |
| // Now a font size _must_ come. |
| // <absolute-size> | <relative-size> | <length> | <percentage> | inherit |
| @@ -4798,6 +4809,16 @@ bool CSSPropertyParser::parseFontWeight(bool important) |
| return false; |
| } |
| +bool CSSPropertyParser::parseFontStretch(bool important) |
| +{ |
| + CSSParserValue* value = m_valueList->current(); |
| + if (value->id == CSSValueNormal || (value->id >= CSSValueUltraCondensed && value->id <= CSSValueUltraExpanded)) { |
| + addProperty(CSSPropertyFontStretch, cssValuePool().createIdentifierValue(value->id), important); |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| bool CSSPropertyParser::parseFontFaceSrcURI(CSSValueList* valueList) |
| { |
| RefPtrWillBeRawPtr<CSSFontFaceSrcValue> uriValue(CSSFontFaceSrcValue::create(completeURL(m_valueList->current()->string))); |