Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: Source/core/css/CSSParser-in.cpp

Issue 23604036: ASSERT: Bad cast from CSSInitialValue to CSSValueList (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/css/crash-inherit-value-font-family-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 return true; 1141 return true;
1142 } 1142 }
1143 1143
1144 PassRefPtr<CSSValueList> CSSParser::parseFontFaceValue(const AtomicString& strin g) 1144 PassRefPtr<CSSValueList> CSSParser::parseFontFaceValue(const AtomicString& strin g)
1145 { 1145 {
1146 if (string.isEmpty()) 1146 if (string.isEmpty())
1147 return 0; 1147 return 0;
1148 RefPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create (); 1148 RefPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create ();
1149 if (!parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, false, CSSQ uirksMode, 0)) 1149 if (!parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, false, CSSQ uirksMode, 0))
1150 return 0; 1150 return 0;
1151 return static_pointer_cast<CSSValueList>(dummyStyle->getPropertyCSSValue(CSS PropertyFontFamily)); 1151
1152 RefPtr<CSSValue> fontFamily = dummyStyle->getPropertyCSSValue(CSSPropertyFon tFamily);
1153 if (!fontFamily->isValueList())
1154 return 0;
1155
1156 return toCSSValueList(dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily) .leakRef());
eseidel 2013/09/03 22:40:23 leakRef? You mean release and static_ptr_cast?
Julien - ping for review 2013/09/03 23:17:41 I don't want to use static_ptr_cast as it is unsaf
1152 } 1157 }
1153 1158
1154 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID p ropertyID, const String& string, bool important, const Document& document) 1159 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID p ropertyID, const String& string, bool important, const Document& document)
1155 { 1160 {
1156 ASSERT(!string.isEmpty()); 1161 ASSERT(!string.isEmpty());
1157 1162
1158 CSSParserContext context(document); 1163 CSSParserContext context(document);
1159 1164
1160 if (parseSimpleLengthValue(declaration, propertyID, string, important, conte xt.mode)) 1165 if (parseSimpleLengthValue(declaration, propertyID, string, important, conte xt.mode))
1161 return true; 1166 return true;
(...skipping 10811 matching lines...) Expand 10 before | Expand all | Expand 10 after
11973 { 11978 {
11974 // The tokenizer checks for the construct of an+b. 11979 // The tokenizer checks for the construct of an+b.
11975 // However, since the {ident} rule precedes the {nth} rule, some of those 11980 // However, since the {ident} rule precedes the {nth} rule, some of those
11976 // tokens are identified as string literal. Furthermore we need to accept 11981 // tokens are identified as string literal. Furthermore we need to accept
11977 // "odd" and "even" which does not match to an+b. 11982 // "odd" and "even" which does not match to an+b.
11978 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11983 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11979 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11984 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11980 } 11985 }
11981 11986
11982 } 11987 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/crash-inherit-value-font-family-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698