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 14 matching lines...) Expand all Loading... |
25 #define HTMLImageElement_h | 25 #define HTMLImageElement_h |
26 | 26 |
27 #include "bindings/core/v8/ActiveScriptWrappable.h" | 27 #include "bindings/core/v8/ActiveScriptWrappable.h" |
28 #include "core/CoreExport.h" | 28 #include "core/CoreExport.h" |
29 #include "core/html/FormAssociated.h" | 29 #include "core/html/FormAssociated.h" |
30 #include "core/html/HTMLElement.h" | 30 #include "core/html/HTMLElement.h" |
31 #include "core/html/HTMLImageLoader.h" | 31 #include "core/html/HTMLImageLoader.h" |
32 #include "core/html/canvas/CanvasImageElementSource.h" | 32 #include "core/html/canvas/CanvasImageElementSource.h" |
33 #include "core/imagebitmap/ImageBitmapSource.h" | 33 #include "core/imagebitmap/ImageBitmapSource.h" |
34 #include "platform/graphics/GraphicsTypes.h" | 34 #include "platform/graphics/GraphicsTypes.h" |
| 35 #include "platform/heap/HeapAllocator.h" |
35 #include "platform/loader/fetch/FetchRequest.h" | 36 #include "platform/loader/fetch/FetchRequest.h" |
36 #include "platform/loader/fetch/ResourceResponse.h" | 37 #include "platform/loader/fetch/ResourceResponse.h" |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 class HTMLFormElement; | 41 class HTMLFormElement; |
41 class ImageCandidate; | 42 class ImageCandidate; |
42 class ShadowRoot; | 43 class ShadowRoot; |
43 class ImageBitmapOptions; | 44 class ImageBitmapOptions; |
44 | 45 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void setHeight(unsigned); | 93 void setHeight(unsigned); |
93 | 94 |
94 KURL src() const; | 95 KURL src() const; |
95 void setSrc(const String&); | 96 void setSrc(const String&); |
96 | 97 |
97 void setWidth(unsigned); | 98 void setWidth(unsigned); |
98 | 99 |
99 int x() const; | 100 int x() const; |
100 int y() const; | 101 int y() const; |
101 | 102 |
| 103 ScriptPromise decode(ScriptState*, ExceptionState&); |
| 104 |
102 bool complete() const; | 105 bool complete() const; |
103 | 106 |
104 bool hasPendingActivity() const final { | 107 bool hasPendingActivity() const final { |
105 return imageLoader().hasPendingActivity(); | 108 return imageLoader().hasPendingActivity(); |
106 } | 109 } |
107 | 110 |
108 bool canContainRangeEndPoint() const override { return false; } | 111 bool canContainRangeEndPoint() const override { return false; } |
109 | 112 |
110 const AtomicString imageSourceURL() const override; | 113 const AtomicString imageSourceURL() const override; |
111 | 114 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 }; | 162 }; |
160 | 163 |
161 explicit HTMLImageElement(Document&, | 164 explicit HTMLImageElement(Document&, |
162 bool createdByParser = false); | 165 bool createdByParser = false); |
163 | 166 |
164 void didMoveToNewDocument(Document& oldDocument) override; | 167 void didMoveToNewDocument(Document& oldDocument) override; |
165 | 168 |
166 void didAddUserAgentShadowRoot(ShadowRoot&) override; | 169 void didAddUserAgentShadowRoot(ShadowRoot&) override; |
167 PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; | 170 PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; |
168 | 171 |
| 172 void defaultEventHandler(Event*) override; |
| 173 |
169 private: | 174 private: |
170 bool areAuthorShadowsAllowed() const override { return false; } | 175 bool areAuthorShadowsAllowed() const override { return false; } |
171 | 176 |
172 void parseAttribute(const AttributeModificationParams&) override; | 177 void parseAttribute(const AttributeModificationParams&) override; |
173 bool isPresentationAttribute(const QualifiedName&) const override; | 178 bool isPresentationAttribute(const QualifiedName&) const override; |
174 void collectStyleForPresentationAttribute(const QualifiedName&, | 179 void collectStyleForPresentationAttribute(const QualifiedName&, |
175 const AtomicString&, | 180 const AtomicString&, |
176 MutableStylePropertySet*) override; | 181 MutableStylePropertySet*) override; |
177 void setLayoutDisposition(LayoutDisposition, bool forceReattach = false); | 182 void setLayoutDisposition(LayoutDisposition, bool forceReattach = false); |
178 | 183 |
(...skipping 15 matching lines...) Expand all Loading... |
194 bool isInteractiveContent() const override; | 199 bool isInteractiveContent() const override; |
195 Image* imageContents() override; | 200 Image* imageContents() override; |
196 | 201 |
197 void resetFormOwner(); | 202 void resetFormOwner(); |
198 ImageCandidate findBestFitImageFromPictureParent(); | 203 ImageCandidate findBestFitImageFromPictureParent(); |
199 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); | 204 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); |
200 HTMLImageLoader& imageLoader() const override { return *m_imageLoader; } | 205 HTMLImageLoader& imageLoader() const override { return *m_imageLoader; } |
201 void notifyViewportChanged(); | 206 void notifyViewportChanged(); |
202 void createMediaQueryListIfDoesNotExist(); | 207 void createMediaQueryListIfDoesNotExist(); |
203 | 208 |
| 209 void requestDecode(); |
| 210 void didDecode(bool success); |
| 211 |
204 Member<HTMLImageLoader> m_imageLoader; | 212 Member<HTMLImageLoader> m_imageLoader; |
205 Member<ViewportChangeListener> m_listener; | 213 Member<ViewportChangeListener> m_listener; |
206 Member<HTMLFormElement> m_form; | 214 Member<HTMLFormElement> m_form; |
207 AtomicString m_bestFitImageURL; | 215 AtomicString m_bestFitImageURL; |
208 float m_imageDevicePixelRatio; | 216 float m_imageDevicePixelRatio; |
209 Member<HTMLSourceElement> m_source; | 217 Member<HTMLSourceElement> m_source; |
210 LayoutDisposition m_layoutDisposition; | 218 LayoutDisposition m_layoutDisposition; |
211 unsigned m_formWasSetByParser : 1; | 219 unsigned m_formWasSetByParser : 1; |
212 unsigned m_elementCreatedByParser : 1; | 220 unsigned m_elementCreatedByParser : 1; |
213 unsigned m_isFallbackImage : 1; | 221 unsigned m_isFallbackImage : 1; |
| 222 HeapVector<Member<ScriptPromiseResolver>> m_decodePromiseResolvers; |
214 | 223 |
215 ReferrerPolicy m_referrerPolicy; | 224 ReferrerPolicy m_referrerPolicy; |
| 225 |
| 226 WTF::WeakPtrFactory<HTMLImageElement> m_weakPtrFactory; |
216 }; | 227 }; |
217 | 228 |
218 } // namespace blink | 229 } // namespace blink |
219 | 230 |
220 #endif // HTMLImageElement_h | 231 #endif // HTMLImageElement_h |
OLD | NEW |