Changeset 53934 in webkit
- Timestamp:
- Jan 27, 2010 7:15:23 AM (14 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 9 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r53898 r53934 1 2010-01-27 Jay Campan <jcampan@google.com> 2 3 Reviewed by Darin Fisher. 4 5 Adding EventListeners to the chromium API. 6 7 https://bugs.webkit.org/show_bug.cgi?id=33882 8 9 * WebKit.gyp: 10 * public/WebEvent.h: Added. 11 * public/WebEventListener.h: Added. 12 * public/WebMutationEvent.h: Added. 13 * public/WebNode.h: 14 * public/WebString.h: 15 (WebKit::operator==): 16 (WebKit::operator!=): 17 * src/EventListenerWrapper.cpp: Added. 18 * src/EventListenerWrapper.h: Added. 19 * src/WebEvent.cpp: Added. 20 * src/WebEventListener.cpp: Added. 21 * src/WebEventListenerPrivate.cpp: Added. 22 * src/WebEventListenerPrivate.h: Added. 23 * src/WebNode.cpp: 24 (WebKit::WebNode::addEventListener): 25 (WebKit::WebNode::removeEventListener): 26 * src/WebString.cpp: 27 (WebKit::WebString::equals): 28 1 29 2010-01-26 Yaar Schnitman <yaar@chromium.org> 2 30 -
trunk/WebKit/chromium/WebKit.gyp
r53898 r53934 108 108 'public/WebEditingAction.h', 109 109 'public/WebElement.h', 110 'public/WebEvent.h', 111 'public/WebEventListener.h', 110 112 'public/WebFileChooserCompletion.h', 111 113 'public/WebFileChooserParams.h', … … 131 133 'public/WebMessagePortChannelClient.h', 132 134 'public/WebMimeRegistry.h', 135 'public/WebMutationEvent.h', 133 136 'public/WebNavigationType.h', 134 137 'public/WebNode.h', … … 211 214 'src/EditorClientImpl.cpp', 212 215 'src/EditorClientImpl.h', 216 'src/EventListenerWrapper.cpp', 217 'src/EventListenerWrapper.h', 213 218 'src/FrameLoaderClientImpl.cpp', 214 219 'src/FrameLoaderClientImpl.h', … … 260 265 'src/WebEntities.cpp', 261 266 'src/WebEntities.h', 267 'src/WebEvent.cpp', 268 'src/WebEventListener.cpp', 269 'src/WebEventListenerPrivate.cpp', 270 'src/WebEventListenerPrivate.h', 262 271 'src/WebFileChooserCompletionImpl.cpp', 263 272 'src/WebFileChooserCompletionImpl.h', … … 278 287 'src/WebMediaPlayerClientImpl.cpp', 279 288 'src/WebMediaPlayerClientImpl.h', 289 'src/WebMutationEvent.cpp', 280 290 'src/WebNode.cpp', 281 291 'src/WebNodeCollection.cpp', -
trunk/WebKit/chromium/public/WebNode.h
r53678 r53934 42 42 namespace WebKit { 43 43 class WebDocument; 44 class WebEventListener; 45 class WebEventListenerPrivate; 44 46 class WebFrame; 45 47 class WebNodeList; … … 101 103 WEBKIT_API bool isTextNode() const; 102 104 WEBKIT_API bool isElementNode() const; 105 WEBKIT_API void addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture); 106 WEBKIT_API void removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture); 103 107 104 108 template<typename T> T toElement() -
trunk/WebKit/chromium/public/WebString.h
r52268 r53934 76 76 WEBKIT_API void assign(const WebString&); 77 77 WEBKIT_API void assign(const WebUChar* data, size_t len); 78 79 WEBKIT_API bool equals(const WebString& s) const; 78 80 79 81 WEBKIT_API size_t length() const; … … 164 166 }; 165 167 168 inline bool operator==(const WebString& a, const WebString& b) 169 { 170 return a.equals(b); 171 } 172 173 inline bool operator!=(const WebString& a, const WebString& b) 174 { 175 return !(a == b); 176 } 177 166 178 } // namespace WebKit 167 179 -
trunk/WebKit/chromium/src/WebNode.cpp
r52774 r53934 38 38 #include "NodeList.h" 39 39 40 #include "EventListenerWrapper.h" 40 41 #include "WebDocument.h" 42 #include "WebEvent.h" 43 #include "WebEventListener.h" 41 44 #include "WebFrameImpl.h" 42 45 #include "WebNodeList.h" … … 174 177 } 175 178 179 void WebNode::addEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture) 180 { 181 EventListenerWrapper* listenerWrapper = 182 listener->createEventListenerWrapper(eventType, useCapture, m_private); 183 // The listenerWrapper is only referenced by the actual Node. Once it goes 184 // away, the wrapper notifies the WebEventListener so it can clear its 185 // pointer to it. 186 m_private->addEventListener(eventType, adoptRef(listenerWrapper), useCapture); 187 } 188 189 void WebNode::removeEventListener(const WebString& eventType, WebEventListener* listener, bool useCapture) 190 { 191 EventListenerWrapper* listenerWrapper = 192 listener->getEventListenerWrapper(eventType, useCapture, m_private); 193 m_private->removeEventListener(eventType, listenerWrapper, useCapture); 194 // listenerWrapper is now deleted. 195 } 196 176 197 } // namespace WebKit -
trunk/WebKit/chromium/src/WebString.cpp
r50739 r53934 87 87 } 88 88 89 bool WebString::equals(const WebString& s) const 90 { 91 return equal(m_private, s.m_private); 92 } 93 89 94 WebString::WebString(const WebCore::String& s) 90 95 : m_private(static_cast<WebStringPrivate*>(s.impl()))
Note: See TracChangeset
for help on using the changeset viewer.