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

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

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 11 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
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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 lineHeight = RenderStyle::initialLineHeight(); 273 lineHeight = RenderStyle::initialLineHeight();
274 } else if (primitiveValue->isLength()) { 274 } else if (primitiveValue->isLength()) {
275 float multiplier = state.style()->effectiveZoom(); 275 float multiplier = state.style()->effectiveZoom();
276 if (Frame* frame = state.document().frame()) 276 if (Frame* frame = state.document().frame())
277 multiplier *= frame->textZoomFactor(); 277 multiplier *= frame->textZoomFactor();
278 lineHeight = primitiveValue->computeLength<Length>(state.cssToLengthConv ersionData().copyWithAdjustedZoom(multiplier)); 278 lineHeight = primitiveValue->computeLength<Length>(state.cssToLengthConv ersionData().copyWithAdjustedZoom(multiplier));
279 } else if (primitiveValue->isPercentage()) { 279 } else if (primitiveValue->isPercentage()) {
280 lineHeight = Length((state.style()->computedFontSize() * primitiveValue- >getIntValue()) / 100.0, Fixed); 280 lineHeight = Length((state.style()->computedFontSize() * primitiveValue- >getIntValue()) / 100.0, Fixed);
281 } else if (primitiveValue->isNumber()) { 281 } else if (primitiveValue->isNumber()) {
282 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent); 282 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
283 } else if (primitiveValue->isViewportPercentageLength()) {
284 lineHeight = primitiveValue->viewportPercentageLength();
285 } else if (primitiveValue->isCalculated()) { 283 } else if (primitiveValue->isCalculated()) {
286 double multiplier = state.style()->effectiveZoom(); 284 double multiplier = state.style()->effectiveZoom();
287 if (Frame* frame = state.document().frame()) 285 if (Frame* frame = state.document().frame())
288 multiplier *= frame->textZoomFactor(); 286 multiplier *= frame->textZoomFactor();
289 Length zoomedLength = Length(primitiveValue->cssCalcValue()->toCalcValue (state.cssToLengthConversionData().copyWithAdjustedZoom(multiplier))); 287 Length zoomedLength = Length(primitiveValue->cssCalcValue()->toCalcValue (state.cssToLengthConversionData().copyWithAdjustedZoom(multiplier)));
290 lineHeight = Length(valueForLength(zoomedLength, state.style()->fontSize ()), Fixed); 288 lineHeight = Length(valueForLength(zoomedLength, state.style()->fontSize ()), Fixed);
291 } else { 289 } else {
292 return; 290 return;
293 } 291 }
294 state.style()->setLineHeight(lineHeight); 292 state.style()->setLineHeight(lineHeight);
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after
2143 break; 2141 break;
2144 } 2142 }
2145 case CSSPropertyEnableBackground: 2143 case CSSPropertyEnableBackground:
2146 // Silently ignoring this property for now 2144 // Silently ignoring this property for now
2147 // http://bugs.webkit.org/show_bug.cgi?id=6022 2145 // http://bugs.webkit.org/show_bug.cgi?id=6022
2148 break; 2146 break;
2149 } 2147 }
2150 } 2148 }
2151 2149
2152 } // namespace WebCore 2150 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | Source/core/css/resolver/StyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698