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

Side by Side Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 933953003: Move the remaining rendering/svg/RenderSVG* files to layout. (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/SVGStopElement.cpp ('k') | WATCHLISTS » ('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) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 18 matching lines...) Expand all
29 29
30 #include "core/svg/graphics/SVGImage.h" 30 #include "core/svg/graphics/SVGImage.h"
31 31
32 #include "core/animation/AnimationTimeline.h" 32 #include "core/animation/AnimationTimeline.h"
33 #include "core/dom/NodeTraversal.h" 33 #include "core/dom/NodeTraversal.h"
34 #include "core/dom/shadow/ComposedTreeTraversal.h" 34 #include "core/dom/shadow/ComposedTreeTraversal.h"
35 #include "core/frame/FrameView.h" 35 #include "core/frame/FrameView.h"
36 #include "core/frame/LocalFrame.h" 36 #include "core/frame/LocalFrame.h"
37 #include "core/frame/Settings.h" 37 #include "core/frame/Settings.h"
38 #include "core/layout/style/LayoutStyle.h" 38 #include "core/layout/style/LayoutStyle.h"
39 #include "core/layout/svg/LayoutSVGRoot.h"
39 #include "core/loader/FrameLoadRequest.h" 40 #include "core/loader/FrameLoadRequest.h"
40 #include "core/page/Chrome.h" 41 #include "core/page/Chrome.h"
41 #include "core/paint/CompositingRecorder.h" 42 #include "core/paint/CompositingRecorder.h"
42 #include "core/paint/FloatClipRecorder.h" 43 #include "core/paint/FloatClipRecorder.h"
43 #include "core/paint/TransformRecorder.h" 44 #include "core/paint/TransformRecorder.h"
44 #include "core/rendering/svg/RenderSVGRoot.h"
45 #include "core/svg/SVGDocumentExtensions.h" 45 #include "core/svg/SVGDocumentExtensions.h"
46 #include "core/svg/SVGFEImageElement.h" 46 #include "core/svg/SVGFEImageElement.h"
47 #include "core/svg/SVGImageElement.h" 47 #include "core/svg/SVGImageElement.h"
48 #include "core/svg/SVGSVGElement.h" 48 #include "core/svg/SVGSVGElement.h"
49 #include "core/svg/animation/SMILTimeContainer.h" 49 #include "core/svg/animation/SMILTimeContainer.h"
50 #include "core/svg/graphics/SVGImageChromeClient.h" 50 #include "core/svg/graphics/SVGImageChromeClient.h"
51 #include "platform/EventDispatchForbiddenScope.h" 51 #include "platform/EventDispatchForbiddenScope.h"
52 #include "platform/LengthFunctions.h" 52 #include "platform/LengthFunctions.h"
53 #include "platform/TraceEvent.h" 53 #include "platform/TraceEvent.h"
54 #include "platform/geometry/IntRect.h" 54 #include "platform/geometry/IntRect.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 if (!usesContainerSize()) 136 if (!usesContainerSize())
137 return; 137 return;
138 138
139 SVGSVGElement* rootElement = svgRootElement(m_page.get()); 139 SVGSVGElement* rootElement = svgRootElement(m_page.get());
140 if (!rootElement) 140 if (!rootElement)
141 return; 141 return;
142 142
143 FrameView* view = frameView(); 143 FrameView* view = frameView();
144 view->resize(this->containerSize()); 144 view->resize(this->containerSize());
145 145
146 RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer()); 146 LayoutSVGRoot* renderer = toLayoutSVGRoot(rootElement->renderer());
147 if (!renderer) 147 if (!renderer)
148 return; 148 return;
149 renderer->setContainerSize(size); 149 renderer->setContainerSize(size);
150 } 150 }
151 151
152 IntSize SVGImage::containerSize() const 152 IntSize SVGImage::containerSize() const
153 { 153 {
154 SVGSVGElement* rootElement = svgRootElement(m_page.get()); 154 SVGSVGElement* rootElement = svgRootElement(m_page.get());
155 if (!rootElement) 155 if (!rootElement)
156 return IntSize(); 156 return IntSize();
157 157
158 RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer()); 158 LayoutSVGRoot* renderer = toLayoutSVGRoot(rootElement->renderer());
159 if (!renderer) 159 if (!renderer)
160 return IntSize(); 160 return IntSize();
161 161
162 // If a container size is available it has precedence. 162 // If a container size is available it has precedence.
163 IntSize containerSize = renderer->containerSize(); 163 IntSize containerSize = renderer->containerSize();
164 if (!containerSize.isEmpty()) 164 if (!containerSize.isEmpty())
165 return containerSize; 165 return containerSize;
166 166
167 // Assure that a container size is always given for a non-identity zoom leve l. 167 // Assure that a container size is always given for a non-identity zoom leve l.
168 ASSERT(renderer->style()->effectiveZoom() == 1); 168 ASSERT(renderer->style()->effectiveZoom() == 1);
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 462
463 return m_page; 463 return m_page;
464 } 464 }
465 465
466 String SVGImage::filenameExtension() const 466 String SVGImage::filenameExtension() const
467 { 467 {
468 return "svg"; 468 return "svg";
469 } 469 }
470 470
471 } 471 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGStopElement.cpp ('k') | WATCHLISTS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698