OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 // Get our zoom value. | 618 // Get our zoom value. |
619 float zoom = useSVGZoomRules() ? 1.0f : style()->effectiveZoom(); | 619 float zoom = useSVGZoomRules() ? 1.0f : style()->effectiveZoom(); |
620 | 620 |
621 // Retrieve the primitive value. | 621 // Retrieve the primitive value. |
622 CSSPrimitiveValue* borderWidths = toCSSPrimitiveValue(value); | 622 CSSPrimitiveValue* borderWidths = toCSSPrimitiveValue(value); |
623 | 623 |
624 // Set up a length box to represent our image slices. | 624 // Set up a length box to represent our image slices. |
625 BorderImageLengthBox box; // Defaults to 'auto' so we don't have to handle t
hat explicitly below. | 625 BorderImageLengthBox box; // Defaults to 'auto' so we don't have to handle t
hat explicitly below. |
626 Quad* slices = borderWidths->getQuadValue(); | 626 Quad* slices = borderWidths->getQuadValue(); |
627 if (slices->top()->isNumber()) | 627 if (slices->top()->isNumber()) |
628 box.setTop(slices->top()->getIntValue()); | 628 box.setTop(slices->top()->getDoubleValue()); |
629 else if (slices->top()->isPercentage()) | 629 else if (slices->top()->isPercentage()) |
630 box.setTop(Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_P
ERCENTAGE), Percent)); | 630 box.setTop(Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_P
ERCENTAGE), Percent)); |
631 else if (slices->top()->getValueID() != CSSValueAuto) | 631 else if (slices->top()->getValueID() != CSSValueAuto) |
632 box.setTop(slices->top()->computeLength<Length>(style(), rootElementStyl
e(), zoom)); | 632 box.setTop(slices->top()->computeLength<Length>(style(), rootElementStyl
e(), zoom)); |
633 | 633 |
634 if (slices->right()->isNumber()) | 634 if (slices->right()->isNumber()) |
635 box.setRight(slices->right()->getIntValue()); | 635 box.setRight(slices->right()->getDoubleValue()); |
636 else if (slices->right()->isPercentage()) | 636 else if (slices->right()->isPercentage()) |
637 box.setRight(Length(slices->right()->getDoubleValue(CSSPrimitiveValue::C
SS_PERCENTAGE), Percent)); | 637 box.setRight(Length(slices->right()->getDoubleValue(CSSPrimitiveValue::C
SS_PERCENTAGE), Percent)); |
638 else if (slices->right()->getValueID() != CSSValueAuto) | 638 else if (slices->right()->getValueID() != CSSValueAuto) |
639 box.setRight(slices->right()->computeLength<Length>(style(), rootElement
Style(), zoom)); | 639 box.setRight(slices->right()->computeLength<Length>(style(), rootElement
Style(), zoom)); |
640 | 640 |
641 if (slices->bottom()->isNumber()) | 641 if (slices->bottom()->isNumber()) |
642 box.setBottom(slices->bottom()->getIntValue()); | 642 box.setBottom(slices->bottom()->getDoubleValue()); |
643 else if (slices->bottom()->isPercentage()) | 643 else if (slices->bottom()->isPercentage()) |
644 box.setBottom(Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue:
:CSS_PERCENTAGE), Percent)); | 644 box.setBottom(Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue:
:CSS_PERCENTAGE), Percent)); |
645 else if (slices->bottom()->getValueID() != CSSValueAuto) | 645 else if (slices->bottom()->getValueID() != CSSValueAuto) |
646 box.setBottom(slices->bottom()->computeLength<Length>(style(), rootEleme
ntStyle(), zoom)); | 646 box.setBottom(slices->bottom()->computeLength<Length>(style(), rootEleme
ntStyle(), zoom)); |
647 | 647 |
648 if (slices->left()->isNumber()) | 648 if (slices->left()->isNumber()) |
649 box.setLeft(slices->left()->getIntValue()); | 649 box.setLeft(slices->left()->getDoubleValue()); |
650 else if (slices->left()->isPercentage()) | 650 else if (slices->left()->isPercentage()) |
651 box.setLeft(Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS
_PERCENTAGE), Percent)); | 651 box.setLeft(Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS
_PERCENTAGE), Percent)); |
652 else if (slices->left()->getValueID() != CSSValueAuto) | 652 else if (slices->left()->getValueID() != CSSValueAuto) |
653 box.setLeft(slices->left()->computeLength<Length>(style(), rootElementSt
yle(), zoom)); | 653 box.setLeft(slices->left()->computeLength<Length>(style(), rootElementSt
yle(), zoom)); |
654 | 654 |
655 return box; | 655 return box; |
656 } | 656 } |
657 | 657 |
658 void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& ima
ge) const | 658 void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& ima
ge) const |
659 { | 659 { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 verticalRule = SpaceImageRule; | 697 verticalRule = SpaceImageRule; |
698 break; | 698 break; |
699 default: // CSSValueRepeat | 699 default: // CSSValueRepeat |
700 verticalRule = RepeatImageRule; | 700 verticalRule = RepeatImageRule; |
701 break; | 701 break; |
702 } | 702 } |
703 image.setVerticalRule(verticalRule); | 703 image.setVerticalRule(verticalRule); |
704 } | 704 } |
705 | 705 |
706 }; | 706 }; |
OLD | NEW |