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

Unified Diff: Source/core/html/HTMLImageElement.h

Issue 369423002: Have srcset respond to viewport changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Self review nits Created 6 years, 5 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/html/HTMLImageElement.h
diff --git a/Source/core/html/HTMLImageElement.h b/Source/core/html/HTMLImageElement.h
index c5a9530318de0e8571e8af2d0540426365c39382..9d2608f98b549f9efdc2a1130d82b6b7c4f827b1 100644
--- a/Source/core/html/HTMLImageElement.h
+++ b/Source/core/html/HTMLImageElement.h
@@ -34,9 +34,12 @@ namespace blink {
class HTMLFormElement;
class ImageCandidate;
+class MediaQueryList;
class HTMLImageElement FINAL : public HTMLElement, public CanvasImageSource {
public:
+ class Listener;
+
static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&);
static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&, HTMLFormElement*, bool createdByParser);
static PassRefPtrWillBeRawPtr<HTMLImageElement> createForJSConstructor(Document&, int width, int height);
@@ -129,6 +132,8 @@ private:
ImageCandidate findBestFitImageFromPictureParent();
void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&);
HTMLImageLoader& imageLoader() const { return *m_imageLoader; }
+ void notifyViewportChanged();
+ void createMediaQueryListIfDoesNotExist();
OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader;
#if ENABLE(OILPAN)
@@ -141,6 +146,11 @@ private:
float m_imageDevicePixelRatio;
bool m_formWasSetByParser;
bool m_elementCreatedByParser;
+ // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for the picked resource.
+ bool m_intrinsicSizingViewportDependant;
+ // Effective size is viewport dependant if the sizes attribute's effective size used v* length units.
+ bool m_effectiveSizeViewportDependant;
+ RefPtrWillBeMember<Listener> m_listener;
};
} //namespace

Powered by Google App Engine
This is Rietveld 408576698