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/CanvasImageSource.h" | 32 #include "core/html/canvas/CanvasImageSource.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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 }; | 173 }; |
171 | 174 |
172 explicit HTMLImageElement(Document&, | 175 explicit HTMLImageElement(Document&, |
173 bool createdByParser = false); | 176 bool createdByParser = false); |
174 | 177 |
175 void didMoveToNewDocument(Document& oldDocument) override; | 178 void didMoveToNewDocument(Document& oldDocument) override; |
176 | 179 |
177 void didAddUserAgentShadowRoot(ShadowRoot&) override; | 180 void didAddUserAgentShadowRoot(ShadowRoot&) override; |
178 PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; | 181 PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; |
179 | 182 |
| 183 void defaultEventHandler(Event*) override; |
| 184 |
180 private: | 185 private: |
181 bool areAuthorShadowsAllowed() const override { return false; } | 186 bool areAuthorShadowsAllowed() const override { return false; } |
182 | 187 |
183 void parseAttribute(const AttributeModificationParams&) override; | 188 void parseAttribute(const AttributeModificationParams&) override; |
184 bool isPresentationAttribute(const QualifiedName&) const override; | 189 bool isPresentationAttribute(const QualifiedName&) const override; |
185 void collectStyleForPresentationAttribute(const QualifiedName&, | 190 void collectStyleForPresentationAttribute(const QualifiedName&, |
186 const AtomicString&, | 191 const AtomicString&, |
187 MutableStylePropertySet*) override; | 192 MutableStylePropertySet*) override; |
188 void setLayoutDisposition(LayoutDisposition, bool forceReattach = false); | 193 void setLayoutDisposition(LayoutDisposition, bool forceReattach = false); |
189 | 194 |
(...skipping 15 matching lines...) Expand all Loading... |
205 bool isInteractiveContent() const override; | 210 bool isInteractiveContent() const override; |
206 Image* imageContents() override; | 211 Image* imageContents() override; |
207 | 212 |
208 void resetFormOwner(); | 213 void resetFormOwner(); |
209 ImageCandidate findBestFitImageFromPictureParent(); | 214 ImageCandidate findBestFitImageFromPictureParent(); |
210 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); | 215 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); |
211 HTMLImageLoader& imageLoader() const { return *m_imageLoader; } | 216 HTMLImageLoader& imageLoader() const { return *m_imageLoader; } |
212 void notifyViewportChanged(); | 217 void notifyViewportChanged(); |
213 void createMediaQueryListIfDoesNotExist(); | 218 void createMediaQueryListIfDoesNotExist(); |
214 | 219 |
| 220 void requestDecode(); |
| 221 void didDecode(bool success); |
| 222 |
215 Member<HTMLImageLoader> m_imageLoader; | 223 Member<HTMLImageLoader> m_imageLoader; |
216 Member<ViewportChangeListener> m_listener; | 224 Member<ViewportChangeListener> m_listener; |
217 Member<HTMLFormElement> m_form; | 225 Member<HTMLFormElement> m_form; |
218 AtomicString m_bestFitImageURL; | 226 AtomicString m_bestFitImageURL; |
219 float m_imageDevicePixelRatio; | 227 float m_imageDevicePixelRatio; |
220 Member<HTMLSourceElement> m_source; | 228 Member<HTMLSourceElement> m_source; |
221 LayoutDisposition m_layoutDisposition; | 229 LayoutDisposition m_layoutDisposition; |
222 unsigned m_formWasSetByParser : 1; | 230 unsigned m_formWasSetByParser : 1; |
223 unsigned m_elementCreatedByParser : 1; | 231 unsigned m_elementCreatedByParser : 1; |
224 unsigned m_isFallbackImage : 1; | 232 unsigned m_isFallbackImage : 1; |
| 233 HeapVector<Member<ScriptPromiseResolver>> m_decodePromiseResolvers; |
225 | 234 |
226 ReferrerPolicy m_referrerPolicy; | 235 ReferrerPolicy m_referrerPolicy; |
| 236 |
| 237 WTF::WeakPtrFactory<HTMLImageElement> m_weakPtrFactory; |
227 }; | 238 }; |
228 | 239 |
229 } // namespace blink | 240 } // namespace blink |
230 | 241 |
231 #endif // HTMLImageElement_h | 242 #endif // HTMLImageElement_h |
OLD | NEW |