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

Unified Diff: Source/core/rendering/RenderImage.h

Issue 25105004: Use srcset's resource pixel density to determine intrinsic size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cleantests
Patch Set: Fixed expected test results Created 7 years, 2 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: Source/core/rendering/RenderImage.h
diff --git a/Source/core/rendering/RenderImage.h b/Source/core/rendering/RenderImage.h
index 1204ea5ed79bd0ae5b6fd0ff4acbe8d51cfbfb96..3fceb431e9ac58555f553a038b7482f97abdbbaa 100644
--- a/Source/core/rendering/RenderImage.h
+++ b/Source/core/rendering/RenderImage.h
@@ -61,6 +61,9 @@ public:
String altText() const { return m_altText; }
+ inline void setIntrinsicSizeFactor(float factor) { m_intrinsicSizeFactor = factor; }
+ virtual LayoutSize intrinsicSize() const OVERRIDE;
+ LayoutSize unscaledIntrinsicSize() const;
pdr. 2013/10/11 05:17:33 Can we change this to something more descriptive?
Yoav Weiss 2013/10/11 07:22:32 I think (hope) this mechanism is not srcset specif
protected:
virtual bool needsPreferredWidthsRecalculation() const OVERRIDE FINAL;
virtual RenderBox* embeddedContentBox() const OVERRIDE FINAL;
@@ -101,6 +104,7 @@ private:
IntSize imageSizeForError(ImageResource*) const;
void imageDimensionsChanged(bool imageSizeChanged, const IntRect* = 0);
bool updateIntrinsicSizeIfNeeded(const LayoutSize&, bool imageSizeChanged);
+ virtual float intrinsicSizeFactor() const { return m_intrinsicSizeFactor; }
// Update the size of the image to be rendered. Object-fit may cause this to be different from the CSS box's content rect.
void updateInnerContentRect();
@@ -112,6 +116,7 @@ private:
bool m_needsToSetSizeForAltText;
bool m_didIncrementVisuallyNonEmptyPixelCount;
bool m_isGeneratedContent;
+ float m_intrinsicSizeFactor;
friend class RenderImageScaleObserver;
};

Powered by Google App Engine
This is Rietveld 408576698