OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * * Redistributions of source code must retain the above copyright | 4 * * Redistributions of source code must retain the above copyright |
5 * notice, this list of conditions and the following disclaimer. | 5 * notice, this list of conditions and the following disclaimer. |
6 * * Redistributions in binary form must reproduce the above | 6 * * Redistributions in binary form must reproduce the above |
7 * copyright notice, this list of conditions and the following disclaimer | 7 * copyright notice, this list of conditions and the following disclaimer |
8 * in the documentation and/or other materials provided with the | 8 * in the documentation and/or other materials provided with the |
9 * distribution. | 9 * distribution. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 case CSSValueWebkitPictograph: | 135 case CSSValueWebkitPictograph: |
136 return FontDescription::PictographFamily; | 136 return FontDescription::PictographFamily; |
137 default: | 137 default: |
138 return FontDescription::NoFamily; | 138 return FontDescription::NoFamily; |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 static bool convertFontFamilyName(StyleResolverState& state, CSSValue& value, | 142 static bool convertFontFamilyName(StyleResolverState& state, CSSValue& value, |
143 FontDescription::GenericFamilyType& genericFamily, AtomicString& familyName) | 143 FontDescription::GenericFamilyType& genericFamily, AtomicString& familyName) |
144 { | 144 { |
145 if (value.isCustomIdentValue()) { | 145 if (value.isFontFamilyValue()) { |
146 genericFamily = FontDescription::NoFamily; | 146 genericFamily = FontDescription::NoFamily; |
147 familyName = AtomicString(toCSSCustomIdentValue(value).value()); | 147 familyName = AtomicString(toCSSFontFamilyValue(value).value()); |
148 } else if (state.document().settings()) { | 148 } else if (state.document().settings()) { |
149 genericFamily = convertGenericFamily(toCSSPrimitiveValue(value).getValue
ID()); | 149 genericFamily = convertGenericFamily(toCSSPrimitiveValue(value).getValue
ID()); |
150 familyName = state.fontBuilder().genericFontFamilyName(genericFamily); | 150 familyName = state.fontBuilder().genericFontFamilyName(genericFamily); |
151 } | 151 } |
152 | 152 |
153 return !familyName.isEmpty(); | 153 return !familyName.isEmpty(); |
154 } | 154 } |
155 | 155 |
156 FontDescription::FamilyDescription StyleBuilderConverter::convertFontFamily(Styl
eResolverState& state, const CSSValue& value) | 156 FontDescription::FamilyDescription StyleBuilderConverter::convertFontFamily(Styl
eResolverState& state, const CSSValue& value) |
157 { | 157 { |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 | 942 |
943 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
e& state, const CSSValue& value) | 943 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
e& state, const CSSValue& value) |
944 { | 944 { |
945 if (value.isPathValue()) | 945 if (value.isPathValue()) |
946 return toCSSPathValue(value).stylePath(); | 946 return toCSSPathValue(value).stylePath(); |
947 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() =
= CSSValueNone); | 947 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() =
= CSSValueNone); |
948 return nullptr; | 948 return nullptr; |
949 } | 949 } |
950 | 950 |
951 } // namespace blink | 951 } // namespace blink |
OLD | NEW |