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

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: Drop calculate prefix from concreteObjectSize member function Created 4 years, 10 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..f28bef72d82cfdf99b8b27ea925de8edf521c656 100644
--- a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
+++ b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
@@ -91,9 +91,15 @@ 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.)
Yoav Weiss 2016/03/07 11:16:07 Could you point to a spec indicating that this is
davve 2016/03/07 13:07:38 https://drafts.csswg.org/css-images-3/#the-image-o
+ return m_image->imageSize(DoNotRespectImageOrientation, multiplier);
}
bool StyleFetchedImage::imageHasRelativeSize() const

Powered by Google App Engine
This is Rietveld 408576698