OLD | NEW |
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 Loading... |
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)
.get()); |
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 Loading... |
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 } |
OLD | NEW |