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 17 matching lines...) Expand all Loading... |
28 #include "core/html/HTMLImageLoader.h" | 28 #include "core/html/HTMLImageLoader.h" |
29 #include "core/html/canvas/CanvasImageSource.h" | 29 #include "core/html/canvas/CanvasImageSource.h" |
30 #include "platform/graphics/GraphicsTypes.h" | 30 #include "platform/graphics/GraphicsTypes.h" |
31 #include "wtf/WeakPtr.h" | 31 #include "wtf/WeakPtr.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class HTMLFormElement; | 35 class HTMLFormElement; |
36 class ImageCandidate; | 36 class ImageCandidate; |
37 | 37 |
38 class HTMLImageElement FINAL : public HTMLElement, public CanvasImageSource { | 38 class HTMLImageElement final : public HTMLElement, public CanvasImageSource { |
39 DEFINE_WRAPPERTYPEINFO(); | 39 DEFINE_WRAPPERTYPEINFO(); |
40 public: | 40 public: |
41 class ViewportChangeListener; | 41 class ViewportChangeListener; |
42 | 42 |
43 static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&); | 43 static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&); |
44 static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&, HTMLFormEl
ement*, bool createdByParser); | 44 static PassRefPtrWillBeRawPtr<HTMLImageElement> create(Document&, HTMLFormEl
ement*, bool createdByParser); |
45 static PassRefPtrWillBeRawPtr<HTMLImageElement> createForJSConstructor(Docum
ent&, int width, int height); | 45 static PassRefPtrWillBeRawPtr<HTMLImageElement> createForJSConstructor(Docum
ent&, int width, int height); |
46 | 46 |
47 virtual ~HTMLImageElement(); | 47 virtual ~HTMLImageElement(); |
48 virtual void trace(Visitor*) OVERRIDE; | 48 virtual void trace(Visitor*) override; |
49 | 49 |
50 int width(bool ignorePendingStylesheets = false); | 50 int width(bool ignorePendingStylesheets = false); |
51 int height(bool ignorePendingStylesheets = false); | 51 int height(bool ignorePendingStylesheets = false); |
52 | 52 |
53 int naturalWidth() const; | 53 int naturalWidth() const; |
54 int naturalHeight() const; | 54 int naturalHeight() const; |
55 const String& currentSrc() const; | 55 const String& currentSrc() const; |
56 | 56 |
57 bool isServerMap() const; | 57 bool isServerMap() const; |
58 | 58 |
(...skipping 13 matching lines...) Expand all Loading... |
72 | 72 |
73 void setWidth(int); | 73 void setWidth(int); |
74 | 74 |
75 int x() const; | 75 int x() const; |
76 int y() const; | 76 int y() const; |
77 | 77 |
78 bool complete() const; | 78 bool complete() const; |
79 | 79 |
80 bool hasPendingActivity() const { return imageLoader().hasPendingActivity();
} | 80 bool hasPendingActivity() const { return imageLoader().hasPendingActivity();
} |
81 | 81 |
82 virtual bool canContainRangeEndPoint() const OVERRIDE { return false; } | 82 virtual bool canContainRangeEndPoint() const override { return false; } |
83 | 83 |
84 void addClient(ImageLoaderClient* client) { imageLoader().addClient(client);
} | 84 void addClient(ImageLoaderClient* client) { imageLoader().addClient(client);
} |
85 void removeClient(ImageLoaderClient* client) { imageLoader().removeClient(cl
ient); } | 85 void removeClient(ImageLoaderClient* client) { imageLoader().removeClient(cl
ient); } |
86 | 86 |
87 virtual const AtomicString imageSourceURL() const OVERRIDE; | 87 virtual const AtomicString imageSourceURL() const override; |
88 | 88 |
89 virtual HTMLFormElement* formOwner() const OVERRIDE; | 89 virtual HTMLFormElement* formOwner() const override; |
90 void formRemovedFromTree(const Node& formRoot); | 90 void formRemovedFromTree(const Node& formRoot); |
91 | 91 |
92 // CanvasImageSourceImplementations | 92 // CanvasImageSourceImplementations |
93 virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceIma
geStatus*) const; | 93 virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceIma
geStatus*) const; |
94 virtual bool wouldTaintOrigin(SecurityOrigin*) const OVERRIDE; | 94 virtual bool wouldTaintOrigin(SecurityOrigin*) const override; |
95 virtual FloatSize sourceSize() const OVERRIDE; | 95 virtual FloatSize sourceSize() const override; |
96 virtual FloatSize defaultDestinationSize() const OVERRIDE; | 96 virtual FloatSize defaultDestinationSize() const override; |
97 virtual const KURL& sourceURL() const OVERRIDE; | 97 virtual const KURL& sourceURL() const override; |
98 | 98 |
99 // public so that HTMLPictureElement can call this as well. | 99 // public so that HTMLPictureElement can call this as well. |
100 void selectSourceURL(ImageLoader::UpdateFromElementBehavior); | 100 void selectSourceURL(ImageLoader::UpdateFromElementBehavior); |
101 protected: | 101 protected: |
102 explicit HTMLImageElement(Document&, HTMLFormElement* = 0, bool createdByPar
ser = false); | 102 explicit HTMLImageElement(Document&, HTMLFormElement* = 0, bool createdByPar
ser = false); |
103 | 103 |
104 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; | 104 virtual void didMoveToNewDocument(Document& oldDocument) override; |
105 | 105 |
106 private: | 106 private: |
107 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } | 107 virtual bool areAuthorShadowsAllowed() const override { return false; } |
108 | 108 |
109 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 109 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; |
110 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 110 virtual bool isPresentationAttribute(const QualifiedName&) const override; |
111 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE; | 111 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) override; |
112 | 112 |
113 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; | 113 virtual void attach(const AttachContext& = AttachContext()) override; |
114 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 114 virtual RenderObject* createRenderer(RenderStyle*) override; |
115 | 115 |
116 virtual bool canStartSelection() const OVERRIDE; | 116 virtual bool canStartSelection() const override; |
117 | 117 |
118 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; | 118 virtual bool isURLAttribute(const Attribute&) const override; |
119 virtual bool hasLegalLinkAttribute(const QualifiedName&) const OVERRIDE; | 119 virtual bool hasLegalLinkAttribute(const QualifiedName&) const override; |
120 virtual const QualifiedName& subResourceAttributeName() const OVERRIDE; | 120 virtual const QualifiedName& subResourceAttributeName() const override; |
121 | 121 |
122 virtual bool draggable() const OVERRIDE; | 122 virtual bool draggable() const override; |
123 | 123 |
124 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; | 124 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; |
125 virtual void removedFrom(ContainerNode*) OVERRIDE; | 125 virtual void removedFrom(ContainerNode*) override; |
126 virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; } | 126 virtual bool shouldRegisterAsNamedItem() const override { return true; } |
127 virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return true;
} | 127 virtual bool shouldRegisterAsExtraNamedItem() const override { return true;
} |
128 virtual bool isInteractiveContent() const OVERRIDE; | 128 virtual bool isInteractiveContent() const override; |
129 virtual Image* imageContents() OVERRIDE; | 129 virtual Image* imageContents() override; |
130 | 130 |
131 void resetFormOwner(); | 131 void resetFormOwner(); |
132 ImageCandidate findBestFitImageFromPictureParent(); | 132 ImageCandidate findBestFitImageFromPictureParent(); |
133 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); | 133 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); |
134 HTMLImageLoader& imageLoader() const { return *m_imageLoader; } | 134 HTMLImageLoader& imageLoader() const { return *m_imageLoader; } |
135 void notifyViewportChanged(); | 135 void notifyViewportChanged(); |
136 void createMediaQueryListIfDoesNotExist(); | 136 void createMediaQueryListIfDoesNotExist(); |
137 | 137 |
138 OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader; | 138 OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader; |
139 RefPtrWillBeMember<ViewportChangeListener> m_listener; | 139 RefPtrWillBeMember<ViewportChangeListener> m_listener; |
140 #if ENABLE(OILPAN) | 140 #if ENABLE(OILPAN) |
141 Member<HTMLFormElement> m_form; | 141 Member<HTMLFormElement> m_form; |
142 #else | 142 #else |
143 WeakPtr<HTMLFormElement> m_form; | 143 WeakPtr<HTMLFormElement> m_form; |
144 #endif | 144 #endif |
145 CompositeOperator m_compositeOperator; | 145 CompositeOperator m_compositeOperator; |
146 AtomicString m_bestFitImageURL; | 146 AtomicString m_bestFitImageURL; |
147 float m_imageDevicePixelRatio; | 147 float m_imageDevicePixelRatio; |
148 unsigned m_formWasSetByParser : 1; | 148 unsigned m_formWasSetByParser : 1; |
149 unsigned m_elementCreatedByParser : 1; | 149 unsigned m_elementCreatedByParser : 1; |
150 // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for
the picked resource. | 150 // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for
the picked resource. |
151 unsigned m_intrinsicSizingViewportDependant : 1; | 151 unsigned m_intrinsicSizingViewportDependant : 1; |
152 // Effective size is viewport dependant if the sizes attribute's effective s
ize used v* length units. | 152 // Effective size is viewport dependant if the sizes attribute's effective s
ize used v* length units. |
153 unsigned m_effectiveSizeViewportDependant : 1; | 153 unsigned m_effectiveSizeViewportDependant : 1; |
154 }; | 154 }; |
155 | 155 |
156 } // namespace blink | 156 } // namespace blink |
157 | 157 |
158 #endif // HTMLImageElement_h | 158 #endif // HTMLImageElement_h |
OLD | NEW |