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

Side by Side Diff: Source/core/svg/SVGSVGElement.cpp

Issue 464823003: [svg] getScreenCTM reporting incorrect transformation matrix. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « LayoutTests/fast/svg/getScreenCTM.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/svg/getScreenCTM.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698