Chromium Code Reviews| Index: third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h |
| diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h b/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h |
| index 694783e33c8c53a1b9047192de0eb85e0f923d51..ce0b53961d663155a5abb2ac4a993f9624b2b99b 100644 |
| --- a/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h |
| +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h |
| @@ -35,6 +35,23 @@ |
| namespace blink { |
| +// SVGImageForContainer contains a reference to an Image (SVGImage*) and |
|
chrishtr
2016/09/08 20:43:59
Why add these comments in this patch?
pdr.
2016/09/08 23:16:26
Oops, this was from https://codereview.chromium.or
|
| +// includes context about the location where the image is used. |
| +// |
| +// The concrete size of an SVG image is calculated based on the image itself and |
| +// the dimensions where the image is used (see: SVGImage::concreteObjectSize). |
| +// This concrete size cannot be stored on the SVGImage itself because only a |
| +// single SVGImage is created per svg image resource, but this SVGImage can |
| +// be referenced multiple times by different container sizes. Similarly, each |
| +// use of an image can contain a different fragment url (foo.svg#abc) which |
| +// can render differently. |
| +// |
| +// For example, the following would create two SVGImageForContainers referencing |
| +// a single SVGImage for 'foo.svg': |
| +// <img src='foo.svg#a' width='20'><img src='foo.svg#b' width='10'> |
| +// |
| +// SVGImageForContainer stores this per-use information and delegates to the |
| +// SVGImage for how to draw the image. |
| class SVGImageForContainer final : public Image { |
| USING_FAST_MALLOC(SVGImageForContainer); |
| public: |