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

Unified Diff: WebCore/bindings/v8/custom/V8ElementCustom.cpp

Issue 174381: Merge Webkit 47001 - 20090810 Vitaly Repeshko <vitalyr@quad.spb.corp.google... (Closed) Base URL: svn://chrome-svn/chrome/branches/WebKit/195/
Patch Set: Created 11 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/bindings/v8/custom/V8CustomBinding.h ('k') | WebCore/bindings/v8/custom/V8NodeCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/bindings/v8/custom/V8ElementCustom.cpp
===================================================================
--- WebCore/bindings/v8/custom/V8ElementCustom.cpp (revision 24197)
+++ WebCore/bindings/v8/custom/V8ElementCustom.cpp (working copy)
@@ -34,7 +34,6 @@
#include "Attr.h"
#include "CSSHelper.h"
#include "Document.h"
-#include "EventListener.h"
#include "ExceptionCode.h"
#include "HTMLFrameElementBase.h"
#include "HTMLNames.h"
@@ -43,7 +42,6 @@
#include "V8Attr.h"
#include "V8Binding.h"
#include "V8CustomBinding.h"
-#include "V8CustomEventListener.h"
#include "V8Proxy.h"
#include <wtf/RefPtr.h>
@@ -127,42 +125,4 @@
return V8DOMWrapper::convertNodeToV8Object(result.get());
}
-static inline String toEventType(v8::Local<v8::String> value)
-{
- String key = toWebCoreString(value);
- ASSERT(key.startsWith("on"));
- return key.substring(2);
-}
-
-ACCESSOR_SETTER(ElementEventHandler)
-{
- Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(info.Holder());
-
- String eventType = toEventType(name);
-
- // Set handler if the value is a function. Otherwise, clear the
- // event handler.
- if (value->IsFunction()) {
- V8Proxy* proxy = V8Proxy::retrieve(node->document()->frame());
- // the document might be created using createDocument,
- // which does not have a frame, use the active frame
- if (!proxy)
- proxy = V8Proxy::retrieve(V8Proxy::retrieveFrameForEnteredContext());
- if (!proxy)
- return;
-
- if (RefPtr<EventListener> listener = proxy->eventListeners()->findOrCreateWrapper<V8EventListener>(proxy->frame(), value, true))
- node->setAttributeEventListener(eventType, listener);
- } else
- node->clearAttributeEventListener(eventType);
-}
-
-ACCESSOR_GETTER(ElementEventHandler)
-{
- Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(info.Holder());
-
- EventListener* listener = node->getAttributeEventListener(toEventType(name));
- return V8DOMWrapper::convertEventListenerToV8Object(listener);
-}
-
} // namespace WebCore
« no previous file with comments | « WebCore/bindings/v8/custom/V8CustomBinding.h ('k') | WebCore/bindings/v8/custom/V8NodeCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698