Chromium Code Reviews

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

Issue 686723002: Improve RAII of StyleResolverState. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: When baseRenderStyle!=0: 1) don't inherit, and 2) use defaultStyleForElement as fallback parent. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 559 matching lines...)
570 state.style()->setVerticalAlign(*primitiveValue); 570 state.style()->setVerticalAlign(*primitiveValue);
571 return; 571 return;
572 } 572 }
573 573
574 state.style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedC onversion | PercentConversion>(state.cssToLengthConversionData())); 574 state.style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedC onversion | PercentConversion>(state.cssToLengthConversionData()));
575 } 575 }
576 576
577 static void resetEffectiveZoom(StyleResolverState& state) 577 static void resetEffectiveZoom(StyleResolverState& state)
578 { 578 {
579 // Reset the zoom in effect. This allows the setZoom method to accurately co mpute a new zoom in effect. 579 // Reset the zoom in effect. This allows the setZoom method to accurately co mpute a new zoom in effect.
580 state.setEffectiveZoom(state.parentStyle() ? state.parentStyle()->effectiveZ oom() : RenderStyle::initialZoom()); 580 state.setEffectiveZoom(state.parentStyle()->effectiveZoom());
581 } 581 }
582 582
583 void StyleBuilderFunctions::applyInitialCSSPropertyZoom(StyleResolverState& stat e) 583 void StyleBuilderFunctions::applyInitialCSSPropertyZoom(StyleResolverState& stat e)
584 { 584 {
585 resetEffectiveZoom(state); 585 resetEffectiveZoom(state);
586 state.setZoom(RenderStyle::initialZoom()); 586 state.setZoom(RenderStyle::initialZoom());
587 } 587 }
588 588
589 void StyleBuilderFunctions::applyInheritCSSPropertyZoom(StyleResolverState& stat e) 589 void StyleBuilderFunctions::applyInheritCSSPropertyZoom(StyleResolverState& stat e)
590 { 590 {
(...skipping 330 matching lines...)
921 return; 921 return;
922 case CSSValueSuper: 922 case CSSValueSuper:
923 svgStyle.setBaselineShift(BS_SUPER); 923 svgStyle.setBaselineShift(BS_SUPER);
924 return; 924 return;
925 default: 925 default:
926 ASSERT_NOT_REACHED(); 926 ASSERT_NOT_REACHED();
927 } 927 }
928 } 928 }
929 929
930 } // namespace blink 930 } // namespace blink
OLDNEW

Powered by Google App Engine