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

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

Issue 424683004: Use StyleBuilderConverter for text-decoration(-line). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Place the new function in order + refactor Created 6 years, 4 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
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 if (primitiveValue->isValueID() && primitiveValue->getValueID() != CSSValueW ebkitMatchParent) 607 if (primitiveValue->isValueID() && primitiveValue->getValueID() != CSSValueW ebkitMatchParent)
608 state.style()->setTextAlign(*primitiveValue); 608 state.style()->setTextAlign(*primitiveValue);
609 else if (state.parentStyle()->textAlign() == TASTART) 609 else if (state.parentStyle()->textAlign() == TASTART)
610 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection( ) ? LEFT : RIGHT); 610 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection( ) ? LEFT : RIGHT);
611 else if (state.parentStyle()->textAlign() == TAEND) 611 else if (state.parentStyle()->textAlign() == TAEND)
612 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection( ) ? RIGHT : LEFT); 612 state.style()->setTextAlign(state.parentStyle()->isLeftToRightDirection( ) ? RIGHT : LEFT);
613 else 613 else
614 state.style()->setTextAlign(state.parentStyle()->textAlign()); 614 state.style()->setTextAlign(state.parentStyle()->textAlign());
615 } 615 }
616 616
617 void StyleBuilderFunctions::applyValueCSSPropertyTextDecoration(StyleResolverSta te& state, CSSValue* value)
618 {
619 TextDecoration t = RenderStyle::initialTextDecoration();
620 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
621 CSSValue* item = i.value();
622 t |= *toCSSPrimitiveValue(item);
623 }
624 state.style()->setTextDecoration(t);
625 }
626
627 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent(StyleResolverState & state) 617 void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent(StyleResolverState & state)
628 { 618 {
629 state.style()->setTextIndent(state.parentStyle()->textIndent()); 619 state.style()->setTextIndent(state.parentStyle()->textIndent());
630 state.style()->setTextIndentLine(state.parentStyle()->textIndentLine()); 620 state.style()->setTextIndentLine(state.parentStyle()->textIndentLine());
631 state.style()->setTextIndentType(state.parentStyle()->textIndentType()); 621 state.style()->setTextIndentType(state.parentStyle()->textIndentType());
632 } 622 }
633 623
634 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent(StyleResolverState & state) 624 void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent(StyleResolverState & state)
635 { 625 {
636 state.style()->setTextIndent(RenderStyle::initialTextIndent()); 626 state.style()->setTextIndent(RenderStyle::initialTextIndent());
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 792 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
803 793
804 if (primitiveValue->getValueID()) { 794 if (primitiveValue->getValueID()) {
805 state.style()->setVerticalAlign(*primitiveValue); 795 state.style()->setVerticalAlign(*primitiveValue);
806 return; 796 return;
807 } 797 }
808 798
809 state.style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedC onversion | PercentConversion>(state.cssToLengthConversionData())); 799 state.style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedC onversion | PercentConversion>(state.cssToLengthConversionData()));
810 } 800 }
811 801
812 void StyleBuilderFunctions::applyValueCSSPropertyTouchAction(StyleResolverState& state, CSSValue* value)
813 {
814 TouchAction action = RenderStyle::initialTouchAction();
815 for (CSSValueListIterator i(value); i.hasMore(); i.advance())
816 action |= *toCSSPrimitiveValue(i.value());
817
818 state.style()->setTouchAction(action);
819 }
820
821 static void resetEffectiveZoom(StyleResolverState& state) 802 static void resetEffectiveZoom(StyleResolverState& state)
822 { 803 {
823 // Reset the zoom in effect. This allows the setZoom method to accurately co mpute a new zoom in effect. 804 // Reset the zoom in effect. This allows the setZoom method to accurately co mpute a new zoom in effect.
824 state.setEffectiveZoom(state.parentStyle() ? state.parentStyle()->effectiveZ oom() : RenderStyle::initialZoom()); 805 state.setEffectiveZoom(state.parentStyle() ? state.parentStyle()->effectiveZ oom() : RenderStyle::initialZoom());
825 } 806 }
826 807
827 void StyleBuilderFunctions::applyInitialCSSPropertyZoom(StyleResolverState& stat e) 808 void StyleBuilderFunctions::applyInitialCSSPropertyZoom(StyleResolverState& stat e)
828 { 809 {
829 resetEffectiveZoom(state); 810 resetEffectiveZoom(state);
830 state.setZoom(RenderStyle::initialZoom()); 811 state.setZoom(RenderStyle::initialZoom());
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 break; 1431 break;
1451 default: 1432 default:
1452 ASSERT_NOT_REACHED(); 1433 ASSERT_NOT_REACHED();
1453 break; 1434 break;
1454 } 1435 }
1455 1436
1456 state.style()->setGridAutoFlow(autoFlow); 1437 state.style()->setGridAutoFlow(autoFlow);
1457 } 1438 }
1458 1439
1459 } // namespace blink 1440 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698