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

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

Issue 2320463002: [SPV2] Implement the blink-side scroll property tree (Closed)
Patch Set: Update comment to not refer to hit testing, switch to IntSizes 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
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:

Powered by Google App Engine
This is Rietveld 408576698