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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h

Issue 2322803002: Document SVGImageForContainer with a class-level comment (Closed)
Patch Set: Reduce job security by making the comment even cleaner Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f7d1051f9d9845387d0f539d077ac839cc62eed3 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h
@@ -35,6 +35,25 @@
namespace blink {
+// SVGImageForContainer contains a reference to an SVGImage and includes context
+// about how the image is being used (size, fragment identifier).
+//
+// 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 containers of different sizes. Similarly, each
+// use of an image can have a different fragment identifier as part of its URL
+// (e.g., foo.svg#abc) which can influence rendering.
+//
+// For example, the following would create three SVGImageForContainers
+// referencing a single SVGImage for 'foo.svg':
+// <img src='foo.svg#a' width='20'>
+// <img src='foo.svg#a' width='10'>
+// <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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698