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

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

Issue 921633007: Move the SVG container code from rendering/svg to layout/svg. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGGElement.cpp ('k') | Source/core/svg/SVGSwitchElement.cpp » ('j') | 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 20 matching lines...) Expand all
31 #include "core/dom/Document.h" 31 #include "core/dom/Document.h"
32 #include "core/dom/ElementTraversal.h" 32 #include "core/dom/ElementTraversal.h"
33 #include "core/dom/StaticNodeList.h" 33 #include "core/dom/StaticNodeList.h"
34 #include "core/editing/FrameSelection.h" 34 #include "core/editing/FrameSelection.h"
35 #include "core/events/EventListener.h" 35 #include "core/events/EventListener.h"
36 #include "core/frame/LocalFrame.h" 36 #include "core/frame/LocalFrame.h"
37 #include "core/page/FrameTree.h" 37 #include "core/page/FrameTree.h"
38 #include "core/frame/FrameView.h" 38 #include "core/frame/FrameView.h"
39 #include "core/frame/UseCounter.h" 39 #include "core/frame/UseCounter.h"
40 #include "core/layout/LayoutObject.h" 40 #include "core/layout/LayoutObject.h"
41 #include "core/layout/svg/LayoutSVGViewportContainer.h"
41 #include "core/rendering/svg/RenderSVGModelObject.h" 42 #include "core/rendering/svg/RenderSVGModelObject.h"
42 #include "core/rendering/svg/RenderSVGRoot.h" 43 #include "core/rendering/svg/RenderSVGRoot.h"
43 #include "core/rendering/svg/RenderSVGViewportContainer.h"
44 #include "core/svg/SVGAngleTearOff.h" 44 #include "core/svg/SVGAngleTearOff.h"
45 #include "core/svg/SVGNumberTearOff.h" 45 #include "core/svg/SVGNumberTearOff.h"
46 #include "core/svg/SVGPreserveAspectRatio.h" 46 #include "core/svg/SVGPreserveAspectRatio.h"
47 #include "core/svg/SVGRectTearOff.h" 47 #include "core/svg/SVGRectTearOff.h"
48 #include "core/svg/SVGTransform.h" 48 #include "core/svg/SVGTransform.h"
49 #include "core/svg/SVGTransformList.h" 49 #include "core/svg/SVGTransformList.h"
50 #include "core/svg/SVGTransformTearOff.h" 50 #include "core/svg/SVGTransformTearOff.h"
51 #include "core/svg/SVGViewElement.h" 51 #include "core/svg/SVGViewElement.h"
52 #include "core/svg/SVGViewSpec.h" 52 #include "core/svg/SVGViewSpec.h"
53 #include "core/svg/animation/SMILTimeContainer.h" 53 #include "core/svg/animation/SMILTimeContainer.h"
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 if (document().documentElement() == this) 516 if (document().documentElement() == this)
517 return true; 517 return true;
518 return Element::rendererIsNeeded(style); 518 return Element::rendererIsNeeded(style);
519 } 519 }
520 520
521 LayoutObject* SVGSVGElement::createRenderer(const LayoutStyle&) 521 LayoutObject* SVGSVGElement::createRenderer(const LayoutStyle&)
522 { 522 {
523 if (isOutermostSVGSVGElement()) 523 if (isOutermostSVGSVGElement())
524 return new RenderSVGRoot(this); 524 return new RenderSVGRoot(this);
525 525
526 return new RenderSVGViewportContainer(this); 526 return new LayoutSVGViewportContainer(this);
527 } 527 }
528 528
529 Node::InsertionNotificationRequest SVGSVGElement::insertedInto(ContainerNode* ro otParent) 529 Node::InsertionNotificationRequest SVGSVGElement::insertedInto(ContainerNode* ro otParent)
530 { 530 {
531 if (rootParent->inDocument()) { 531 if (rootParent->inDocument()) {
532 UseCounter::count(document(), UseCounter::SVGSVGElementInDocument); 532 UseCounter::count(document(), UseCounter::SVGSVGElementInDocument);
533 if (rootParent->document().isXMLDocument()) 533 if (rootParent->document().isXMLDocument())
534 UseCounter::count(document(), UseCounter::SVGSVGElementInXMLDocument ); 534 UseCounter::count(document(), UseCounter::SVGSVGElementInXMLDocument );
535 535
536 document().accessSVGExtensions().addTimeContainer(this); 536 document().accessSVGExtensions().addTimeContainer(this);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 FloatSize SVGSVGElement::currentViewportSize() const 614 FloatSize SVGSVGElement::currentViewportSize() const
615 { 615 {
616 if (!renderer()) 616 if (!renderer())
617 return FloatSize(); 617 return FloatSize();
618 618
619 if (renderer()->isSVGRoot()) { 619 if (renderer()->isSVGRoot()) {
620 LayoutRect contentBoxRect = toRenderSVGRoot(renderer())->contentBoxRect( ); 620 LayoutRect contentBoxRect = toRenderSVGRoot(renderer())->contentBoxRect( );
621 return FloatSize(contentBoxRect.width() / renderer()->style()->effective Zoom(), contentBoxRect.height() / renderer()->style()->effectiveZoom()); 621 return FloatSize(contentBoxRect.width() / renderer()->style()->effective Zoom(), contentBoxRect.height() / renderer()->style()->effectiveZoom());
622 } 622 }
623 623
624 FloatRect viewportRect = toRenderSVGViewportContainer(renderer())->viewport( ); 624 FloatRect viewportRect = toLayoutSVGViewportContainer(renderer())->viewport( );
625 return FloatSize(viewportRect.width(), viewportRect.height()); 625 return FloatSize(viewportRect.width(), viewportRect.height());
626 } 626 }
627 627
628 bool SVGSVGElement::hasIntrinsicWidth() const 628 bool SVGSVGElement::hasIntrinsicWidth() const
629 { 629 {
630 return width()->currentValue()->unitType() != LengthTypePercentage; 630 return width()->currentValue()->unitType() != LengthTypePercentage;
631 } 631 }
632 632
633 bool SVGSVGElement::hasIntrinsicHeight() const 633 bool SVGSVGElement::hasIntrinsicHeight() const
634 { 634 {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 visitor->trace(m_width); 771 visitor->trace(m_width);
772 visitor->trace(m_height); 772 visitor->trace(m_height);
773 visitor->trace(m_translation); 773 visitor->trace(m_translation);
774 visitor->trace(m_timeContainer); 774 visitor->trace(m_timeContainer);
775 visitor->trace(m_viewSpec); 775 visitor->trace(m_viewSpec);
776 SVGGraphicsElement::trace(visitor); 776 SVGGraphicsElement::trace(visitor);
777 SVGFitToViewBox::trace(visitor); 777 SVGFitToViewBox::trace(visitor);
778 } 778 }
779 779
780 } // namespace blink 780 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/SVGGElement.cpp ('k') | Source/core/svg/SVGSwitchElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698