OLD | NEW |
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 virtual bool isOpaque() const override; | 102 virtual bool isOpaque() const override; |
103 | 103 |
104 // public so that HTMLPictureElement can call this as well. | 104 // public so that HTMLPictureElement can call this as well. |
105 void selectSourceURL(ImageLoader::UpdateFromElementBehavior); | 105 void selectSourceURL(ImageLoader::UpdateFromElementBehavior); |
106 void reattachFallbackContent(); | 106 void reattachFallbackContent(); |
107 void setUseFallbackContent(); | 107 void setUseFallbackContent(); |
108 void setIsFallbackImage() { m_isFallbackImage = true; } | 108 void setIsFallbackImage() { m_isFallbackImage = true; } |
109 | 109 |
110 float sourceSize(Element&); | 110 float sourceSize(Element&); |
111 | 111 |
| 112 HTMLImageLoader& imageLoader() const { return *m_imageLoader; } |
| 113 |
112 protected: | 114 protected: |
113 explicit HTMLImageElement(Document&, HTMLFormElement* = 0, bool createdByPar
ser = false); | 115 explicit HTMLImageElement(Document&, HTMLFormElement* = 0, bool createdByPar
ser = false); |
114 | 116 |
115 virtual void didMoveToNewDocument(Document& oldDocument) override; | 117 virtual void didMoveToNewDocument(Document& oldDocument) override; |
116 virtual bool useFallbackContent() const { return m_useFallbackContent; } | 118 virtual bool useFallbackContent() const { return m_useFallbackContent; } |
117 | 119 |
118 virtual void didAddUserAgentShadowRoot(ShadowRoot&) override; | 120 virtual void didAddUserAgentShadowRoot(ShadowRoot&) override; |
119 virtual PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; | 121 virtual PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; |
120 private: | 122 private: |
121 virtual bool areAuthorShadowsAllowed() const override { return false; } | 123 virtual bool areAuthorShadowsAllowed() const override { return false; } |
(...skipping 16 matching lines...) Expand all Loading... |
138 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; | 140 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
139 virtual void removedFrom(ContainerNode*) override; | 141 virtual void removedFrom(ContainerNode*) override; |
140 virtual bool shouldRegisterAsNamedItem() const override { return true; } | 142 virtual bool shouldRegisterAsNamedItem() const override { return true; } |
141 virtual bool shouldRegisterAsExtraNamedItem() const override { return true;
} | 143 virtual bool shouldRegisterAsExtraNamedItem() const override { return true;
} |
142 virtual bool isInteractiveContent() const override; | 144 virtual bool isInteractiveContent() const override; |
143 virtual Image* imageContents() override; | 145 virtual Image* imageContents() override; |
144 | 146 |
145 void resetFormOwner(); | 147 void resetFormOwner(); |
146 ImageCandidate findBestFitImageFromPictureParent(); | 148 ImageCandidate findBestFitImageFromPictureParent(); |
147 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); | 149 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); |
148 HTMLImageLoader& imageLoader() const { return *m_imageLoader; } | |
149 void notifyViewportChanged(); | 150 void notifyViewportChanged(); |
150 void createMediaQueryListIfDoesNotExist(); | 151 void createMediaQueryListIfDoesNotExist(); |
151 | 152 |
152 OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader; | 153 OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader; |
153 RefPtrWillBeMember<ViewportChangeListener> m_listener; | 154 RefPtrWillBeMember<ViewportChangeListener> m_listener; |
154 #if ENABLE(OILPAN) | 155 #if ENABLE(OILPAN) |
155 Member<HTMLFormElement> m_form; | 156 Member<HTMLFormElement> m_form; |
156 #else | 157 #else |
157 WeakPtr<HTMLFormElement> m_form; | 158 WeakPtr<HTMLFormElement> m_form; |
158 #endif | 159 #endif |
159 AtomicString m_bestFitImageURL; | 160 AtomicString m_bestFitImageURL; |
160 float m_imageDevicePixelRatio; | 161 float m_imageDevicePixelRatio; |
161 unsigned m_formWasSetByParser : 1; | 162 unsigned m_formWasSetByParser : 1; |
162 unsigned m_elementCreatedByParser : 1; | 163 unsigned m_elementCreatedByParser : 1; |
163 // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for
the picked resource. | 164 // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for
the picked resource. |
164 unsigned m_intrinsicSizingViewportDependant : 1; | 165 unsigned m_intrinsicSizingViewportDependant : 1; |
165 unsigned m_useFallbackContent : 1; | 166 unsigned m_useFallbackContent : 1; |
166 unsigned m_isFallbackImage : 1; | 167 unsigned m_isFallbackImage : 1; |
167 }; | 168 }; |
168 | 169 |
169 } // namespace blink | 170 } // namespace blink |
170 | 171 |
171 #endif // HTMLImageElement_h | 172 #endif // HTMLImageElement_h |
OLD | NEW |