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

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

Issue 643893002: Store [-webkit-]perspective-origin as a LengthPoint. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase (again). Created 6 years, 2 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 ASSERT_NOT_REACHED(); 605 ASSERT_NOT_REACHED();
606 } 606 }
607 } else { 607 } else {
608 state.style()->setTransformOriginY(StyleBuilderConverter::convertLength( state, primitiveValue)); 608 state.style()->setTransformOriginY(StyleBuilderConverter::convertLength( state, primitiveValue));
609 } 609 }
610 610
611 primitiveValue = toCSSPrimitiveValue(list->item(2)); 611 primitiveValue = toCSSPrimitiveValue(list->item(2));
612 state.style()->setTransformOriginZ(StyleBuilderConverter::convertComputedLen gth<float>(state, primitiveValue)); 612 state.style()->setTransformOriginZ(StyleBuilderConverter::convertComputedLen gth<float>(state, primitiveValue));
613 } 613 }
614 614
615 void StyleBuilderFunctions::applyInitialCSSPropertyPerspectiveOrigin(StyleResolv erState& state)
616 {
617 applyInitialCSSPropertyWebkitPerspectiveOriginX(state);
618 applyInitialCSSPropertyWebkitPerspectiveOriginY(state);
619 }
620
621 void StyleBuilderFunctions::applyInheritCSSPropertyPerspectiveOrigin(StyleResolv erState& state)
622 {
623 applyInheritCSSPropertyWebkitPerspectiveOriginX(state);
624 applyInheritCSSPropertyWebkitPerspectiveOriginY(state);
625 }
626
627 void StyleBuilderFunctions::applyValueCSSPropertyPerspectiveOrigin(StyleResolver State& state, CSSValue* value)
628 {
629 CSSValueList* list = toCSSValueList(value);
630 ASSERT(list->length() == 2);
631 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(list->item(0));
632 if (primitiveValue->isValueID()) {
633 switch (primitiveValue->getValueID()) {
634 case CSSValueLeft:
635 state.style()->setPerspectiveOriginX(Length(0, Percent));
636 break;
637 case CSSValueRight:
638 state.style()->setPerspectiveOriginX(Length(100, Percent));
639 break;
640 case CSSValueCenter:
641 state.style()->setPerspectiveOriginX(Length(50, Percent));
642 break;
643 default:
644 ASSERT_NOT_REACHED();
645 }
646 } else {
647 state.style()->setPerspectiveOriginX(StyleBuilderConverter::convertLengt h(state, primitiveValue));
648 }
649
650 primitiveValue = toCSSPrimitiveValue(list->item(1));
651 if (primitiveValue->isValueID()) {
652 switch (primitiveValue->getValueID()) {
653 case CSSValueTop:
654 state.style()->setPerspectiveOriginY(Length(0, Percent));
655 break;
656 case CSSValueBottom:
657 state.style()->setPerspectiveOriginY(Length(100, Percent));
658 break;
659 case CSSValueCenter:
660 state.style()->setPerspectiveOriginY(Length(50, Percent));
661 break;
662 default:
663 ASSERT_NOT_REACHED();
664 }
665 } else {
666 state.style()->setPerspectiveOriginY(StyleBuilderConverter::convertLengt h(state, primitiveValue));
667 }
668 }
669
670 void StyleBuilderFunctions::applyInheritCSSPropertyVerticalAlign(StyleResolverSt ate& state) 615 void StyleBuilderFunctions::applyInheritCSSPropertyVerticalAlign(StyleResolverSt ate& state)
671 { 616 {
672 EVerticalAlign verticalAlign = state.parentStyle()->verticalAlign(); 617 EVerticalAlign verticalAlign = state.parentStyle()->verticalAlign();
673 state.style()->setVerticalAlign(verticalAlign); 618 state.style()->setVerticalAlign(verticalAlign);
674 if (verticalAlign == LENGTH) 619 if (verticalAlign == LENGTH)
675 state.style()->setVerticalAlignLength(state.parentStyle()->verticalAlign Length()); 620 state.style()->setVerticalAlignLength(state.parentStyle()->verticalAlign Length());
676 } 621 }
677 622
678 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat e& state, CSSValue* value) 623 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat e& state, CSSValue* value)
679 { 624 {
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 return; 1028 return;
1084 case CSSValueSuper: 1029 case CSSValueSuper:
1085 svgStyle.setBaselineShift(BS_SUPER); 1030 svgStyle.setBaselineShift(BS_SUPER);
1086 return; 1031 return;
1087 default: 1032 default:
1088 ASSERT_NOT_REACHED(); 1033 ASSERT_NOT_REACHED();
1089 } 1034 }
1090 } 1035 }
1091 1036
1092 } // namespace blink 1037 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698