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

Unified Diff: third_party/WebKit/Source/core/style/StyleFetchedImage.cpp

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/style/StyleFetchedImage.cpp
diff --git a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
index f2e15b31e4c114262515a4a8c346468200ea4352..3dfacbd6043a4a9f5cd6f662cfb705038f5513f0 100644
--- a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
+++ b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
@@ -91,9 +91,17 @@ bool StyleFetchedImage::errorOccurred() const
return m_image->errorOccurred();
}
-LayoutSize StyleFetchedImage::imageSize(const LayoutObject* layoutObject, float multiplier) const
+LayoutSize StyleFetchedImage::imageSize(const LayoutObject* layoutObject, float multiplier, const LayoutSize& defaultObjectSize) const
{
- return m_image->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject), multiplier);
+ if (m_image->image() && m_image->image()->isSVGImage())
+ return imageSizeForSVGImage(toSVGImage(m_image->image()), multiplier, defaultObjectSize);
+
+ // Image orientation should only be respected for content images,
+ // not decorative images such as StyleImage (backgrounds,
+ // border-image, etc.)
+ //
+ // https://drafts.csswg.org/css-images-3/#the-image-orientation
+ return m_image->imageSize(DoNotRespectImageOrientation, multiplier);
}
bool StyleFetchedImage::imageHasRelativeSize() const
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleFetchedImage.h ('k') | third_party/WebKit/Source/core/style/StyleFetchedImageSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698