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

Unified Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 748073002: Use a StyleBuilderConverter function for line-height. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « Source/core/css/resolver/StyleBuilderConverter.cpp ('k') | 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 2518b97435216667292a166fbc13560aff42c469..03d146e5fde0a57ca966bc3b334e1ad441ab4b87 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -304,34 +304,6 @@ void StyleBuilderFunctions::applyValueCSSPropertyGridTemplateAreas(StyleResolver
state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue->columnCount());
}
-void StyleBuilderFunctions::applyValueCSSPropertyLineHeight(StyleResolverState& state, CSSValue* value)
-{
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
- Length lineHeight;
-
- if (primitiveValue->getValueID() == CSSValueNormal) {
- lineHeight = RenderStyle::initialLineHeight();
- } else if (primitiveValue->isLength()) {
- float multiplier = state.style()->effectiveZoom();
- if (LocalFrame* frame = state.document().frame())
- multiplier *= frame->textZoomFactor();
- lineHeight = primitiveValue->computeLength<Length>(state.cssToLengthConversionData().copyWithAdjustedZoom(multiplier));
- } else if (primitiveValue->isPercentage()) {
- lineHeight = Length((state.style()->computedFontSize() * primitiveValue->getIntValue()) / 100.0, Fixed);
- } else if (primitiveValue->isNumber()) {
- lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
- } else if (primitiveValue->isCalculated()) {
- double multiplier = state.style()->effectiveZoom();
- if (LocalFrame* frame = state.document().frame())
- multiplier *= frame->textZoomFactor();
- Length zoomedLength = Length(primitiveValue->cssCalcValue()->toCalcValue(state.cssToLengthConversionData().copyWithAdjustedZoom(multiplier)));
- lineHeight = Length(valueForLength(zoomedLength, state.style()->fontSize()), Fixed);
andersr 2014/11/21 16:29:15 Calc resolves against RenderStyle::fontSize, but p
Timothy Loh 2014/11/21 17:13:02 Sounds wrong, but I wouldn't fix it in this patch.
- } else {
- return;
- }
- state.style()->setLineHeight(lineHeight);
-}
-
void StyleBuilderFunctions::applyValueCSSPropertyListStyleImage(StyleResolverState& state, CSSValue* value)
{
state.style()->setListStyleImage(state.styleImage(CSSPropertyListStyleImage, value));
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698