summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/css/CSSParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/css/CSSParser.cpp')
-rw-r--r--Source/WebCore/css/CSSParser.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index b7030b2..7db8389 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -4252,6 +4252,9 @@ static bool parseColorIntOrPercentage(const UChar*& string, const UChar* end, co
localValue = newValue;
}
+ if (current == end)
+ return false;
+
if (expect == CSSPrimitiveValue::CSS_NUMBER && (*current == '.' || *current == '%'))
return false;
@@ -6429,9 +6432,11 @@ CSSRule* CSSParser::createFontFaceRule()
if ((id == CSSPropertyFontWeight || id == CSSPropertyFontStyle || id == CSSPropertyFontVariant) && property->value()->isPrimitiveValue()) {
RefPtr<CSSValue> value = property->m_value.release();
property->m_value = CSSValueList::createCommaSeparated();
- static_cast<CSSValueList*>(property->m_value.get())->append(value.release());
- } else if (id == CSSPropertyFontFamily && static_cast<CSSValueList*>(property->m_value.get())->length() != 1) {
- // Unlike font-family property, font-family descriptor in @font-face rule can take only one family name.
+ static_cast<CSSValueList*>(property->value())->append(value.release());
+ } else if (id == CSSPropertyFontFamily && (!property->value()->isValueList() || static_cast<CSSValueList*>(property->value())->length() != 1)) {
+ // Unlike font-family property, font-family descriptor in @font-face rule
+ // has to be a value list with exactly one family name. It cannot have a
+ // have 'initial' value and cannot 'inherit' from parent.
// See http://dev.w3.org/csswg/css3-fonts/#font-family-desc
clearProperties();
return 0;