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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLImageElement.h

Issue 2537133005: New interface and function for form association (Closed)
Patch Set: Added to BUILD.gn Created 4 years 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.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
21 * 21 *
22 */ 22 */
23 23
24 #ifndef HTMLImageElement_h 24 #ifndef HTMLImageElement_h
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/fetch/FetchRequest.h" 29 #include "core/fetch/FetchRequest.h"
30 #include "core/html/FormAssociated.h"
30 #include "core/html/HTMLElement.h" 31 #include "core/html/HTMLElement.h"
31 #include "core/html/HTMLImageLoader.h" 32 #include "core/html/HTMLImageLoader.h"
32 #include "core/html/canvas/CanvasImageSource.h" 33 #include "core/html/canvas/CanvasImageSource.h"
33 #include "core/imagebitmap/ImageBitmapSource.h" 34 #include "core/imagebitmap/ImageBitmapSource.h"
34 #include "platform/graphics/GraphicsTypes.h" 35 #include "platform/graphics/GraphicsTypes.h"
35 #include "platform/network/ResourceResponse.h" 36 #include "platform/network/ResourceResponse.h"
36 37
37 namespace blink { 38 namespace blink {
38 39
39 class HTMLFormElement; 40 class HTMLFormElement;
40 class ImageCandidate; 41 class ImageCandidate;
41 class ShadowRoot; 42 class ShadowRoot;
42 class ImageBitmapOptions; 43 class ImageBitmapOptions;
43 44
44 class CORE_EXPORT HTMLImageElement final : public HTMLElement, 45 class CORE_EXPORT HTMLImageElement final : public HTMLElement,
45 public CanvasImageSource, 46 public CanvasImageSource,
46 public ImageBitmapSource, 47 public ImageBitmapSource,
47 public ActiveScriptWrappable { 48 public ActiveScriptWrappable,
49 public FormAssociated {
48 DEFINE_WRAPPERTYPEINFO(); 50 DEFINE_WRAPPERTYPEINFO();
49 USING_GARBAGE_COLLECTED_MIXIN(HTMLImageElement); 51 USING_GARBAGE_COLLECTED_MIXIN(HTMLImageElement);
50 52
51 public: 53 public:
52 class ViewportChangeListener; 54 class ViewportChangeListener;
53 55
54 static HTMLImageElement* create(Document&); 56 static HTMLImageElement* create(Document&);
55 static HTMLImageElement* create(Document&, 57 static HTMLImageElement* create(Document&,
56 HTMLFormElement*, 58 HTMLFormElement*,
57 bool createdByParser); 59 bool createdByParser);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void forceReload() const; 135 void forceReload() const;
134 136
135 // ImageBitmapSource implementation 137 // ImageBitmapSource implementation
136 IntSize bitmapSourceSize() const override; 138 IntSize bitmapSourceSize() const override;
137 ScriptPromise createImageBitmap(ScriptState*, 139 ScriptPromise createImageBitmap(ScriptState*,
138 EventTarget&, 140 EventTarget&,
139 Optional<IntRect> cropRect, 141 Optional<IntRect> cropRect,
140 const ImageBitmapOptions&, 142 const ImageBitmapOptions&,
141 ExceptionState&) override; 143 ExceptionState&) override;
142 144
145 FormAssociated* toFormAssociatedOrNull() override { return this; };
146 void associateWith(HTMLFormElement*) override;
147
143 protected: 148 protected:
144 explicit HTMLImageElement(Document&, 149 explicit HTMLImageElement(Document&,
145 HTMLFormElement* = 0, 150 HTMLFormElement* = 0,
146 bool createdByParser = false); 151 bool createdByParser = false);
147 152
148 void didMoveToNewDocument(Document& oldDocument) override; 153 void didMoveToNewDocument(Document& oldDocument) override;
149 virtual bool useFallbackContent() const { return m_useFallbackContent; } 154 virtual bool useFallbackContent() const { return m_useFallbackContent; }
150 155
151 void didAddUserAgentShadowRoot(ShadowRoot&) override; 156 void didAddUserAgentShadowRoot(ShadowRoot&) override;
152 PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; 157 PassRefPtr<ComputedStyle> customStyleForLayoutObject() override;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 unsigned m_elementCreatedByParser : 1; 202 unsigned m_elementCreatedByParser : 1;
198 unsigned m_useFallbackContent : 1; 203 unsigned m_useFallbackContent : 1;
199 unsigned m_isFallbackImage : 1; 204 unsigned m_isFallbackImage : 1;
200 205
201 ReferrerPolicy m_referrerPolicy; 206 ReferrerPolicy m_referrerPolicy;
202 }; 207 };
203 208
204 } // namespace blink 209 } // namespace blink
205 210
206 #endif // HTMLImageElement_h 211 #endif // HTMLImageElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698