| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
| 3 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // draw the image. Because a single SVGImage can be referenced by multiple | 50 // draw the image. Because a single SVGImage can be referenced by multiple |
| 51 // containers (see: SVGImageForContainer.h), each call to SVGImage::draw() may | 51 // containers (see: SVGImageForContainer.h), each call to SVGImage::draw() may |
| 52 // require (re-)laying out the inner SVGDocument. | 52 // require (re-)laying out the inner SVGDocument. |
| 53 // | 53 // |
| 54 // Using Page was an architectural hack and has surprising side-effects. Ideally | 54 // Using Page was an architectural hack and has surprising side-effects. Ideally |
| 55 // SVGImage would use a lighter container around an SVGDocument that does not | 55 // SVGImage would use a lighter container around an SVGDocument that does not |
| 56 // have the full Page machinery but still has the sandboxing security guarantees | 56 // have the full Page machinery but still has the sandboxing security guarantees |
| 57 // needed by SVGImage. | 57 // needed by SVGImage. |
| 58 class CORE_EXPORT SVGImage final : public Image { | 58 class CORE_EXPORT SVGImage final : public Image { |
| 59 public: | 59 public: |
| 60 static PassRefPtr<SVGImage> Create(ImageObserver* observer) { | 60 static PassRefPtr<SVGImage> Create(ImageObserver* observer, |
| 61 return AdoptRef(new SVGImage(observer)); | 61 bool is_multipart = false) { |
| 62 return AdoptRef(new SVGImage(observer, is_multipart)); |
| 62 } | 63 } |
| 63 | 64 |
| 64 static bool IsInSVGImage(const Node*); | 65 static bool IsInSVGImage(const Node*); |
| 65 | 66 |
| 66 LayoutReplaced* EmbeddedReplacedContent() const; | 67 LayoutReplaced* EmbeddedReplacedContent() const; |
| 67 | 68 |
| 68 bool IsSVGImage() const override { return true; } | 69 bool IsSVGImage() const override { return true; } |
| 69 IntSize Size() const override { return intrinsic_size_; } | 70 IntSize Size() const override { return intrinsic_size_; } |
| 70 | 71 |
| 71 void CheckLoaded() const; | 72 void CheckLoaded() const; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 98 | 99 |
| 99 bool HasIntrinsicDimensions() const; | 100 bool HasIntrinsicDimensions() const; |
| 100 | 101 |
| 101 private: | 102 private: |
| 102 // Accesses m_page. | 103 // Accesses m_page. |
| 103 friend class SVGImageChromeClient; | 104 friend class SVGImageChromeClient; |
| 104 // Forwards calls to the various *ForContainer methods and other parts of | 105 // Forwards calls to the various *ForContainer methods and other parts of |
| 105 // the the Image interface. | 106 // the the Image interface. |
| 106 friend class SVGImageForContainer; | 107 friend class SVGImageForContainer; |
| 107 | 108 |
| 108 SVGImage(ImageObserver*); | 109 SVGImage(ImageObserver*, bool is_multipart); |
| 109 ~SVGImage() override; | 110 ~SVGImage() override; |
| 110 | 111 |
| 111 String FilenameExtension() const override; | 112 String FilenameExtension() const override; |
| 112 | 113 |
| 113 IntSize ContainerSize() const; | 114 IntSize ContainerSize() const; |
| 114 bool UsesContainerSize() const override { return true; } | 115 bool UsesContainerSize() const override { return true; } |
| 115 | 116 |
| 116 SizeAvailability DataChanged(bool all_data_received) override; | 117 SizeAvailability DataChanged(bool all_data_received) override; |
| 117 | 118 |
| 118 // FIXME: SVGImages are underreporting decoded sizes and will be unable | 119 // FIXME: SVGImages are underreporting decoded sizes and will be unable |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 229 |
| 229 ~ImageObserverDisabler() { image_->SetImageObserverDisabled(false); } | 230 ~ImageObserverDisabler() { image_->SetImageObserverDisabled(false); } |
| 230 | 231 |
| 231 private: | 232 private: |
| 232 Image* image_; | 233 Image* image_; |
| 233 }; | 234 }; |
| 234 | 235 |
| 235 } // namespace blink | 236 } // namespace blink |
| 236 | 237 |
| 237 #endif // SVGImage_h | 238 #endif // SVGImage_h |
| OLD | NEW |