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. |
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 SKY_ENGINE_CORE_HTML_HTMLIMAGEELEMENT_H_ | 24 #ifndef SKY_ENGINE_CORE_HTML_HTMLIMAGEELEMENT_H_ |
25 #define SKY_ENGINE_CORE_HTML_HTMLIMAGEELEMENT_H_ | 25 #define SKY_ENGINE_CORE_HTML_HTMLIMAGEELEMENT_H_ |
26 | 26 |
27 #include "sky/engine/core/html/HTMLElement.h" | 27 #include "sky/engine/core/html/HTMLElement.h" |
28 #include "sky/engine/core/html/HTMLImageLoader.h" | 28 #include "sky/engine/core/html/HTMLImageLoader.h" |
29 #include "sky/engine/core/html/canvas/CanvasImageSource.h" | |
30 #include "sky/engine/platform/graphics/GraphicsTypes.h" | 29 #include "sky/engine/platform/graphics/GraphicsTypes.h" |
31 #include "sky/engine/wtf/WeakPtr.h" | 30 #include "sky/engine/wtf/WeakPtr.h" |
32 | 31 |
33 namespace blink { | 32 namespace blink { |
34 | 33 |
35 class ImageCandidate; | 34 class ImageCandidate; |
36 class MediaQueryList; | 35 class MediaQueryList; |
37 | 36 |
38 class HTMLImageElement final : public HTMLElement, public CanvasImageSource { | 37 class HTMLImageElement final : public HTMLElement { |
39 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
40 public: | 39 public: |
41 class ViewportChangeListener; | 40 class ViewportChangeListener; |
42 | 41 |
43 static PassRefPtr<HTMLImageElement> create(Document&); | 42 static PassRefPtr<HTMLImageElement> create(Document&); |
44 static PassRefPtr<HTMLImageElement> create(Document&, bool createdByParser); | 43 static PassRefPtr<HTMLImageElement> create(Document&, bool createdByParser); |
45 static PassRefPtr<HTMLImageElement> createForJSConstructor(Document&, int wi
dth, int height); | 44 static PassRefPtr<HTMLImageElement> createForJSConstructor(Document&, int wi
dth, int height); |
46 | 45 |
47 virtual ~HTMLImageElement(); | 46 virtual ~HTMLImageElement(); |
48 | 47 |
(...skipping 21 matching lines...) Expand all Loading... |
70 | 69 |
71 bool hasPendingActivity() const { return imageLoader().hasPendingActivity();
} | 70 bool hasPendingActivity() const { return imageLoader().hasPendingActivity();
} |
72 | 71 |
73 virtual bool canContainRangeEndPoint() const override { return false; } | 72 virtual bool canContainRangeEndPoint() const override { return false; } |
74 | 73 |
75 void addClient(ImageLoaderClient* client) { imageLoader().addClient(client);
} | 74 void addClient(ImageLoaderClient* client) { imageLoader().addClient(client);
} |
76 void removeClient(ImageLoaderClient* client) { imageLoader().removeClient(cl
ient); } | 75 void removeClient(ImageLoaderClient* client) { imageLoader().removeClient(cl
ient); } |
77 | 76 |
78 virtual const AtomicString imageSourceURL() const override; | 77 virtual const AtomicString imageSourceURL() const override; |
79 | 78 |
80 // CanvasImageSourceImplementations | |
81 virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceIma
geStatus*) const; | |
82 virtual FloatSize sourceSize() const override; | |
83 virtual FloatSize defaultDestinationSize() const override; | |
84 virtual const KURL& sourceURL() const override; | |
85 | |
86 protected: | 79 protected: |
87 explicit HTMLImageElement(Document&, bool createdByParser = false); | 80 explicit HTMLImageElement(Document&, bool createdByParser = false); |
88 | 81 |
89 virtual void didMoveToNewDocument(Document& oldDocument) override; | 82 virtual void didMoveToNewDocument(Document& oldDocument) override; |
90 | 83 |
91 private: | 84 private: |
92 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 85 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
93 | 86 |
94 void selectSourceURL(ImageLoader::UpdateFromElementBehavior); | 87 void selectSourceURL(ImageLoader::UpdateFromElementBehavior); |
95 | 88 |
(...skipping 17 matching lines...) Expand all Loading... |
113 unsigned m_elementCreatedByParser : 1; | 106 unsigned m_elementCreatedByParser : 1; |
114 // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for
the picked resource. | 107 // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for
the picked resource. |
115 unsigned m_intrinsicSizingViewportDependant : 1; | 108 unsigned m_intrinsicSizingViewportDependant : 1; |
116 // Effective size is viewport dependant if the sizes attribute's effective s
ize used v* length units. | 109 // Effective size is viewport dependant if the sizes attribute's effective s
ize used v* length units. |
117 unsigned m_effectiveSizeViewportDependant : 1; | 110 unsigned m_effectiveSizeViewportDependant : 1; |
118 }; | 111 }; |
119 | 112 |
120 } // namespace blink | 113 } // namespace blink |
121 | 114 |
122 #endif // SKY_ENGINE_CORE_HTML_HTMLIMAGEELEMENT_H_ | 115 #endif // SKY_ENGINE_CORE_HTML_HTMLIMAGEELEMENT_H_ |
OLD | NEW |