Commit c2eaba9e authored by mjs's avatar mjs
Browse files

Reviewed by Ken.

	- fixed 3083814 - dhtml at www.bayarea.com doesn't hide on some mouse movements

        * khtml/ecma/kjs_events.h:
        * khtml/ecma/kjs_events.cpp:
        (DOMUIEvent::getValueProperty): Implemented pageX and pageY properties.
        * khtml/ecma/kjs_events.lut.h: Regenerated.
        * khtml/dom/dom2_events.h:
        * khtml/dom/dom2_events.cpp:
        (UIEvent::pageX): Get x coordinate if a mouse event.
        (UIEvent::pageY): Get y coordinate if a mouse event.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 257f3ec5
2002-12-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Ken.
- fixed 3083814 - dhtml at www.bayarea.com doesn't hide on some mouse movements
* khtml/ecma/kjs_events.h:
* khtml/ecma/kjs_events.cpp:
(DOMUIEvent::getValueProperty): Implemented pageX and pageY properties.
* khtml/ecma/kjs_events.lut.h: Regenerated.
* khtml/dom/dom2_events.h:
* khtml/dom/dom2_events.cpp:
(UIEvent::pageX): Get x coordinate if a mouse event.
(UIEvent::pageY): Get y coordinate if a mouse event.
2002-12-13 Richard Williamson <rjw@apple.com>
Fixed 3127225. Set WebCore object cache size when first bridge is created.
......
2002-12-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Ken.
- fixed 3083814 - dhtml at www.bayarea.com doesn't hide on some mouse movements
* khtml/ecma/kjs_events.h:
* khtml/ecma/kjs_events.cpp:
(DOMUIEvent::getValueProperty): Implemented pageX and pageY properties.
* khtml/ecma/kjs_events.lut.h: Regenerated.
* khtml/dom/dom2_events.h:
* khtml/dom/dom2_events.cpp:
(UIEvent::pageX): Get x coordinate if a mouse event.
(UIEvent::pageY): Get y coordinate if a mouse event.
2002-12-13 Richard Williamson <rjw@apple.com>
Fixed 3127225. Set WebCore object cache size when first bridge is created.
......
......@@ -267,6 +267,33 @@ int UIEvent::keyCode() const
return 0;
}
int UIEvent::pageX() const
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
MouseEventImpl *mouseEvent = dynamic_cast<MouseEventImpl*>(impl);
if (mouseEvent)
return mouseEvent->clientX();
else
return 0;
}
int UIEvent::pageY() const
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
MouseEventImpl *mouseEvent = dynamic_cast<MouseEventImpl*>(impl);
if (mouseEvent)
return mouseEvent->clientY();
else
return 0;
}
void UIEvent::initUIEvent(const DOMString &typeArg,
bool canBubbleArg,
bool cancelableArg,
......
......@@ -327,6 +327,13 @@ public:
*/
int keyCode() const;
/**
* Non-standard extensions to support Netscape-style pageX and pageY event property.
*
*/
int pageX() const;
int pageY() const;
/**
* The initUIEvent method is used to initialize the value of a UIEvent
* created through the DocumentEvent interface. This method may only be
......
......@@ -339,10 +339,12 @@ Value KJS::getEventExceptionConstructor(ExecState *exec)
const ClassInfo DOMUIEvent::info = { "UIEvent", &DOMEvent::info, &DOMUIEventTable, 0 };
/*
@begin DOMUIEventTable 3
@begin DOMUIEventTable 5
view DOMUIEvent::View DontDelete|ReadOnly
detail DOMUIEvent::Detail DontDelete|ReadOnly
keyCode DOMUIEvent::KeyCode DontDelete|ReadOnly
pageX DOMUIEvent::PageX DontDelete|ReadOnly
pageY DOMUIEvent::PageY DontDelete|ReadOnly
@end
@begin DOMUIEventProtoTable 1
initUIEvent DOMUIEvent::InitUIEvent DontDelete|Function 5
......@@ -370,9 +372,13 @@ Value DOMUIEvent::getValueProperty(ExecState *exec, int token) const
return Number(static_cast<DOM::UIEvent>(event).detail());
case KeyCode:
return Number(static_cast<DOM::UIEvent>(event).keyCode());
case PageX:
return Number(static_cast<DOM::UIEvent>(event).pageX());
case PageY:
return Number(static_cast<DOM::UIEvent>(event).pageY());
default:
kdWarning() << "Unhandled token in DOMUIEvent::getValueProperty : " << token << endl;
return Value();
return Undefined();
}
}
......
......@@ -107,7 +107,7 @@ namespace KJS {
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
enum { View, Detail, KeyCode, InitUIEvent };
enum { View, Detail, KeyCode, PageX, PageY, InitUIEvent };
DOM::UIEvent toUIEvent() const { return static_cast<DOM::UIEvent>(event); }
};
......
......@@ -76,13 +76,16 @@ const struct HashTable EventExceptionConstructorTable = { 2, 1, EventExceptionCo
namespace KJS {
const struct HashEntry DOMUIEventTableEntries[] = {
{ "detail", DOMUIEvent::Detail, DontDelete|ReadOnly, 0, &DOMUIEventTableEntries[3] },
{ 0, 0, 0, 0, 0 },
{ "view", DOMUIEvent::View, DontDelete|ReadOnly, 0, 0 },
{ "keyCode", DOMUIEvent::KeyCode, DontDelete|ReadOnly, 0, 0 }
{ "pageX", DOMUIEvent::PageX, DontDelete|ReadOnly, 0, 0 },
{ "detail", DOMUIEvent::Detail, DontDelete|ReadOnly, 0, &DOMUIEventTableEntries[6] },
{ "view", DOMUIEvent::View, DontDelete|ReadOnly, 0, &DOMUIEventTableEntries[5] },
{ 0, 0, 0, 0, 0 },
{ "keyCode", DOMUIEvent::KeyCode, DontDelete|ReadOnly, 0, 0 },
{ "pageY", DOMUIEvent::PageY, DontDelete|ReadOnly, 0, 0 }
};
const struct HashTable DOMUIEventTable = { 2, 4, DOMUIEventTableEntries, 3 };
const struct HashTable DOMUIEventTable = { 2, 7, DOMUIEventTableEntries, 5 };
}; // namespace
......
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