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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 if (!toRenderSVGRoot(renderer())->isEmbeddedThroughSVGImage()) | 623 if (!toRenderSVGRoot(renderer())->isEmbeddedThroughSVGImage()) |
624 return FloatRect(); | 624 return FloatRect(); |
625 | 625 |
626 // If no viewBox is specified but non-relative width/height values, then we | 626 // If no viewBox is specified but non-relative width/height values, then we |
627 // should always synthesize a viewBox if we're embedded through a SVGImage. | 627 // should always synthesize a viewBox if we're embedded through a SVGImage. |
628 return FloatRect(FloatPoint(), FloatSize(floatValueForLength(intrinsicWidth(
), 0), floatValueForLength(intrinsicHeight(), 0))); | 628 return FloatRect(FloatPoint(), FloatSize(floatValueForLength(intrinsicWidth(
), 0), floatValueForLength(intrinsicHeight(), 0))); |
629 } | 629 } |
630 | 630 |
631 FloatSize SVGSVGElement::currentViewportSize() const | 631 FloatSize SVGSVGElement::currentViewportSize() const |
632 { | 632 { |
633 if (hasIntrinsicWidth() && hasIntrinsicHeight()) { | |
634 Length intrinsicWidth = this->intrinsicWidth(); | |
635 Length intrinsicHeight = this->intrinsicHeight(); | |
636 return FloatSize(floatValueForLength(intrinsicWidth, 0), floatValueForLe
ngth(intrinsicHeight, 0)); | |
637 } | |
638 | |
639 if (!renderer()) | 633 if (!renderer()) |
640 return FloatSize(); | 634 return FloatSize(); |
641 | 635 |
642 if (renderer()->isSVGRoot()) { | 636 if (renderer()->isSVGRoot()) { |
643 LayoutRect contentBoxRect = toRenderSVGRoot(renderer())->contentBoxRect(
); | 637 LayoutRect contentBoxRect = toRenderSVGRoot(renderer())->contentBoxRect(
); |
644 return FloatSize(contentBoxRect.width() / renderer()->style()->effective
Zoom(), contentBoxRect.height() / renderer()->style()->effectiveZoom()); | 638 return FloatSize(contentBoxRect.width() / renderer()->style()->effective
Zoom(), contentBoxRect.height() / renderer()->style()->effectiveZoom()); |
645 } | 639 } |
646 | 640 |
647 FloatRect viewportRect = toRenderSVGViewportContainer(renderer())->viewport(
); | 641 FloatRect viewportRect = toRenderSVGViewportContainer(renderer())->viewport(
); |
648 return FloatSize(viewportRect.width(), viewportRect.height()); | 642 return FloatSize(viewportRect.width(), viewportRect.height()); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 } | 775 } |
782 | 776 |
783 void SVGSVGElement::trace(Visitor* visitor) | 777 void SVGSVGElement::trace(Visitor* visitor) |
784 { | 778 { |
785 visitor->trace(m_timeContainer); | 779 visitor->trace(m_timeContainer); |
786 visitor->trace(m_viewSpec); | 780 visitor->trace(m_viewSpec); |
787 SVGGraphicsElement::trace(visitor); | 781 SVGGraphicsElement::trace(visitor); |
788 } | 782 } |
789 | 783 |
790 } | 784 } |
OLD | NEW |