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

Side by Side Diff: Source/core/svg/graphics/SVGImageForContainer.h

Issue 180973005: Respect SVG fragment identifiers in <img> src attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove include Created 6 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef SVGImageForContainer_h 26 #ifndef SVGImageForContainer_h
27 #define SVGImageForContainer_h 27 #define SVGImageForContainer_h
28 28
29 #include "core/svg/graphics/SVGImage.h" 29 #include "core/svg/graphics/SVGImage.h"
30 #include "platform/geometry/FloatRect.h" 30 #include "platform/geometry/FloatRect.h"
31 #include "platform/geometry/FloatSize.h" 31 #include "platform/geometry/FloatSize.h"
32 #include "platform/graphics/Image.h" 32 #include "platform/graphics/Image.h"
33 #include "platform/weborigin/KURL.h"
33 34
34 namespace WebCore { 35 namespace WebCore {
35 36
36 class SVGImageForContainer FINAL : public Image { 37 class SVGImageForContainer FINAL : public Image {
37 public: 38 public:
38 static PassRefPtr<SVGImageForContainer> create(SVGImage* image, const FloatS ize& containerSize, float zoom) 39 static PassRefPtr<SVGImageForContainer> create(SVGImage* image, const FloatS ize& containerSize, float zoom)
39 { 40 {
40 return adoptRef(new SVGImageForContainer(image, containerSize, zoom)); 41 return adoptRef(new SVGImageForContainer(image, containerSize, zoom));
41 } 42 }
42 43
43 virtual bool isSVGImage() const OVERRIDE { return true; } 44 virtual bool isSVGImage() const OVERRIDE { return true; }
44 45
45 virtual IntSize size() const OVERRIDE; 46 virtual IntSize size() const OVERRIDE;
47 void setURL(const KURL& url) { m_image->setURL(url); }
46 48
47 virtual bool usesContainerSize() const OVERRIDE { return m_image->usesContai nerSize(); } 49 virtual bool usesContainerSize() const OVERRIDE { return m_image->usesContai nerSize(); }
48 virtual bool hasRelativeWidth() const OVERRIDE { return m_image->hasRelative Width(); } 50 virtual bool hasRelativeWidth() const OVERRIDE { return m_image->hasRelative Width(); }
49 virtual bool hasRelativeHeight() const OVERRIDE { return m_image->hasRelativ eHeight(); } 51 virtual bool hasRelativeHeight() const OVERRIDE { return m_image->hasRelativ eHeight(); }
50 virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intr insicHeight, FloatSize& intrinsicRatio) OVERRIDE 52 virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intr insicHeight, FloatSize& intrinsicRatio) OVERRIDE
51 { 53 {
52 m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, int rinsicRatio); 54 m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, int rinsicRatio);
53 } 55 }
54 56
55 virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, Comp ositeOperator, blink::WebBlendMode) OVERRIDE; 57 virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, Comp ositeOperator, blink::WebBlendMode) OVERRIDE;
(...skipping 15 matching lines...) Expand all
71 73
72 virtual void destroyDecodedData(bool) OVERRIDE { } 74 virtual void destroyDecodedData(bool) OVERRIDE { }
73 75
74 SVGImage* m_image; 76 SVGImage* m_image;
75 const FloatSize m_containerSize; 77 const FloatSize m_containerSize;
76 const float m_zoom; 78 const float m_zoom;
77 }; 79 };
78 } 80 }
79 81
80 #endif // SVGImageForContainer_h 82 #endif // SVGImageForContainer_h
OLDNEW
« no previous file with comments | « Source/core/svg/graphics/SVGImageCache.cpp ('k') | Source/core/svg/graphics/SVGImageForContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698