summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyosuke Niwa <rniwa@webkit.org>2014-07-04 10:31:31 +0200
committerAllan Sandfeld Jensen <allan.jensen@digia.com>2014-07-04 13:27:11 +0200
commit11567a6b05de1c524db04bd6ecec6786aacace35 (patch)
tree3b15864885d1962f975ceb14f266cbd5fc14c673
parentcacab2c107e03cd460bcca734b5dd34f825305ea (diff)
Bad cast from CSSInitialValue to CSSValueList
https://bugs.webkit.org/show_bug.cgi?id=121729 Reviewed by Beth Dakin. Add a regression test. This is not a merge since the test in the Blink change involves superfluous execCommand calls. Change-Id: I13e08031516548a5915f8ad4c42486e9ba0e3d96 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156222 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Michael Bruning <michael.bruning@digia.com>
-rw-r--r--Source/WebCore/css/CSSParser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index db00100ec..54fd5e238 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -1289,7 +1289,11 @@ PassRefPtr<CSSValueList> CSSParser::parseFontFaceValue(const AtomicString& strin
RefPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create();
if (!parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, false, CSSQuirksMode, 0))
return 0;
- return static_pointer_cast<CSSValueList>(dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily));
+
+ RefPtr<CSSValue> fontFamily = dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily);
+ if (!fontFamily->isValueList())
+ return 0; // FIXME: "initial" and "inherit" should be parsed as font names in the face attribute.
+ return static_pointer_cast<CSSValueList>(fontFamily.release());
}
#if ENABLE(CSS_VARIABLES)