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

Side by Side 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: review comments 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2008, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2008, 2010 Apple Inc. All rights reserved.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 16 matching lines...) Expand all
27 #include "core/html/HTMLElement.h" 27 #include "core/html/HTMLElement.h"
28 #include "core/html/HTMLImageLoader.h" 28 #include "core/html/HTMLImageLoader.h"
29 #include "core/html/canvas/CanvasImageSource.h" 29 #include "core/html/canvas/CanvasImageSource.h"
30 #include "platform/graphics/GraphicsTypes.h" 30 #include "platform/graphics/GraphicsTypes.h"
31 #include "wtf/WeakPtr.h" 31 #include "wtf/WeakPtr.h"
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 class HTMLFormElement; 35 class HTMLFormElement;
36 class ImageCandidate; 36 class ImageCandidate;
37 class MediaQueryList;
37 38
38 class HTMLImageElement FINAL : public HTMLElement, public CanvasImageSource { 39 class HTMLImageElement FINAL : public HTMLElement, public CanvasImageSource {
39 public: 40 public:
41 class Listener;
42
40 static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&); 43 static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&);
41 static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&, HTMLFormEl ement*, bool createdByParser); 44 static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&, HTMLFormEl ement*, bool createdByParser);
42 static PassRefPtrWillBeRawPtr<HTMLImageElement> createForJSConstructor(Docum ent&, int width, int height); 45 static PassRefPtrWillBeRawPtr<HTMLImageElement> createForJSConstructor(Docum ent&, int width, int height);
43 46
44 virtual ~HTMLImageElement(); 47 virtual ~HTMLImageElement();
45 virtual void trace(Visitor*) OVERRIDE; 48 virtual void trace(Visitor*) OVERRIDE;
46 49
47 int width(bool ignorePendingStylesheets = false); 50 int width(bool ignorePendingStylesheets = false);
48 int height(bool ignorePendingStylesheets = false); 51 int height(bool ignorePendingStylesheets = false);
49 52
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 virtual void removedFrom(ContainerNode*) OVERRIDE; 125 virtual void removedFrom(ContainerNode*) OVERRIDE;
123 virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; } 126 virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; }
124 virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return true; } 127 virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return true; }
125 virtual bool isInteractiveContent() const OVERRIDE; 128 virtual bool isInteractiveContent() const OVERRIDE;
126 virtual Image* imageContents() OVERRIDE; 129 virtual Image* imageContents() OVERRIDE;
127 130
128 void resetFormOwner(); 131 void resetFormOwner();
129 ImageCandidate findBestFitImageFromPictureParent(); 132 ImageCandidate findBestFitImageFromPictureParent();
130 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); 133 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&);
131 HTMLImageLoader& imageLoader() const { return *m_imageLoader; } 134 HTMLImageLoader& imageLoader() const { return *m_imageLoader; }
135 void notifyMediaQueryChanged();
136 void createMediaQueryListIfDoesNotExist();
132 137
133 OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader; 138 OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader;
134 #if ENABLE(OILPAN) 139 #if ENABLE(OILPAN)
135 Member<HTMLFormElement> m_form; 140 Member<HTMLFormElement> m_form;
136 #else 141 #else
137 WeakPtr<HTMLFormElement> m_form; 142 WeakPtr<HTMLFormElement> m_form;
138 #endif 143 #endif
139 CompositeOperator m_compositeOperator; 144 CompositeOperator m_compositeOperator;
140 AtomicString m_bestFitImageURL; 145 AtomicString m_bestFitImageURL;
141 float m_imageDevicePixelRatio; 146 float m_imageDevicePixelRatio;
142 bool m_formWasSetByParser; 147 bool m_formWasSetByParser;
143 bool m_elementCreatedByParser; 148 bool m_elementCreatedByParser;
149 // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for the picked resource.
150 bool m_intrinsicSizingViewportDependant;
151 // Effective size is viewport dependant if the sizes attribute's effective s ize used v* length units.
152 bool m_effectiveSizeViewportDependant;
153 RefPtrWillBeMember<Listener> m_listener;
sof 2014/07/15 10:27:30 Whenever a traceable Member is added to a class, y
154 RefPtrWillBeMember<MediaQueryList> m_mediaQueryList;
144 }; 155 };
Yoav Weiss 2014/07/15 09:46:31 If the extra memory on HTMLImageElement is an issu
145 156
146 } //namespace 157 } //namespace
147 158
148 #endif 159 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698