OLD | NEW |
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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 ASSERT_NOT_REACHED(); | 604 ASSERT_NOT_REACHED(); |
605 } | 605 } |
606 } else { | 606 } else { |
607 state.style()->setTransformOriginY(StyleBuilderConverter::convertLength(
state, primitiveValue)); | 607 state.style()->setTransformOriginY(StyleBuilderConverter::convertLength(
state, primitiveValue)); |
608 } | 608 } |
609 | 609 |
610 primitiveValue = toCSSPrimitiveValue(list->item(2)); | 610 primitiveValue = toCSSPrimitiveValue(list->item(2)); |
611 state.style()->setTransformOriginZ(StyleBuilderConverter::convertComputedLen
gth<float>(state, primitiveValue)); | 611 state.style()->setTransformOriginZ(StyleBuilderConverter::convertComputedLen
gth<float>(state, primitiveValue)); |
612 } | 612 } |
613 | 613 |
614 void StyleBuilderFunctions::applyInitialCSSPropertyPerspectiveOrigin(StyleResolv
erState& state) | |
615 { | |
616 applyInitialCSSPropertyWebkitPerspectiveOriginX(state); | |
617 applyInitialCSSPropertyWebkitPerspectiveOriginY(state); | |
618 } | |
619 | |
620 void StyleBuilderFunctions::applyInheritCSSPropertyPerspectiveOrigin(StyleResolv
erState& state) | |
621 { | |
622 applyInheritCSSPropertyWebkitPerspectiveOriginX(state); | |
623 applyInheritCSSPropertyWebkitPerspectiveOriginY(state); | |
624 } | |
625 | |
626 void StyleBuilderFunctions::applyValueCSSPropertyPerspectiveOrigin(StyleResolver
State& state, CSSValue* value) | |
627 { | |
628 CSSValueList* list = toCSSValueList(value); | |
629 ASSERT(list->length() == 2); | |
630 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(list->item(0)); | |
631 if (primitiveValue->isValueID()) { | |
632 switch (primitiveValue->getValueID()) { | |
633 case CSSValueLeft: | |
634 state.style()->setPerspectiveOriginX(Length(0, Percent)); | |
635 break; | |
636 case CSSValueRight: | |
637 state.style()->setPerspectiveOriginX(Length(100, Percent)); | |
638 break; | |
639 case CSSValueCenter: | |
640 state.style()->setPerspectiveOriginX(Length(50, Percent)); | |
641 break; | |
642 default: | |
643 ASSERT_NOT_REACHED(); | |
644 } | |
645 } else { | |
646 state.style()->setPerspectiveOriginX(StyleBuilderConverter::convertLengt
h(state, primitiveValue)); | |
647 } | |
648 | |
649 primitiveValue = toCSSPrimitiveValue(list->item(1)); | |
650 if (primitiveValue->isValueID()) { | |
651 switch (primitiveValue->getValueID()) { | |
652 case CSSValueTop: | |
653 state.style()->setPerspectiveOriginY(Length(0, Percent)); | |
654 break; | |
655 case CSSValueBottom: | |
656 state.style()->setPerspectiveOriginY(Length(100, Percent)); | |
657 break; | |
658 case CSSValueCenter: | |
659 state.style()->setPerspectiveOriginY(Length(50, Percent)); | |
660 break; | |
661 default: | |
662 ASSERT_NOT_REACHED(); | |
663 } | |
664 } else { | |
665 state.style()->setPerspectiveOriginY(StyleBuilderConverter::convertLengt
h(state, primitiveValue)); | |
666 } | |
667 } | |
668 | |
669 void StyleBuilderFunctions::applyInheritCSSPropertyVerticalAlign(StyleResolverSt
ate& state) | 614 void StyleBuilderFunctions::applyInheritCSSPropertyVerticalAlign(StyleResolverSt
ate& state) |
670 { | 615 { |
671 EVerticalAlign verticalAlign = state.parentStyle()->verticalAlign(); | 616 EVerticalAlign verticalAlign = state.parentStyle()->verticalAlign(); |
672 state.style()->setVerticalAlign(verticalAlign); | 617 state.style()->setVerticalAlign(verticalAlign); |
673 if (verticalAlign == LENGTH) | 618 if (verticalAlign == LENGTH) |
674 state.style()->setVerticalAlignLength(state.parentStyle()->verticalAlign
Length()); | 619 state.style()->setVerticalAlignLength(state.parentStyle()->verticalAlign
Length()); |
675 } | 620 } |
676 | 621 |
677 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat
e& state, CSSValue* value) | 622 void StyleBuilderFunctions::applyValueCSSPropertyVerticalAlign(StyleResolverStat
e& state, CSSValue* value) |
678 { | 623 { |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 return; | 999 return; |
1055 case CSSValueSuper: | 1000 case CSSValueSuper: |
1056 svgStyle.setBaselineShift(BS_SUPER); | 1001 svgStyle.setBaselineShift(BS_SUPER); |
1057 return; | 1002 return; |
1058 default: | 1003 default: |
1059 ASSERT_NOT_REACHED(); | 1004 ASSERT_NOT_REACHED(); |
1060 } | 1005 } |
1061 } | 1006 } |
1062 | 1007 |
1063 } // namespace blink | 1008 } // namespace blink |
OLD | NEW |