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

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

Issue 1756763004: Merge image sizing algorithms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unused variable 'styleImage' in release Created 4 years, 9 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/SVGImage.h
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
index 8fc42e64726025c49c2f856a2a60da73618ad478..903b9a84383b2ed65e2fca9774bc07511c74b01d 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
@@ -55,7 +55,7 @@ public:
bool isSVGImage() const override { return true; }
bool isTextureBacked() override { return false; }
- IntSize size() const override { return m_concreteObjectSize; }
+ IntSize size() const override { return m_intrinsicSize; }
bool currentFrameHasSingleSecurityOrigin() const override;
@@ -77,6 +77,8 @@ public:
void updateUseCounters(Document&) const;
+ FloatSize concreteObjectSize(const FloatSize&) const;
+
// DisplayItemClient methods.
String debugName() const final { return "SVGImage"; }
LayoutRect visualRect() const override;
@@ -90,7 +92,6 @@ private:
String filenameExtension() const override;
- FloatSize calculateConcreteObjectSize(const FloatSize&) const;
IntSize containerSize() const;
bool usesContainerSize() const override { return true; }
void computeIntrinsicDimensions(FloatSize& intrinsicSize, FloatSize& intrinsicRatio) override;
@@ -116,18 +117,13 @@ private:
OwnPtrWillBePersistent<SVGImageChromeClient> m_chromeClient;
OwnPtrWillBePersistent<Page> m_page;
- // "The concrete object size is the result of combining an
- // object’s intrinsic dimensions and specified size with the
- // default object size of the context it’s used in, producing a
- // rectangle with a definite width and height."
- //
- // https://drafts.csswg.org/css-images-3/#concrete-object-size
- //
- // Note: For SVGImage there are no specified size
- // constraints. Such constraints are handled by the layout
- // machinery in LayoutReplaced. An image has only intrinsic size,
- // aspect ratio and default object size to consider.
- IntSize m_concreteObjectSize;
+ // When an SVG image has no intrinsic size the size depends on the
+ // default object size, which in turn depends on the
+ // container. SVGImage may belong to multiple containers so the
+ // final image size can't be known in
+ // SVGImage. SVGImageForContainer carried the final image size,
+ // also called concrete object size.
+ IntSize m_intrinsicSize;
};
DEFINE_IMAGE_TYPE_CASTS(SVGImage);
« no previous file with comments | « third_party/WebKit/Source/core/style/StylePendingImage.h ('k') | third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698