| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2014 Google, Inc. | 5 * Copyright (C) 2014 Google, Inc. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 LayoutRect contentBoxRect = toLayoutSVGRoot(layoutObject())->contentBoxR
ect(); | 640 LayoutRect contentBoxRect = toLayoutSVGRoot(layoutObject())->contentBoxR
ect(); |
| 641 return FloatSize(contentBoxRect.width() / layoutObject()->style()->effec
tiveZoom(), contentBoxRect.height() / layoutObject()->style()->effectiveZoom()); | 641 return FloatSize(contentBoxRect.width() / layoutObject()->style()->effec
tiveZoom(), contentBoxRect.height() / layoutObject()->style()->effectiveZoom()); |
| 642 } | 642 } |
| 643 | 643 |
| 644 FloatRect viewportRect = toLayoutSVGViewportContainer(layoutObject())->viewp
ort(); | 644 FloatRect viewportRect = toLayoutSVGViewportContainer(layoutObject())->viewp
ort(); |
| 645 return FloatSize(viewportRect.width(), viewportRect.height()); | 645 return FloatSize(viewportRect.width(), viewportRect.height()); |
| 646 } | 646 } |
| 647 | 647 |
| 648 bool SVGSVGElement::hasIntrinsicWidth() const | 648 bool SVGSVGElement::hasIntrinsicWidth() const |
| 649 { | 649 { |
| 650 return width()->currentValue()->unitType() != LengthTypePercentage; | 650 return width()->currentValue()->getCSSPrimitiveValue()->primitiveType() != C
SSPrimitiveValue::CSS_PERCENTAGE; |
| 651 } | 651 } |
| 652 | 652 |
| 653 bool SVGSVGElement::hasIntrinsicHeight() const | 653 bool SVGSVGElement::hasIntrinsicHeight() const |
| 654 { | 654 { |
| 655 return height()->currentValue()->unitType() != LengthTypePercentage; | 655 return height()->currentValue()->getCSSPrimitiveValue()->primitiveType() !=
CSSPrimitiveValue::CSS_PERCENTAGE; |
| 656 } | 656 } |
| 657 | 657 |
| 658 Length SVGSVGElement::intrinsicWidth() const | 658 Length SVGSVGElement::intrinsicWidth() const |
| 659 { | 659 { |
| 660 if (width()->currentValue()->unitType() == LengthTypePercentage) | 660 if (width()->currentValue()->getCSSPrimitiveValue()->primitiveType() == CSSP
rimitiveValue::CSS_PERCENTAGE) |
| 661 return Length(0, Fixed); | 661 return Length(0, Fixed); |
| 662 | 662 |
| 663 SVGLengthContext lengthContext(this); | 663 SVGLengthContext lengthContext(this); |
| 664 return Length(width()->currentValue()->value(lengthContext), Fixed); | 664 return Length(width()->currentValue()->value(lengthContext), Fixed); |
| 665 } | 665 } |
| 666 | 666 |
| 667 Length SVGSVGElement::intrinsicHeight() const | 667 Length SVGSVGElement::intrinsicHeight() const |
| 668 { | 668 { |
| 669 if (height()->currentValue()->unitType() == LengthTypePercentage) | 669 if (height()->currentValue()->getCSSPrimitiveValue()->primitiveType() == CSS
PrimitiveValue::CSS_PERCENTAGE) |
| 670 return Length(0, Fixed); | 670 return Length(0, Fixed); |
| 671 | 671 |
| 672 SVGLengthContext lengthContext(this); | 672 SVGLengthContext lengthContext(this); |
| 673 return Length(height()->currentValue()->value(lengthContext), Fixed); | 673 return Length(height()->currentValue()->value(lengthContext), Fixed); |
| 674 } | 674 } |
| 675 | 675 |
| 676 AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float vie
wHeight) const | 676 AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float vie
wHeight) const |
| 677 { | 677 { |
| 678 if (!m_useCurrentView || !m_viewSpec) | 678 if (!m_useCurrentView || !m_viewSpec) |
| 679 return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), pre
serveAspectRatio()->currentValue(), viewWidth, viewHeight); | 679 return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), pre
serveAspectRatio()->currentValue(), viewWidth, viewHeight); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 visitor->trace(m_width); | 781 visitor->trace(m_width); |
| 782 visitor->trace(m_height); | 782 visitor->trace(m_height); |
| 783 visitor->trace(m_translation); | 783 visitor->trace(m_translation); |
| 784 visitor->trace(m_timeContainer); | 784 visitor->trace(m_timeContainer); |
| 785 visitor->trace(m_viewSpec); | 785 visitor->trace(m_viewSpec); |
| 786 SVGGraphicsElement::trace(visitor); | 786 SVGGraphicsElement::trace(visitor); |
| 787 SVGFitToViewBox::trace(visitor); | 787 SVGFitToViewBox::trace(visitor); |
| 788 } | 788 } |
| 789 | 789 |
| 790 } // namespace blink | 790 } // namespace blink |
| OLD | NEW |