Commit a35854d8 authored by weinig's avatar weinig

LayoutTests:

        Reviewed by Geoff.

        Update tests for http://bugs.webkit.org/show_bug.cgi?id=14111
        Autogenerate Event JS binding

        * fast/dom/prototype-chain-expected.txt: DOMEventPrototype is no longer
        in the prototype chain.
        * fast/dom/xmlhttprequest-get-expected.txt:

WebCore:

        Reviewed by Geoff.

        Patch for http://bugs.webkit.org/show_bug.cgi?id=14111
        Autogenerate Event JS binding

        - Moves the dataTransfer method into MouseEvent where it should be.

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSEventCustom.cpp: Added.
        (WebCore::JSEvent::clipboardData):
        (WebCore::toJS):
        * bindings/js/JSEventTargetNode.cpp:
        * bindings/js/JSXMLHttpRequest.cpp:
        * bindings/js/kjs_events.cpp:
        * bindings/js/kjs_events.h:
        * bindings/objc/DOMUtility.mm:
        (KJS::createDOMWrapper):
        * bindings/scripts/CodeGeneratorJS.pm:
        * dom/Event.h:
        (WebCore::Event::returnValue):
        (WebCore::Event::setReturnValue):
        (WebCore::Event::clipboardData):
        * dom/Event.idl:
        * dom/MouseEvent.h:
        (WebCore::MouseEvent::dataTransfer):
        * dom/MouseEvent.idl:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0304a748
2007-06-26 Sam Weinig <sam@webkit.org>
Reviewed by Geoff.
Update tests for http://bugs.webkit.org/show_bug.cgi?id=14111
Autogenerate Event JS binding
* fast/dom/prototype-chain-expected.txt: DOMEventPrototype is no longer
in the prototype chain.
* fast/dom/xmlhttprequest-get-expected.txt:
2007-06-26 Justin Garcia <justin.garcia@apple.com>
Reviewed by John.
......@@ -42,34 +42,28 @@ NOTE: This test will start failing if you change the layout of a related prototy
[object HTMLFormElementPrototype]
----- [object UIEvent] (4 prototypes) -----
----- [object UIEvent] (3 prototypes) -----
[object Object]
[object DOMEventPrototype]
[object EventPrototype]
[object UIEventPrototype]
----- [object MouseEvent] (5 prototypes) -----
----- [object MouseEvent] (4 prototypes) -----
[object Object]
[object DOMEventPrototype]
[object EventPrototype]
[object UIEventPrototype]
[object MouseEventPrototype]
----- [object KeyboardEvent] (5 prototypes) -----
----- [object KeyboardEvent] (4 prototypes) -----
[object Object]
[object DOMEventPrototype]
[object EventPrototype]
[object UIEventPrototype]
......
......@@ -47,7 +47,6 @@ cancelBubble : 'false'
cancelable : 'true'
clipboardData : 'undefined'
currentTarget : '[object JSXMLHttpRequest]'
dataTransfer : 'undefined'
eventPhase : '0'
initEvent : '
function initEvent() {
......
2007-06-26 Sam Weinig <sam@webkit.org>
Reviewed by Geoff.
Patch for http://bugs.webkit.org/show_bug.cgi?id=14111
Autogenerate Event JS binding
- Moves the dataTransfer method into MouseEvent where it should be.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSEventCustom.cpp: Added.
(WebCore::JSEvent::clipboardData):
(WebCore::toJS):
* bindings/js/JSEventTargetNode.cpp:
* bindings/js/JSXMLHttpRequest.cpp:
* bindings/js/kjs_events.cpp:
* bindings/js/kjs_events.h:
* bindings/objc/DOMUtility.mm:
(KJS::createDOMWrapper):
* bindings/scripts/CodeGeneratorJS.pm:
* dom/Event.h:
(WebCore::Event::returnValue):
(WebCore::Event::setReturnValue):
(WebCore::Event::clipboardData):
* dom/Event.idl:
* dom/MouseEvent.h:
(WebCore::MouseEvent::dataTransfer):
* dom/MouseEvent.idl:
2007-06-26 Timothy Hatcher <timothy@apple.com>
Reviewed by Mark Rowe.
......@@ -2956,6 +2956,7 @@
BCEC01D70C274EB4009F4EC9 /* PlatformScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEC01D60C274EB4009F4EC9 /* PlatformScreen.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCEF3434087B563E00BBF833 /* HTMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEF3432087B563E00BBF833 /* HTMLElementFactory.cpp */; };
BCEF3435087B563E00BBF833 /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEF3433087B563E00BBF833 /* HTMLElementFactory.h */; };
BCEFAF4E0C317E6900FA81F6 /* JSEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */; };
BCF7C0780A1680C00032F75B /* FontFallbackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF7C0770A1680C00032F75B /* FontFallbackList.cpp */; };
BCF7C0B80A1687CC0032F75B /* FontCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF7C0B70A1687CC0032F75B /* FontCache.h */; };
BCF7C2340A16B5F80032F75B /* FontCacheMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCF7C2330A16B5F80032F75B /* FontCacheMac.mm */; };
......@@ -6275,6 +6276,7 @@
BCEC01D60C274EB4009F4EC9 /* PlatformScreen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformScreen.h; sourceTree = "<group>"; };
BCEF3432087B563E00BBF833 /* HTMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElementFactory.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BCEF3433087B563E00BBF833 /* HTMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElementFactory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventCustom.cpp; sourceTree = "<group>"; };
BCF7C0770A1680C00032F75B /* FontFallbackList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontFallbackList.cpp; sourceTree = "<group>"; };
BCF7C0B70A1687CC0032F75B /* FontCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontCache.h; sourceTree = "<group>"; };
BCF7C2330A16B5F80032F75B /* FontCacheMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FontCacheMac.mm; sourceTree = "<group>"; };
......@@ -9356,6 +9358,7 @@
BC20FB7E0C0E8E6C00D1447F /* JSCSSValueCustom.cpp */,
929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */,
BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */,
BCCBAD3A0C18BFF800CE890F /* JSHTMLCollectionCustom.cpp */,
BC51580A0C03D404008BB0EE /* JSHTMLDocumentCustom.cpp */,
......@@ -13059,6 +13062,7 @@
BC94D14E0C275C68006BC617 /* JSHistory.cpp in Sources */,
BC94D1530C275C8B006BC617 /* History.cpp in Sources */,
BC94D1590C275CB6006BC617 /* GlobalHistoryMac.mm in Sources */,
BCEFAF4E0C317E6900FA81F6 /* JSEventCustom.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/*
* Copyright (C) 2007 Apple Inc. 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 Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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.
*/
#include "config.h"
#include "JSEvent.h"
#include "Clipboard.h"
#include "Event.h"
#include "JSKeyboardEvent.h"
#include "JSMouseEvent.h"
#include "JSMutationEvent.h"
#include "JSOverflowEvent.h"
#include "JSTextEvent.h"
#include "JSUIEvent.h"
#include "JSWheelEvent.h"
#include "KeyboardEvent.h"
#include "MouseEvent.h"
#include "MutationEvent.h"
#include "OverflowEvent.h"
#include "TextEvent.h"
#include "UIEvent.h"
#include "WheelEvent.h"
#include "kjs_events.h"
namespace WebCore {
KJS::JSValue* JSEvent::clipboardData(KJS::ExecState* exec) const
{
return impl()->isClipboardEvent() ? toJS(exec, impl()->clipboardData()) : KJS::jsUndefined();
}
KJS::JSValue* toJS(KJS::ExecState* exec, Event* event)
{
KJS::JSLock lock;
if (!event)
return KJS::jsNull();
KJS::ScriptInterpreter* interp = static_cast<KJS::ScriptInterpreter*>(exec->dynamicInterpreter());
KJS::DOMObject* ret = interp->getDOMObject(event);
if (ret)
return ret;
if (event->isKeyboardEvent())
ret = new JSKeyboardEvent(exec, static_cast<KeyboardEvent*>(event));
else if (event->isTextEvent())
ret = new JSTextEvent(exec, static_cast<TextEvent*>(event));
else if (event->isMouseEvent())
ret = new JSMouseEvent(exec, static_cast<MouseEvent*>(event));
else if (event->isWheelEvent())
ret = new JSWheelEvent(exec, static_cast<WheelEvent*>(event));
else if (event->isUIEvent())
ret = new JSUIEvent(exec, static_cast<UIEvent*>(event));
else if (event->isMutationEvent())
ret = new JSMutationEvent(exec, static_cast<MutationEvent*>(event));
else if (event->isOverflowEvent())
ret = new JSOverflowEvent(exec, static_cast<OverflowEvent*>(event));
else
ret = new JSEvent(exec, event);
interp->putDOMObject(event, ret);
return ret;
}
} // namespace WebCore
......@@ -31,6 +31,7 @@
#include "EventListener.h"
#include "EventNames.h"
#include "EventTargetNode.h"
#include "JSEvent.h"
#include "Node.h"
#include "kjs_events.h"
#include "kjs_window.h"
......
......@@ -26,16 +26,17 @@
#include "FrameLoader.h"
#include "HTMLDocument.h"
#include "JSDocument.h"
#include "JSEvent.h"
#include "kjs_events.h"
#include "kjs_window.h"
#include "xmlhttprequest.h"
#include "JSXMLHttpRequest.lut.h"
using namespace WebCore;
namespace KJS {
using namespace WebCore;
////////////////////// JSXMLHttpRequest Object ////////////////////////
/* Source for JSXMLHttpRequestPrototypeTable.
......
......@@ -362,167 +362,6 @@ JSValue* getNodeEventListener(EventTargetNode* n, const AtomicString& eventType)
// -------------------------------------------------------------------------
const ClassInfo DOMEvent::info = { "Event", 0, &DOMEventTable, 0 };
/*
@begin DOMEventTable 12
type DOMEvent::Type DontDelete|ReadOnly
target DOMEvent::Target DontDelete|ReadOnly
currentTarget DOMEvent::CurrentTarget DontDelete|ReadOnly
srcElement DOMEvent::SrcElement DontDelete|ReadOnly
eventPhase DOMEvent::EventPhase DontDelete|ReadOnly
bubbles DOMEvent::Bubbles DontDelete|ReadOnly
cancelable DOMEvent::Cancelable DontDelete|ReadOnly
timeStamp DOMEvent::TimeStamp DontDelete|ReadOnly
returnValue DOMEvent::ReturnValue DontDelete
cancelBubble DOMEvent::CancelBubble DontDelete
dataTransfer DOMEvent::DataTransfer DontDelete|ReadOnly
clipboardData DOMEvent::ClipboardData DontDelete|ReadOnly
@end
@begin DOMEventPrototypeTable 3
stopPropagation DOMEvent::StopPropagation DontDelete|Function 0
preventDefault DOMEvent::PreventDefault DontDelete|Function 0
initEvent DOMEvent::InitEvent DontDelete|Function 3
@end
*/
KJS_IMPLEMENT_PROTOTYPE_FUNCTION(DOMEventPrototypeFunction)
KJS_IMPLEMENT_PROTOTYPE("DOMEvent", DOMEventPrototype, DOMEventPrototypeFunction)
DOMEvent::DOMEvent(ExecState* exec, Event* event)
: m_impl(event)
{
setPrototype(DOMEventPrototype::self(exec));
}
DOMEvent::~DOMEvent()
{
ScriptInterpreter::forgetDOMObject(m_impl.get());
}
bool DOMEvent::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<DOMEvent, DOMObject>(exec, &DOMEventTable, this, propertyName, slot);
}
JSValue* DOMEvent::getValueProperty(ExecState* exec, int token) const
{
Event* event = impl();
switch (token) {
case Type:
return jsString(event->type());
case Target:
return toJS(exec, event->target());
case SrcElement:
return toJS(exec, event->srcElement());
case CurrentTarget:
return toJS(exec, event->currentTarget());
case EventPhase:
return jsNumber(event->eventPhase());
case Bubbles:
return jsBoolean(event->bubbles());
case CancelBubble:
return jsBoolean(event->cancelBubble());
case ReturnValue:
return jsBoolean(event->returnValue());
case Cancelable:
return jsBoolean(event->cancelable());
case TimeStamp:
return jsNumber(event->timeStamp());
case ClipboardData:
if (event->isClipboardEvent())
return toJS(exec, event->clipboardData());
return jsUndefined();
case DataTransfer:
if (event->isDragEvent())
return toJS(exec, event->dataTransfer());
return jsUndefined();
default:
return 0;
}
}
void DOMEvent::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
{
lookupPut<DOMEvent, DOMObject>(exec, propertyName, value, attr, &DOMEventTable, this);
}
void DOMEvent::putValueProperty(ExecState* exec, int token, JSValue* value, int)
{
Event* event = m_impl.get();
switch (token) {
case ReturnValue:
event->setDefaultPrevented(!value->toBoolean(exec));
break;
case CancelBubble:
event->setCancelBubble(value->toBoolean(exec));
break;
default:
break;
}
}
JSValue* DOMEventPrototypeFunction::callAsFunction(ExecState *exec, JSObject * thisObj, const List &args)
{
if (!thisObj->inherits(&DOMEvent::info))
return throwError(exec, TypeError);
Event* event = static_cast<DOMEvent*>(thisObj)->impl();
switch (id) {
case DOMEvent::StopPropagation:
event->stopPropagation();
return jsUndefined();
case DOMEvent::PreventDefault:
event->preventDefault();
return jsUndefined();
case DOMEvent::InitEvent:
event->initEvent(AtomicString(args[0]->toString(exec)), args[1]->toBoolean(exec), args[2]->toBoolean(exec));
return jsUndefined();
};
return jsUndefined();
}
JSValue* toJS(ExecState* exec, Event* event)
{
if (!event)
return jsNull();
ScriptInterpreter* interp = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter());
JSLock lock;
DOMObject* ret = interp->getDOMObject(event);
if (ret)
return ret;
if (event->isKeyboardEvent())
ret = new JSKeyboardEvent(exec, static_cast<KeyboardEvent*>(event));
else if (event->isTextEvent())
ret = new JSTextEvent(exec, static_cast<TextEvent*>(event));
else if (event->isMouseEvent())
ret = new JSMouseEvent(exec, static_cast<MouseEvent*>(event));
else if (event->isWheelEvent())
ret = new JSWheelEvent(exec, static_cast<WheelEvent*>(event));
else if (event->isUIEvent())
ret = new JSUIEvent(exec, static_cast<UIEvent*>(event));
else if (event->isMutationEvent())
ret = new JSMutationEvent(exec, static_cast<MutationEvent*>(event));
else if (event->isOverflowEvent())
ret = new JSOverflowEvent(exec, static_cast<OverflowEvent*>(event));
else
ret = new JSEvent(exec, event);
interp->putDOMObject(event, ret);
return ret;
}
Event* toEvent(JSValue* val)
{
if (!val || !val->isObject(&DOMEvent::info))
return 0;
return static_cast<DOMEvent*>(val)->impl();
}
// -------------------------------------------------------------------------
const ClassInfo JSClipboard::info = { "Clipboard", 0, &JSClipboardTable, 0 };
/* Source for JSClipboardTable. Use "make hashtables" to regenerate.
......
......@@ -94,40 +94,6 @@ namespace KJS {
JSValue* getNodeEventListener(WebCore::Node* n, const WebCore::AtomicString& eventType);
class DOMEvent : public DOMObject {
public:
DOMEvent(ExecState*, WebCore::Event*);
virtual ~DOMEvent();
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
JSValue* getValueProperty(ExecState*, int token) const;
virtual void put(ExecState*, const Identifier&, JSValue*, int attr = None);
void putValueProperty(ExecState*, int token, JSValue*, int attr);
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum {
Type, Target, CurrentTarget, EventPhase,
Bubbles, Cancelable, TimeStamp, StopPropagation,
PreventDefault, InitEvent,
// MS IE equivalents
SrcElement, ReturnValue, CancelBubble, ClipboardData,
DataTransfer
};
WebCore::Event* impl() const { return m_impl.get(); }
protected:
RefPtr<WebCore::Event> m_impl;
};
JSValue* toJS(ExecState*, WebCore::Event*);
WebCore::Event* toEvent(JSValue*); // returns 0 if value is not a DOMEvent object
KJS_DEFINE_PROTOTYPE(DOMEventPrototype)
class JSClipboard : public DOMObject {
friend class JSClipboardPrototypeFunction;
public:
......
......@@ -78,6 +78,7 @@ static inline id createDOMWrapper(KJS::JSObject* object)
WRAP(CSSStyleDeclaration)
WRAP(CSSValue)
WRAP(Counter)
WRAP(Event)
WRAP(HTMLOptionsCollection)
WRAP(MediaList)
WRAP(NamedNodeMap)
......@@ -97,14 +98,6 @@ static inline id createDOMWrapper(KJS::JSObject* object)
#undef WRAP
#define WRAP(className) \
if (object->inherits(&DOM##className::info)) \
return [objc_getClass("DOM" #className) _wrap##className:static_cast<DOM##className*>(object)->impl()];
WRAP(Event)
#undef WRAP
if (object->inherits(&Window::info))
return [DOMAbstractView _wrapAbstractView:static_cast<Window*>(object)->impl()];
if (object->inherits(&WebCore::JSDOMImplementation::info))
......
......@@ -158,7 +158,7 @@ sub UsesManualToJSImplementation
{
my $type = shift;
return 1 if $type eq "Node" or $type eq "Document" or $type eq "HTMLCollection" or $type eq "SVGPathSeg" or $type eq "StyleSheet" or $type eq "CSSRule" or $type eq "CSSValue";
return 1 if $type eq "Node" or $type eq "Document" or $type eq "HTMLCollection" or $type eq "SVGPathSeg" or $type eq "StyleSheet" or $type eq "CSSRule" or $type eq "CSSValue" or $type eq "Event";
return 0;
}
......@@ -1404,7 +1404,7 @@ sub NativeToJSValue
my $type = $codeGenerator->StripModule($signature->type);
return "jsBoolean($value)" if $type eq "boolean";
return "jsNumber($value)" if $codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType";
return "jsNumber($value)" if $codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType" or $type eq "DOMTimeStamp";
if ($codeGenerator->IsStringType($type)) {
$implIncludes{"PlatformString.h"} = 1;
......@@ -1474,9 +1474,6 @@ sub NativeToJSValue
$implIncludes{"EventTargetNode.h"} = 1;
$implIncludes{"JSEventTargetNode.h"} = 1;
$implIncludes{"kjs_dom.h"} = 1;
} elsif ($type eq "Event") {
$implIncludes{"kjs_events.h"} = 1;
$implIncludes{"Event.h"} = 1;
} elsif ($type eq "HTMLCanvasElement") {
$implIncludes{"kjs_dom.h"} = 1;
$implIncludes{"HTMLCanvasElement.h"} = 1;
......@@ -1484,6 +1481,9 @@ sub NativeToJSValue
$implIncludes{"kjs_window.h"} = 1;
} elsif ($type eq "DOMObject") {
$implIncludes{"JSCanvasRenderingContext2D.h"} = 1;
} elsif ($type eq "Clipboard") {
$implIncludes{"kjs_events.h"} = 1;
$implIncludes{"Clipboard.h"} = 1;
} elsif ($type =~ /SVGPathSeg/) {
$implIncludes{"JS$type.h"} = 1;
$joinedName = $type;
......
......@@ -93,9 +93,11 @@ namespace WebCore {
// IE Extensions
EventTarget* srcElement() const { return target(); } // MSIE extension - "the object that fired the event"
bool returnValue() const { return !m_defaultPrevented; }
bool returnValue() const { return !defaultPrevented(); }
void setReturnValue(bool returnValue) { setDefaultPrevented(!returnValue); }
Clipboard* clipboardData() const { return isClipboardEvent() ? clipboard() : 0; }
Clipboard* dataTransfer() const { return isMouseEvent() ? clipboard() : 0; }
virtual bool isUIEvent() const;
virtual bool isMouseEvent() const;
......
/*
* Copyright (C) 2006 Apple Computer, Inc.
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
......@@ -21,7 +21,7 @@
module events {
// Introduced in DOM Level 2:
interface [LegacyParent=KJS::DOMEvent, GenerateConstructor, ObjCCustomInternalImpl] Event {
interface [GenerateConstructor, ObjCCustomInternalImpl] Event {
// DOM PhaseType
const unsigned short CAPTURING_PHASE = 1;
......@@ -48,7 +48,6 @@ module events {
const unsigned short CHANGE = 32768;
#endif
#if !defined(LANGUAGE_JAVASCRIPT)
readonly attribute DOMString type;
readonly attribute EventTarget target;
readonly attribute EventTarget currentTarget;
......@@ -61,6 +60,14 @@ module events {
[OldStyleObjC] void initEvent(in DOMString eventTypeArg,
in boolean canBubbleArg,
in boolean cancelableArg);
// IE Extensions
readonly attribute EventTarget srcElement;
attribute boolean returnValue;
attribute boolean cancelBubble;
#if defined(LANGUAGE_JAVASCRIPT)
readonly attribute [Custom] Clipboard clipboardData;
#endif
};
......
......@@ -58,6 +58,8 @@ namespace WebCore {
Node* toElement() const;
Node* fromElement() const;
Clipboard* dataTransfer() const { return isDragEvent() ? m_clipboard.get() : 0; }
virtual bool isMouseEvent() const;
virtual bool isDragEvent() const;
virtual int which() const;
......
/*
* Copyright (C) 2006 Apple Computer, Inc.
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -55,6 +55,10 @@ module events {
readonly attribute long y;
readonly attribute Node fromElement;
readonly attribute Node toElement;
#if defined(LANGUAGE_JAVASCRIPT)
readonly attribute Clipboard dataTransfer;
#endif
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment