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

Side by Side Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 19678002: Remove more dead code in applyProperty(CSSPropertyFont) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | « no previous file | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 state.style()->setQuotes(quotes); 1169 state.style()->setQuotes(quotes);
1170 return; 1170 return;
1171 } 1171 }
1172 if (primitiveValue) { 1172 if (primitiveValue) {
1173 if (primitiveValue->getValueID() == CSSValueNone) 1173 if (primitiveValue->getValueID() == CSSValueNone)
1174 state.style()->setQuotes(QuotesData::create()); 1174 state.style()->setQuotes(QuotesData::create());
1175 } 1175 }
1176 return; 1176 return;
1177 // Shorthand properties. 1177 // Shorthand properties.
1178 case CSSPropertyFont: 1178 case CSSPropertyFont:
1179 // Short-hand properties are expanded by the parser and normally 1179 // Only System Font identifiers should come through this method
1180 // do not go through applyProperty() at all. CSSPropertyFont 1180 // all other values should have been handled when the shorthand
1181 // is special as system font names are sent through here. 1181 // was expanded by the parser.
1182 // FIXME: Unclear why this special casing is handled this way. 1182 // FIXME: System Font identifiers should not hijack this
1183 // See isExpandedShorthand for more comments. 1183 // short-hand CSSProperty like this.
1184 ASSERT(!isInitial); 1184 ASSERT(!isInitial);
1185 ASSERT(!isInherit); 1185 ASSERT(!isInherit);
1186 if (primitiveValue) { 1186 ASSERT(primitiveValue);
1187 state.style()->setLineHeight(RenderStyle::initialLineHeight()); 1187 state.style()->setLineHeight(RenderStyle::initialLineHeight());
1188 state.setLineHeightValue(0); 1188 state.setLineHeightValue(0);
1189 state.fontBuilder().fromSystemFont(primitiveValue->getValueID(), sta te.style()->effectiveZoom()); 1189 state.fontBuilder().fromSystemFont(primitiveValue->getValueID(), state.s tyle()->effectiveZoom());
1190 } else if (value->isFontValue()) {
1191 FontValue* font = static_cast<FontValue*>(value);
1192 if (!font->style || !font->variant || !font->weight
1193 || !font->size || !font->lineHeight || !font->family)
1194 return;
1195 styleResolver->applyProperty(CSSPropertyFontStyle, font->style.get() );
1196 styleResolver->applyProperty(CSSPropertyFontVariant, font->variant.g et());
1197 styleResolver->applyProperty(CSSPropertyFontWeight, font->weight.get ());
1198 // The previous properties can dirty our font but they don't try to read the font's
1199 // properties back, which is safe. However if font-size is using the 'ex' unit, it will
1200 // need query the dirtied font's x-height to get the computed size. To be safe in this
1201 // case, let's just update the font now.
1202 styleResolver->updateFont();
1203 styleResolver->applyProperty(CSSPropertyFontSize, font->size.get());
1204
1205 state.setLineHeightValue(font->lineHeight.get());
1206
1207 styleResolver->applyProperty(CSSPropertyFontFamily, font->family.get ());
1208 }
1209 return; 1190 return;
1210 case CSSPropertyBackground: 1191 case CSSPropertyBackground:
1211 case CSSPropertyBackgroundPosition: 1192 case CSSPropertyBackgroundPosition:
1212 case CSSPropertyBackgroundRepeat: 1193 case CSSPropertyBackgroundRepeat:
1213 case CSSPropertyBorder: 1194 case CSSPropertyBorder:
1214 case CSSPropertyBorderBottom: 1195 case CSSPropertyBorderBottom:
1215 case CSSPropertyBorderColor: 1196 case CSSPropertyBorderColor:
1216 case CSSPropertyBorderImage: 1197 case CSSPropertyBorderImage:
1217 case CSSPropertyBorderLeft: 1198 case CSSPropertyBorderLeft:
1218 case CSSPropertyBorderRadius: 1199 case CSSPropertyBorderRadius:
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 case CSSPropertyMaskType: { 2218 case CSSPropertyMaskType: {
2238 HANDLE_SVG_INHERIT_AND_INITIAL(maskType, MaskType) 2219 HANDLE_SVG_INHERIT_AND_INITIAL(maskType, MaskType)
2239 if (primitiveValue) 2220 if (primitiveValue)
2240 state.style()->accessSVGStyle()->setMaskType(*primitiveValue); 2221 state.style()->accessSVGStyle()->setMaskType(*primitiveValue);
2241 break; 2222 break;
2242 } 2223 }
2243 } 2224 }
2244 } 2225 }
2245 2226
2246 } // namespace WebCore 2227 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698