From c403da314c8fcfe95cf5f2578c3dbef2df4fa12d Mon Sep 17 00:00:00 2001 From: Elliott Sprehn Date: Thu, 23 Oct 2014 15:41:57 -0700 Subject: [PATCH] Remove lots of machinery related to inline event handlers. R=abarth@chromium.org Review URL: https://codereview.chromium.org/671173006 --- .../core/v8/V8AbstractEventListener.cpp | 20 ++----- .../core/v8/V8AbstractEventListener.h | 21 +------ engine/bindings/core/v8/V8ErrorHandler.cpp | 4 +- engine/bindings/core/v8/V8ErrorHandler.h | 6 +- engine/bindings/core/v8/V8EventListener.cpp | 5 +- engine/bindings/core/v8/V8EventListener.h | 6 +- .../bindings/core/v8/V8EventListenerList.cpp | 5 +- engine/bindings/core/v8/V8EventListenerList.h | 24 ++++---- engine/bindings/core/v8/V8GCController.cpp | 2 - engine/bindings/scripts/v8_attributes.py | 4 +- engine/bindings/templates/methods.cpp | 4 +- engine/bindings/tests/idls/TestImplements.idl | 1 - .../bindings/tests/idls/TestInterfaceNode.idl | 1 - engine/bindings/tests/idls/TestObject.idl | 2 - engine/core/animation/AnimationPlayer.h | 2 - engine/core/animation/AnimationPlayer.idl | 1 - engine/core/core.gni | 2 - engine/core/css/FontFaceSet.h | 4 -- engine/core/css/FontFaceSet.idl | 4 -- engine/core/css/MediaQueryList.h | 2 - engine/core/css/MediaQueryList.idl | 9 --- engine/core/dom/Document.cpp | 16 ------ engine/core/dom/Document.h | 21 ------- engine/core/dom/Element.h | 14 ----- .../core/editing/ReplaceSelectionCommand.cpp | 3 +- engine/core/events/EventListener.h | 44 ++++----------- engine/core/events/EventListenerMap.cpp | 47 ---------------- engine/core/events/EventListenerMap.h | 3 - engine/core/events/EventTarget.cpp | 27 --------- engine/core/events/EventTarget.h | 55 ------------------- engine/core/frame/DOMWindowEventHandlers.h | 52 ------------------ engine/core/frame/LocalDOMWindow.h | 13 ----- engine/core/frame/Window.idl | 14 ----- engine/core/frame/WindowEventHandlers.idl | 49 ----------------- engine/core/html/ime/InputMethodContext.h | 4 -- engine/core/html/ime/InputMethodContext.idl | 4 -- 36 files changed, 48 insertions(+), 447 deletions(-) delete mode 100644 engine/core/frame/DOMWindowEventHandlers.h delete mode 100644 engine/core/frame/WindowEventHandlers.idl diff --git a/engine/bindings/core/v8/V8AbstractEventListener.cpp b/engine/bindings/core/v8/V8AbstractEventListener.cpp index 2d862a0985d..2ba25d91135 100644 --- a/engine/bindings/core/v8/V8AbstractEventListener.cpp +++ b/engine/bindings/core/v8/V8AbstractEventListener.cpp @@ -42,9 +42,8 @@ namespace blink { -V8AbstractEventListener::V8AbstractEventListener(bool isAttribute, ScriptState* scriptState) - : EventListener(JSEventListenerType) - , m_isAttribute(isAttribute) +V8AbstractEventListener::V8AbstractEventListener(ScriptState* scriptState) + : EventListener() , m_scriptState(scriptState) , m_isolate(scriptState->isolate()) { @@ -52,9 +51,8 @@ V8AbstractEventListener::V8AbstractEventListener(bool isAttribute, ScriptState* InspectorCounters::incrementCounter(InspectorCounters::JSEventListenerCounter); } -V8AbstractEventListener::V8AbstractEventListener(bool isAttribute, v8::Isolate* isolate) - : EventListener(JSEventListenerType) - , m_isAttribute(isAttribute) +V8AbstractEventListener::V8AbstractEventListener(v8::Isolate* isolate) + : EventListener() , m_scriptState(nullptr) , m_isolate(isolate) { @@ -66,7 +64,7 @@ V8AbstractEventListener::~V8AbstractEventListener() { if (!m_listener.isEmpty()) { v8::HandleScope scope(m_isolate); - V8EventListenerList::clearWrapper(m_listener.newLocal(isolate()), m_isAttribute, isolate()); + V8EventListenerList::clearWrapper(m_listener.newLocal(isolate()), isolate()); } if (isMainThread()) InspectorCounters::decrementCounter(InspectorCounters::JSEventListenerCounter); @@ -139,9 +137,6 @@ void V8AbstractEventListener::invokeEventHandler(Event* event, v8::LocalpreventDefault(); } bool V8AbstractEventListener::shouldPreventDefault(v8::Local returnValue) @@ -164,11 +159,6 @@ v8::Local V8AbstractEventListener::getReceiverObject(Event* event) return v8::Local::New(isolate(), v8::Handle::Cast(value)); } -bool V8AbstractEventListener::belongsToTheCurrentWorld() const -{ - return isolate()->InContext() && &world() == &DOMWrapperWorld::current(isolate()); -} - void V8AbstractEventListener::setWeakCallback(const v8::WeakCallbackData &data) { data.GetParameter()->m_listener.clear(); diff --git a/engine/bindings/core/v8/V8AbstractEventListener.h b/engine/bindings/core/v8/V8AbstractEventListener.h index ca2a192cbdf..45186917d70 100644 --- a/engine/bindings/core/v8/V8AbstractEventListener.h +++ b/engine/bindings/core/v8/V8AbstractEventListener.h @@ -56,9 +56,7 @@ public: static const V8AbstractEventListener* cast(const EventListener* listener) { - return listener->type() == JSEventListenerType - ? static_cast(listener) - : 0; + return static_cast(listener); } static V8AbstractEventListener* cast(EventListener* listener) @@ -72,8 +70,6 @@ public: virtual void handleEvent(ExecutionContext*, Event*) OVERRIDE; - virtual bool isLazy() const { return false; } - // Returns the listener object, either a function or an object. v8::Local getListenerObject(ExecutionContext* context) { @@ -108,7 +104,6 @@ public: m_listener.clear(); } - virtual bool belongsToTheCurrentWorld() const OVERRIDE FINAL; v8::Isolate* isolate() const { return m_isolate; } virtual DOMWrapperWorld& world() const { return scriptState()->world(); } ScriptState* scriptState() const @@ -119,8 +114,8 @@ public: void setScriptState(ScriptState* scriptState) { m_scriptState = scriptState; } protected: - V8AbstractEventListener(bool isAttribute, ScriptState*); - V8AbstractEventListener(bool isAttribute, v8::Isolate*); + V8AbstractEventListener(ScriptState*); + V8AbstractEventListener(v8::Isolate*); virtual void prepareListenerObject(ExecutionContext*) { } @@ -132,9 +127,6 @@ protected: v8::Local getReceiverObject(Event*); private: - // Implementation of EventListener function. - virtual bool virtualisAttribute() const OVERRIDE { return m_isAttribute; } - virtual v8::Local callListenerFunction(v8::Handle jsevent, Event*) = 0; virtual bool shouldPreventDefault(v8::Local returnValue); @@ -142,13 +134,6 @@ private: static void setWeakCallback(const v8::WeakCallbackData&); ScopedPersistent m_listener; - - // Indicates if this is an HTML type listener. - bool m_isAttribute; - - // For V8LazyEventListener, m_scriptState can be 0 until V8LazyEventListener is actually used. - // m_scriptState is set lazily because V8LazyEventListener doesn't know the associated frame - // until the listener is actually used. RefPtr m_scriptState; v8::Isolate* m_isolate; }; diff --git a/engine/bindings/core/v8/V8ErrorHandler.cpp b/engine/bindings/core/v8/V8ErrorHandler.cpp index f92c80caa7a..94c5c4f6a1a 100644 --- a/engine/bindings/core/v8/V8ErrorHandler.cpp +++ b/engine/bindings/core/v8/V8ErrorHandler.cpp @@ -42,8 +42,8 @@ namespace blink { -V8ErrorHandler::V8ErrorHandler(v8::Local listener, bool isInline, ScriptState* scriptState) - : V8EventListener(listener, isInline, scriptState) +V8ErrorHandler::V8ErrorHandler(v8::Local listener, ScriptState* scriptState) + : V8EventListener(listener, scriptState) { } diff --git a/engine/bindings/core/v8/V8ErrorHandler.h b/engine/bindings/core/v8/V8ErrorHandler.h index 3b9fc519480..547126ce2a4 100644 --- a/engine/bindings/core/v8/V8ErrorHandler.h +++ b/engine/bindings/core/v8/V8ErrorHandler.h @@ -42,15 +42,15 @@ class LocalFrame; class V8ErrorHandler FINAL : public V8EventListener { public: - static PassRefPtr create(v8::Local listener, bool isInline, ScriptState* scriptState) + static PassRefPtr create(v8::Local listener, ScriptState* scriptState) { - return adoptRef(new V8ErrorHandler(listener, isInline, scriptState)); + return adoptRef(new V8ErrorHandler(listener, scriptState)); } static void storeExceptionOnErrorEventWrapper(ErrorEvent*, v8::Handle, v8::Handle creationContext, v8::Isolate*); private: - V8ErrorHandler(v8::Local listener, bool isInline, ScriptState*); + V8ErrorHandler(v8::Local listener, ScriptState*); virtual v8::Local callListenerFunction(v8::Handle jsEvent, Event*) OVERRIDE; virtual bool shouldPreventDefault(v8::Local returnValue) OVERRIDE; diff --git a/engine/bindings/core/v8/V8EventListener.cpp b/engine/bindings/core/v8/V8EventListener.cpp index 94e20c6f02c..962466bba10 100644 --- a/engine/bindings/core/v8/V8EventListener.cpp +++ b/engine/bindings/core/v8/V8EventListener.cpp @@ -38,8 +38,8 @@ namespace blink { -V8EventListener::V8EventListener(v8::Local listener, bool isAttribute, ScriptState* scriptState) - : V8AbstractEventListener(isAttribute, scriptState) +V8EventListener::V8EventListener(v8::Local listener, ScriptState* scriptState) + : V8AbstractEventListener(scriptState) { setListenerObject(listener); } @@ -56,7 +56,6 @@ v8::Local V8EventListener::getListenerFunction(ExecutionContext*) return v8::Local::Cast(listener); if (listener->IsObject()) { - ASSERT_WITH_MESSAGE(!isAttribute(), "EventHandler attributes should only accept JS Functions as input."); v8::Local property = listener->Get(v8AtomicString(isolate(), "handleEvent")); // Check that no exceptions were thrown when getting the // handleEvent property and that the value is a function. diff --git a/engine/bindings/core/v8/V8EventListener.h b/engine/bindings/core/v8/V8EventListener.h index 2cd8a9b5bf0..4e682b76cc6 100644 --- a/engine/bindings/core/v8/V8EventListener.h +++ b/engine/bindings/core/v8/V8EventListener.h @@ -44,13 +44,13 @@ class LocalFrame; // that can handle the event. class V8EventListener : public V8AbstractEventListener { public: - static PassRefPtr create(v8::Local listener, bool isAttribute, ScriptState* scriptState) + static PassRefPtr create(v8::Local listener, ScriptState* scriptState) { - return adoptRef(new V8EventListener(listener, isAttribute, scriptState)); + return adoptRef(new V8EventListener(listener, scriptState)); } protected: - V8EventListener(v8::Local listener, bool isAttribute, ScriptState*); + V8EventListener(v8::Local listener, ScriptState*); v8::Local getListenerFunction(ExecutionContext*); diff --git a/engine/bindings/core/v8/V8EventListenerList.cpp b/engine/bindings/core/v8/V8EventListenerList.cpp index a4c9a6fc26c..45a6072325d 100644 --- a/engine/bindings/core/v8/V8EventListenerList.cpp +++ b/engine/bindings/core/v8/V8EventListenerList.cpp @@ -36,18 +36,17 @@ namespace blink { -PassRefPtr V8EventListenerList::getEventListener(ScriptState* scriptState, v8::Local value, bool isAttribute, ListenerLookupType lookup) +PassRefPtr V8EventListenerList::getEventListener(ScriptState* scriptState, v8::Local value, ListenerLookupType lookup) { ASSERT(!scriptState->contextIsEmpty()); if (lookup == ListenerFindOnly) { // Used by EventTarget::removeEventListener, specifically // EventTargetV8Internal::removeEventListenerMethod - ASSERT(!isAttribute); return V8EventListenerList::findWrapper(value, scriptState); } if (toDOMWindow(scriptState->context())) - return V8EventListenerList::findOrCreateWrapper(value, isAttribute, scriptState); + return V8EventListenerList::findOrCreateWrapper(value, scriptState); ASSERT_NOT_REACHED(); return nullptr; diff --git a/engine/bindings/core/v8/V8EventListenerList.h b/engine/bindings/core/v8/V8EventListenerList.h index 3f879795b51..836d3fdb200 100644 --- a/engine/bindings/core/v8/V8EventListenerList.h +++ b/engine/bindings/core/v8/V8EventListenerList.h @@ -53,20 +53,20 @@ public: if (!value->IsObject()) return nullptr; - v8::Handle wrapperProperty = getHiddenProperty(false, scriptState->isolate()); + v8::Handle wrapperProperty = getHiddenProperty(scriptState->isolate()); return doFindWrapper(v8::Local::Cast(value), wrapperProperty, scriptState); } template - static PassRefPtr findOrCreateWrapper(v8::Local, bool isAttribute, ScriptState*); + static PassRefPtr findOrCreateWrapper(v8::Local, ScriptState*); - static void clearWrapper(v8::Handle listenerObject, bool isAttribute, v8::Isolate* isolate) + static void clearWrapper(v8::Handle listenerObject, v8::Isolate* isolate) { - v8::Handle wrapperProperty = getHiddenProperty(isAttribute, isolate); + v8::Handle wrapperProperty = getHiddenProperty(isolate); listenerObject->DeleteHiddenValue(wrapperProperty); } - static PassRefPtr getEventListener(ScriptState*, v8::Local, bool isAttribute, ListenerLookupType); + static PassRefPtr getEventListener(ScriptState*, v8::Local, ListenerLookupType); private: static V8EventListener* doFindWrapper(v8::Local object, v8::Handle wrapperProperty, ScriptState* scriptState) @@ -79,30 +79,28 @@ private: return static_cast(v8::External::Cast(*listener)->Value()); } - static inline v8::Handle getHiddenProperty(bool isAttribute, v8::Isolate* isolate) + static inline v8::Handle getHiddenProperty(v8::Isolate* isolate) { - return isAttribute ? v8AtomicString(isolate, "attributeListener") : v8AtomicString(isolate, "listener"); + return v8AtomicString(isolate, "listener"); } }; template -PassRefPtr V8EventListenerList::findOrCreateWrapper(v8::Local value, bool isAttribute, ScriptState* scriptState) +PassRefPtr V8EventListenerList::findOrCreateWrapper(v8::Local value, ScriptState* scriptState) { v8::Isolate* isolate = scriptState->isolate(); ASSERT(isolate->InContext()); - if (!value->IsObject() - // Non-callable attribute setter input is treated as null (no wrapper) - || (isAttribute && !value->IsFunction())) + if (!value->IsObject()) return nullptr; v8::Local object = v8::Local::Cast(value); - v8::Handle wrapperProperty = getHiddenProperty(isAttribute, isolate); + v8::Handle wrapperProperty = getHiddenProperty(isolate); V8EventListener* wrapper = doFindWrapper(object, wrapperProperty, scriptState); if (wrapper) return wrapper; - RefPtr wrapperPtr = WrapperType::create(object, isAttribute, scriptState); + RefPtr wrapperPtr = WrapperType::create(object, scriptState); if (wrapperPtr) object->SetHiddenValue(wrapperProperty, v8::External::New(isolate, wrapperPtr.get())); diff --git a/engine/bindings/core/v8/V8GCController.cpp b/engine/bindings/core/v8/V8GCController.cpp index abf877fd49d..207af1ae848 100644 --- a/engine/bindings/core/v8/V8GCController.cpp +++ b/engine/bindings/core/v8/V8GCController.cpp @@ -62,8 +62,6 @@ static void addReferencesForNodeWithEventListeners(v8::Isolate* isolate, Node* n EventListenerIterator iterator(node); while (EventListener* listener = iterator.nextListener()) { - if (listener->type() != EventListener::JSEventListenerType) - continue; V8AbstractEventListener* v8listener = static_cast(listener); if (!v8listener->hasExistingListenerObject()) continue; diff --git a/engine/bindings/scripts/v8_attributes.py b/engine/bindings/scripts/v8_attributes.py index b2d724f889f..eac7e38ff66 100644 --- a/engine/bindings/scripts/v8_attributes.py +++ b/engine/bindings/scripts/v8_attributes.py @@ -372,9 +372,9 @@ def setter_expression(interface, attribute, context): if (interface.name in ['Window'] and attribute.name == 'onerror'): includes.add('bindings/core/v8/V8ErrorHandler.h') - arguments.append('V8EventListenerList::findOrCreateWrapper(v8Value, true, ScriptState::current(info.GetIsolate()))') + arguments.append('V8EventListenerList::findOrCreateWrapper(v8Value, ScriptState::current(info.GetIsolate()))') else: - arguments.append('V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)') + arguments.append('V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), v8Value, ListenerFindOrCreate)') elif idl_type.is_interface_type: # FIXME: should be able to eliminate WTF::getPtr in most or all cases arguments.append('WTF::getPtr(cppValue)') diff --git a/engine/bindings/templates/methods.cpp b/engine/bindings/templates/methods.cpp index 3c925f131b7..07f59c9d041 100644 --- a/engine/bindings/templates/methods.cpp +++ b/engine/bindings/templates/methods.cpp @@ -135,9 +135,9 @@ if (info.Length() > {{argument.index}} && {% if argument.is_nullable %}!isUndefi {# FIXME: remove EventListener special case #} {% if argument.idl_type == 'EventListener' %} {% if method.name == 'removeEventListener' or method.name == 'removeListener' %} -{{argument.name}} = V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, ListenerFindOnly); +{{argument.name}} = V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], ListenerFindOnly); {% else %}{# method.name == 'addEventListener' #} -{{argument.name}} = V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, ListenerFindOrCreate); +{{argument.name}} = V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], ListenerFindOrCreate); {% endif %}{# method.name #} {% else %}{# argument.idl_type == 'EventListener' #} {# Callback functions must be functions: diff --git a/engine/bindings/tests/idls/TestImplements.idl b/engine/bindings/tests/idls/TestImplements.idl index ffe8372cc6b..83aacd3b64c 100644 --- a/engine/bindings/tests/idls/TestImplements.idl +++ b/engine/bindings/tests/idls/TestImplements.idl @@ -34,7 +34,6 @@ readonly attribute DOMString implementsReadonlyStringAttribute; attribute DOMString implementsStringAttribute; attribute Node implementsNodeAttribute; - attribute EventHandler implementsEventHandlerAttribute; void implementsVoidMethod(); [CallWith=ExecutionContext, RaisesException] TestInterfaceEmpty implementsComplexMethod(DOMString strArg, TestInterfaceEmpty testInterfaceEmptyArg); diff --git a/engine/bindings/tests/idls/TestInterfaceNode.idl b/engine/bindings/tests/idls/TestInterfaceNode.idl index 25c62a5bf77..e95ce7a289f 100644 --- a/engine/bindings/tests/idls/TestInterfaceNode.idl +++ b/engine/bindings/tests/idls/TestInterfaceNode.idl @@ -31,7 +31,6 @@ interface TestInterfaceNode : Node { attribute DOMString stringAttribute; readonly attribute TestInterfaceEmpty readonlyTestInterfaceEmptyAttribute; - attribute EventHandler eventHandlerAttribute; [PerWorldBindings] readonly attribute TestInterfaceEmpty perWorldBindingsReadonlyTestInterfaceEmptyAttribute; [Reflect] attribute DOMString reflectStringAttribute; [Reflect, URL] attribute DOMString reflectUrlStringAttribute; diff --git a/engine/bindings/tests/idls/TestObject.idl b/engine/bindings/tests/idls/TestObject.idl index c32714cc519..e6048cf556f 100644 --- a/engine/bindings/tests/idls/TestObject.idl +++ b/engine/bindings/tests/idls/TestObject.idl @@ -150,8 +150,6 @@ interface TestObject { // Static attributes static attribute DOMString staticStringAttribute; static attribute long staticLongAttribute; - // Exceptional type - attribute EventHandler eventHandlerAttribute; // Extended attributes [CachedAttribute=isValueDirty] attribute any cachedAttributeAnyAttribute; diff --git a/engine/core/animation/AnimationPlayer.h b/engine/core/animation/AnimationPlayer.h index 98b6af0bc71..3a0222acb6d 100644 --- a/engine/core/animation/AnimationPlayer.h +++ b/engine/core/animation/AnimationPlayer.h @@ -91,8 +91,6 @@ public: // remove this method. bool finishedInternal() const { return m_finished; } - DEFINE_ATTRIBUTE_EVENT_LISTENER(finish); - virtual const AtomicString& interfaceName() const OVERRIDE; virtual ExecutionContext* executionContext() const OVERRIDE; virtual bool hasPendingActivity() const OVERRIDE; diff --git a/engine/core/animation/AnimationPlayer.idl b/engine/core/animation/AnimationPlayer.idl index 0066e66bc43..2783ce85cd1 100644 --- a/engine/core/animation/AnimationPlayer.idl +++ b/engine/core/animation/AnimationPlayer.idl @@ -46,5 +46,4 @@ [RuntimeEnabled=WebAnimationsAPI] void reverse(); void cancel(); - [MeasureAs=AnimationPlayerFinishEvent] attribute EventHandler onfinish; }; diff --git a/engine/core/core.gni b/engine/core/core.gni index 19a1bc07dc4..bce69074da4 100644 --- a/engine/core/core.gni +++ b/engine/core/core.gni @@ -718,7 +718,6 @@ sky_core_files = [ "frame/DOMTimer.h", "frame/DOMWindowBase64.cpp", "frame/DOMWindowBase64.h", - "frame/DOMWindowEventHandlers.h", "frame/DOMWindowLifecycleNotifier.cpp", "frame/DOMWindowLifecycleNotifier.h", "frame/DOMWindowLifecycleObserver.cpp", @@ -1393,7 +1392,6 @@ core_dependency_idl_files = get_path_info([ "dom/URLUtilsReadOnly.idl", "events/EventListener.idl", "frame/WindowBase64.idl", - "frame/WindowEventHandlers.idl", "frame/WindowTimers.idl", "html/canvas/CanvasPathMethods.idl", "html/canvas/MouseEventHitRegion.idl", diff --git a/engine/core/css/FontFaceSet.h b/engine/core/css/FontFaceSet.h index 6a334872573..c953025f758 100644 --- a/engine/core/css/FontFaceSet.h +++ b/engine/core/css/FontFaceSet.h @@ -70,10 +70,6 @@ class FontFaceSet FINAL : public RefCountedSupplement, pu public: virtual ~FontFaceSet(); - DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); - DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingdone); - DEFINE_ATTRIBUTE_EVENT_LISTENER(loadingerror); - bool check(const String& font, const String& text, ExceptionState&); ScriptPromise load(ScriptState*, const String& font, const String& text); ScriptPromise ready(ScriptState*); diff --git a/engine/core/css/FontFaceSet.idl b/engine/core/css/FontFaceSet.idl index 03f9058dfc8..c88d24f6407 100644 --- a/engine/core/css/FontFaceSet.idl +++ b/engine/core/css/FontFaceSet.idl @@ -36,10 +36,6 @@ enum FontFaceSetLoadStatus { "loading", "loaded" }; NoInterfaceObject, ] interface FontFaceSet : EventTarget { - attribute EventHandler onloading; - attribute EventHandler onloadingdone; - attribute EventHandler onloadingerror; - [RaisesException] boolean check(DOMString font, optional DOMString text = null); [CallWith=ScriptState] Promise load(DOMString font, optional DOMString text = null); [MeasureAs=FontFaceSetReady, CallWith=ScriptState] Promise ready(); diff --git a/engine/core/css/MediaQueryList.h b/engine/core/css/MediaQueryList.h index d49e56af756..521b778caf4 100644 --- a/engine/core/css/MediaQueryList.h +++ b/engine/core/css/MediaQueryList.h @@ -53,8 +53,6 @@ public: String media() const; bool matches(); - DEFINE_ATTRIBUTE_EVENT_LISTENER(change); - // These two functions are provided for compatibility with JS code // written before the change listener became a DOM event. void addDeprecatedListener(PassRefPtr); diff --git a/engine/core/css/MediaQueryList.idl b/engine/core/css/MediaQueryList.idl index cb93f6f8b32..8bd02419267 100644 --- a/engine/core/css/MediaQueryList.idl +++ b/engine/core/css/MediaQueryList.idl @@ -25,13 +25,4 @@ ] interface MediaQueryList : EventTarget { readonly attribute DOMString media; readonly attribute boolean matches; - - // Even though this interface is now an event target, these functions - // exist as aliases for addEventListener for backwards compatibility - // with older versions of this interface. See the note at - // http://dev.w3.org/csswg/cssom-view/#dom-mediaquerylist-removelistener - [ImplementedAs=addDeprecatedListener] void addListener([Default=Undefined] optional EventListener listener); - [ImplementedAs=removeDeprecatedListener]void removeListener([Default=Undefined] optional EventListener listener); - - attribute EventHandler onchange; }; diff --git a/engine/core/dom/Document.cpp b/engine/core/dom/Document.cpp index fbce9f2115a..859a8506dfd 100644 --- a/engine/core/dom/Document.cpp +++ b/engine/core/dom/Document.cpp @@ -2317,22 +2317,6 @@ void Document::didSplitTextNode(Text& oldNode) // FIXME: This should update markers for spelling and grammar checking. } -void Document::setWindowAttributeEventListener(const AtomicString& eventType, PassRefPtr listener) -{ - LocalDOMWindow* domWindow = this->domWindow(); - if (!domWindow) - return; - domWindow->setAttributeEventListener(eventType, listener); -} - -EventListener* Document::getWindowAttributeEventListener(const AtomicString& eventType) -{ - LocalDOMWindow* domWindow = this->domWindow(); - if (!domWindow) - return 0; - return domWindow->getAttributeEventListener(eventType); -} - EventQueue* Document::eventQueue() const { if (!m_domWindow) diff --git a/engine/core/dom/Document.h b/engine/core/dom/Document.h index 42547dae151..4f5ce512974 100644 --- a/engine/core/dom/Document.h +++ b/engine/core/dom/Document.h @@ -203,23 +203,6 @@ public: // DOM methods & attributes for Document - DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); - DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); - DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); - DEFINE_ATTRIBUTE_EVENT_LISTENER(copy); - DEFINE_ATTRIBUTE_EVENT_LISTENER(cut); - DEFINE_ATTRIBUTE_EVENT_LISTENER(paste); - DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange); - DEFINE_ATTRIBUTE_EVENT_LISTENER(search); - DEFINE_ATTRIBUTE_EVENT_LISTENER(securitypolicyviolation); - DEFINE_ATTRIBUTE_EVENT_LISTENER(selectionchange); - DEFINE_ATTRIBUTE_EVENT_LISTENER(selectstart); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); - DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel); - bool shouldOverrideLegacyDescription(ViewportDescription::Type); void setViewportDescription(const ViewportDescription&); const ViewportDescription& viewportDescription() const { return m_viewportDescription; } @@ -443,10 +426,6 @@ public: void clearDOMWindow() { m_domWindow = nullptr; } LocalDOMWindow* domWindow() const { return m_domWindow; } - // Helper functions for forwarding LocalDOMWindow event related tasks to the LocalDOMWindow if it exists. - void setWindowAttributeEventListener(const AtomicString& eventType, PassRefPtr); - EventListener* getWindowAttributeEventListener(const AtomicString& eventType); - static void registerEventFactory(PassOwnPtr); static PassRefPtrWillBeRawPtr createEvent(const String& eventType, ExceptionState&); diff --git a/engine/core/dom/Element.h b/engine/core/dom/Element.h index f3361f71dd8..23cc9d6d765 100644 --- a/engine/core/dom/Element.h +++ b/engine/core/dom/Element.h @@ -88,20 +88,6 @@ public: static PassRefPtrWillBeRawPtr create(const QualifiedName&, Document*); virtual ~Element(); - DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); - DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); - DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); - DEFINE_ATTRIBUTE_EVENT_LISTENER(copy); - DEFINE_ATTRIBUTE_EVENT_LISTENER(cut); - DEFINE_ATTRIBUTE_EVENT_LISTENER(paste); - DEFINE_ATTRIBUTE_EVENT_LISTENER(search); - DEFINE_ATTRIBUTE_EVENT_LISTENER(selectstart); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); - DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel); - bool hasAttribute(const QualifiedName&) const; const AtomicString& getAttribute(const QualifiedName&) const; diff --git a/engine/core/editing/ReplaceSelectionCommand.cpp b/engine/core/editing/ReplaceSelectionCommand.cpp index f3c2ddeede6..77ba9ad1bfc 100644 --- a/engine/core/editing/ReplaceSelectionCommand.cpp +++ b/engine/core/editing/ReplaceSelectionCommand.cpp @@ -137,8 +137,7 @@ ReplacementFragment::ReplacementFragment(Document* document, DocumentFragment* f else shadowAncestorElement = editableRoot.get(); - if (!editableRoot->getAttributeEventListener(EventTypeNames::webkitBeforeTextInserted) - && editableRoot->rendererIsRichlyEditable()) { + if (editableRoot->rendererIsRichlyEditable()) { removeInterchangeNodes(m_fragment.get()); return; } diff --git a/engine/core/events/EventListener.h b/engine/core/events/EventListener.h index 8552c57c6f3..b62b2dbad9e 100644 --- a/engine/core/events/EventListener.h +++ b/engine/core/events/EventListener.h @@ -25,40 +25,20 @@ namespace blink { - class DOMWrapperWorld; - class Event; - class ExecutionContext; +class Event; +class ExecutionContext; - class EventListener : public RefCounted { - public: - enum Type { - JSEventListenerType, - ImageEventListenerType, - CPPEventListenerType, - ConditionEventListenerType, - NativeEventListenerType, - }; +class EventListener : public RefCounted { +public: + virtual ~EventListener() { } + virtual bool operator==(const EventListener&) = 0; + virtual void handleEvent(ExecutionContext*, Event*) = 0; - virtual ~EventListener() { } - virtual bool operator==(const EventListener&) = 0; - virtual void handleEvent(ExecutionContext*, Event*) = 0; - virtual bool wasCreatedFromMarkup() const { return false; } - virtual bool belongsToTheCurrentWorld() const { return false; } - - bool isAttribute() const { return virtualisAttribute(); } - Type type() const { return m_type; } - - protected: - explicit EventListener(Type type) - : m_type(type) - { - } - - private: - virtual bool virtualisAttribute() const { return false; } - - Type m_type; - }; +protected: + explicit EventListener() + { + } +}; } diff --git a/engine/core/events/EventListenerMap.cpp b/engine/core/events/EventListenerMap.cpp index e2567ed4205..435aabaa128 100644 --- a/engine/core/events/EventListenerMap.cpp +++ b/engine/core/events/EventListenerMap.cpp @@ -169,53 +169,6 @@ EventListenerVector* EventListenerMap::find(const AtomicString& eventType) return 0; } -static void removeFirstListenerCreatedFromMarkup(EventListenerVector* listenerVector) -{ - bool foundListener = false; - - for (size_t i = 0; i < listenerVector->size(); ++i) { - if (!listenerVector->at(i).listener->wasCreatedFromMarkup()) - continue; - foundListener = true; - listenerVector->remove(i); - break; - } - - ASSERT_UNUSED(foundListener, foundListener); -} - -void EventListenerMap::removeFirstEventListenerCreatedFromMarkup(const AtomicString& eventType) -{ - assertNoActiveIterators(); - - for (unsigned i = 0; i < m_entries.size(); ++i) { - if (m_entries[i].first == eventType) { - removeFirstListenerCreatedFromMarkup(m_entries[i].second.get()); - if (m_entries[i].second->isEmpty()) - m_entries.remove(i); - return; - } - } -} - -static void copyListenersNotCreatedFromMarkupToTarget(const AtomicString& eventType, EventListenerVector* listenerVector, EventTarget* target) -{ - for (size_t i = 0; i < listenerVector->size(); ++i) { - // Event listeners created from markup have already been transfered to the shadow tree during cloning. - if ((*listenerVector)[i].listener->wasCreatedFromMarkup()) - continue; - target->addEventListener(eventType, (*listenerVector)[i].listener, (*listenerVector)[i].useCapture); - } -} - -void EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget(EventTarget* target) -{ - assertNoActiveIterators(); - - for (unsigned i = 0; i < m_entries.size(); ++i) - copyListenersNotCreatedFromMarkupToTarget(m_entries[i].first, m_entries[i].second.get(), target); -} - EventListenerIterator::EventListenerIterator() : m_map(0) , m_entryIndex(0) diff --git a/engine/core/events/EventListenerMap.h b/engine/core/events/EventListenerMap.h index 6a9ca1bb670..2693acf8621 100644 --- a/engine/core/events/EventListenerMap.h +++ b/engine/core/events/EventListenerMap.h @@ -57,9 +57,6 @@ public: EventListenerVector* find(const AtomicString& eventType); Vector eventTypes() const; - void removeFirstEventListenerCreatedFromMarkup(const AtomicString& eventType); - void copyEventListenersNotCreatedFromMarkupToTarget(EventTarget*); - private: friend class EventListenerIterator; diff --git a/engine/core/events/EventTarget.cpp b/engine/core/events/EventTarget.cpp index c4ff0cb7d3f..61c6fe6767e 100644 --- a/engine/core/events/EventTarget.cpp +++ b/engine/core/events/EventTarget.cpp @@ -123,33 +123,6 @@ bool EventTarget::removeEventListener(const AtomicString& eventType, PassRefPtr< return true; } -bool EventTarget::setAttributeEventListener(const AtomicString& eventType, PassRefPtr listener) -{ - clearAttributeEventListener(eventType); - if (!listener) - return false; - return addEventListener(eventType, listener, false); -} - -EventListener* EventTarget::getAttributeEventListener(const AtomicString& eventType) -{ - const EventListenerVector& entry = getEventListeners(eventType); - for (size_t i = 0; i < entry.size(); ++i) { - EventListener* listener = entry[i].listener.get(); - if (listener->isAttribute() && listener->belongsToTheCurrentWorld()) - return listener; - } - return 0; -} - -bool EventTarget::clearAttributeEventListener(const AtomicString& eventType) -{ - EventListener* listener = getAttributeEventListener(eventType); - if (!listener) - return false; - return removeEventListener(eventType, listener, false); -} - bool EventTarget::dispatchEvent(PassRefPtrWillBeRawPtr event, ExceptionState& exceptionState) { if (!event) { diff --git a/engine/core/events/EventTarget.h b/engine/core/events/EventTarget.h index 4ed90b8f42e..03fbf3bb148 100644 --- a/engine/core/events/EventTarget.h +++ b/engine/core/events/EventTarget.h @@ -71,7 +71,6 @@ public: // This is the base class for all DOM event targets. To make your class an // EventTarget, follow these steps: // - Make your IDL interface inherit from EventTarget. -// Optionally add "attribute EventHandler onfoo;" attributes. // - Inherit from EventTargetWithInlineData (only in rare cases should you use // EventTarget directly). // - Figure out if you now need to inherit from ActiveDOMObject as well. @@ -80,8 +79,6 @@ public: // WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(YourClassName). Make sure to include // this header file in your .h file, or you will get very strange compiler // errors. -// - If you added an onfoo attribute, use DEFINE_ATTRIBUTE_EVENT_LISTENER(foo) -// in your class declaration. // - Call ScriptWrappable::init(this) in your constructor, unless you are already // doing so. // - Override EventTarget::interfaceName() and executionContext(). The former @@ -120,10 +117,6 @@ public: bool dispatchEvent(PassRefPtrWillBeRawPtr, ExceptionState&); // DOM API virtual void uncaughtExceptionInEventHandler(); - // Used for legacy "onEvent" attribute APIs. - bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr); - EventListener* getAttributeEventListener(const AtomicString& eventType); - bool hasEventListeners() const; bool hasEventListeners(const AtomicString& eventType) const; bool hasCapturingEventListeners(const AtomicString& eventType); @@ -155,8 +148,6 @@ private: void fireEventListeners(Event*, EventTargetData*, EventListenerVector&); void countLegacyEvents(const AtomicString& legacyTypeName, EventListenerVector*, EventListenerVector*); - bool clearAttributeEventListener(const AtomicString& eventType); - friend class EventListenerIterator; }; @@ -168,52 +159,6 @@ private: EventTargetData m_eventTargetData; }; -// FIXME: These macros should be split into separate DEFINE and DECLARE -// macros to avoid causing so many header includes. -#define DEFINE_ATTRIBUTE_EVENT_LISTENER(attribute) \ - EventListener* on##attribute() { return getAttributeEventListener(EventTypeNames::attribute); } \ - void setOn##attribute(PassRefPtr listener) { setAttributeEventListener(EventTypeNames::attribute, listener); } \ - -#define DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(attribute) \ - static EventListener* on##attribute(EventTarget& eventTarget) { return eventTarget.getAttributeEventListener(EventTypeNames::attribute); } \ - static void setOn##attribute(EventTarget& eventTarget, PassRefPtr listener) { eventTarget.setAttributeEventListener(EventTypeNames::attribute, listener); } \ - -#define DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(attribute) \ - EventListener* on##attribute() { return document().getWindowAttributeEventListener(EventTypeNames::attribute); } \ - void setOn##attribute(PassRefPtr listener) { document().setWindowAttributeEventListener(EventTypeNames::attribute, listener); } \ - -#define DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(attribute) \ - static EventListener* on##attribute(EventTarget& eventTarget) { \ - if (Node* node = eventTarget.toNode()) \ - return node->document().getWindowAttributeEventListener(EventTypeNames::attribute); \ - ASSERT(eventTarget.toDOMWindow()); \ - return eventTarget.getAttributeEventListener(EventTypeNames::attribute); \ - } \ - static void setOn##attribute(EventTarget& eventTarget, PassRefPtr listener) { \ - if (Node* node = eventTarget.toNode()) \ - node->document().setWindowAttributeEventListener(EventTypeNames::attribute, listener); \ - else { \ - ASSERT(eventTarget.toDOMWindow()); \ - eventTarget.setAttributeEventListener(EventTypeNames::attribute, listener); \ - } \ - } - -#define DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(attribute, eventName) \ - EventListener* on##attribute() { return getAttributeEventListener(EventTypeNames::eventName); } \ - void setOn##attribute(PassRefPtr listener) { setAttributeEventListener(EventTypeNames::eventName, listener); } \ - -#define DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(recipient, attribute) \ - EventListener* on##attribute(); \ - void setOn##attribute(PassRefPtr listener); - -#define DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER(type, recipient, attribute) \ - EventListener* type::on##attribute() { return recipient ? recipient->getAttributeEventListener(EventTypeNames::attribute) : 0; } \ - void type::setOn##attribute(PassRefPtr listener) \ - { \ - if (recipient) \ - recipient->setAttributeEventListener(EventTypeNames::attribute, listener); \ - } - inline bool EventTarget::hasEventListeners() const { // FIXME: We should have a const version of eventTargetData. diff --git a/engine/core/frame/DOMWindowEventHandlers.h b/engine/core/frame/DOMWindowEventHandlers.h deleted file mode 100644 index b7cae609829..00000000000 --- a/engine/core/frame/DOMWindowEventHandlers.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2013, Opera Software ASA. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Opera Software ASA nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DOMWindowEventHandlers_h -#define DOMWindowEventHandlers_h - -#include "core/events/EventTarget.h" - -namespace blink { - -namespace DOMWindowEventHandlers { -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(hashchange); -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(languagechange); -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(message); -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(offline); -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(online); -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(pagehide); -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(pageshow); -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(popstate); -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(storage); -DEFINE_STATIC_WINDOW_ATTRIBUTE_EVENT_LISTENER(unload); -} - -} // namespace - -#endif diff --git a/engine/core/frame/LocalDOMWindow.h b/engine/core/frame/LocalDOMWindow.h index b18ed310838..29ad0b36cbf 100644 --- a/engine/core/frame/LocalDOMWindow.h +++ b/engine/core/frame/LocalDOMWindow.h @@ -194,24 +194,11 @@ public: void dispatchLoadEvent(); - DEFINE_ATTRIBUTE_EVENT_LISTENER(animationend); - DEFINE_ATTRIBUTE_EVENT_LISTENER(animationiteration); - DEFINE_ATTRIBUTE_EVENT_LISTENER(animationstart); - DEFINE_ATTRIBUTE_EVENT_LISTENER(search); - DEFINE_ATTRIBUTE_EVENT_LISTENER(transitionend); - DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel); - // This is the interface orientation in degrees. Some examples are: // 0 is straight up; -90 is when the device is rotated 90 clockwise; // 90 is when rotated counter clockwise. int orientation() const; - DEFINE_ATTRIBUTE_EVENT_LISTENER(orientationchange); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchstart); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); - DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); - void willDetachDocumentFromFrame(); bool isInsecureScriptAccess(LocalDOMWindow& callingWindow, const String& urlString); diff --git a/engine/core/frame/Window.idl b/engine/core/frame/Window.idl index 5daac653f0a..11e7964b002 100644 --- a/engine/core/frame/Window.idl +++ b/engine/core/frame/Window.idl @@ -112,19 +112,6 @@ [Replaceable] readonly attribute CSS CSS; - // Event handler attributes - [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationend; - [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationiteration; - [RuntimeEnabled=CSSAnimationUnprefixed] attribute EventHandler onanimationstart; - [RuntimeEnabled=OrientationEvent] attribute EventHandler onorientationchange; - attribute EventHandler onsearch; - [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; - [RuntimeEnabled=Touch] attribute EventHandler ontouchend; - [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; - [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; - attribute EventHandler ontransitionend; - attribute EventHandler onwheel; - // window.toString() requires special handling in V8 [DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] stringifier; @@ -133,5 +120,4 @@ }; Window implements WindowBase64; -Window implements WindowEventHandlers; Window implements WindowTimers; diff --git a/engine/core/frame/WindowEventHandlers.idl b/engine/core/frame/WindowEventHandlers.idl deleted file mode 100644 index 594fdbc1f7b..00000000000 --- a/engine/core/frame/WindowEventHandlers.idl +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2013, Opera Software ASA. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Opera Software ASA nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#windoweventhandlers - -[ - ImplementedAs=DOMWindowEventHandlers, - LegacyTreatAsPartialInterface, - NoInterfaceObject, // Always used on target of 'implements' -] interface WindowEventHandlers { - //attribute EventHandler onafterprint; - //attribute EventHandler onbeforeprint; - attribute EventHandler onhashchange; - attribute EventHandler onlanguagechange; - attribute EventHandler onmessage; - attribute EventHandler onoffline; - attribute EventHandler ononline; - attribute EventHandler onpagehide; - attribute EventHandler onpageshow; - attribute EventHandler onpopstate; - attribute EventHandler onstorage; - attribute EventHandler onunload; -}; diff --git a/engine/core/html/ime/InputMethodContext.h b/engine/core/html/ime/InputMethodContext.h index 67a45d48346..b7f95f63149 100644 --- a/engine/core/html/ime/InputMethodContext.h +++ b/engine/core/html/ime/InputMethodContext.h @@ -71,10 +71,6 @@ public: virtual const AtomicString& interfaceName() const OVERRIDE; virtual ExecutionContext* executionContext() const OVERRIDE; - DEFINE_ATTRIBUTE_EVENT_LISTENER(candidatewindowshow); - DEFINE_ATTRIBUTE_EVENT_LISTENER(candidatewindowupdate); - DEFINE_ATTRIBUTE_EVENT_LISTENER(candidatewindowhide); - void dispatchCandidateWindowShowEvent(); void dispatchCandidateWindowUpdateEvent(); void dispatchCandidateWindowHideEvent(); diff --git a/engine/core/html/ime/InputMethodContext.idl b/engine/core/html/ime/InputMethodContext.idl index 043feed06ba..d42f1593968 100644 --- a/engine/core/html/ime/InputMethodContext.idl +++ b/engine/core/html/ime/InputMethodContext.idl @@ -36,8 +36,4 @@ interface InputMethodContext : EventTarget { readonly attribute unsigned long compositionEndOffset; void confirmComposition(); - - attribute EventHandler oncandidatewindowshow; - attribute EventHandler oncandidatewindowupdate; - attribute EventHandler oncandidatewindowhide; };