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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index 1afa58a4fd59ffab4935a9cddc48a4b68e438c34..95bdfbeac37543c9d7040b05c5c9e7728a6e32ca 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -1176,36 +1176,17 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolver* styleResolv
return;
// Shorthand properties.
case CSSPropertyFont:
- // Short-hand properties are expanded by the parser and normally
- // do not go through applyProperty() at all. CSSPropertyFont
- // is special as system font names are sent through here.
- // FIXME: Unclear why this special casing is handled this way.
- // See isExpandedShorthand for more comments.
+ // Only System Font identifiers should come through this method
+ // all other values should have been handled when the shorthand
+ // was expanded by the parser.
+ // FIXME: System Font identifiers should not hijack this
+ // short-hand CSSProperty like this.
ASSERT(!isInitial);
ASSERT(!isInherit);
- if (primitiveValue) {
- state.style()->setLineHeight(RenderStyle::initialLineHeight());
- state.setLineHeightValue(0);
- state.fontBuilder().fromSystemFont(primitiveValue->getValueID(), state.style()->effectiveZoom());
- } else if (value->isFontValue()) {
- FontValue* font = static_cast<FontValue*>(value);
- if (!font->style || !font->variant || !font->weight
- || !font->size || !font->lineHeight || !font->family)
- return;
- styleResolver->applyProperty(CSSPropertyFontStyle, font->style.get());
- styleResolver->applyProperty(CSSPropertyFontVariant, font->variant.get());
- styleResolver->applyProperty(CSSPropertyFontWeight, font->weight.get());
- // The previous properties can dirty our font but they don't try to read the font's
- // properties back, which is safe. However if font-size is using the 'ex' unit, it will
- // need query the dirtied font's x-height to get the computed size. To be safe in this
- // case, let's just update the font now.
- styleResolver->updateFont();
- styleResolver->applyProperty(CSSPropertyFontSize, font->size.get());
-
- state.setLineHeightValue(font->lineHeight.get());
-
- styleResolver->applyProperty(CSSPropertyFontFamily, font->family.get());
- }
+ ASSERT(primitiveValue);
+ state.style()->setLineHeight(RenderStyle::initialLineHeight());
+ state.setLineHeightValue(0);
+ state.fontBuilder().fromSystemFont(primitiveValue->getValueID(), state.style()->effectiveZoom());
return;
case CSSPropertyBackground:
case CSSPropertyBackgroundPosition:
« 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