[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:14:55 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 1b19b27946a771df260027bf784ec4e6fca6bcf8
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Dec 15 01:48:23 2002 +0000
Reviewed by Maciej
Fix for this bug:
Radar 3128159 (Netscape non-standard DOM event attribute "which" unsupported)
* khtml/dom/dom2_events.cpp:
(UIEvent::which): Added which() definition.
* khtml/dom/dom2_events.h: Added declarations for which() functions in UIEvent.
* khtml/ecma/kjs_events.cpp:
(DOMUIEvent::getValueProperty): Added which property.
* khtml/ecma/kjs_events.h: Ditto.
* khtml/ecma/kjs_events.lut.h: File regenerated.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index b2fe684..51eed9c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,19 @@
+2002-12-14 Ken Kocienda <kocienda at apple.com>
+
+ Reviewed by Maciej
+
+ Fix for this bug:
+
+ Radar 3128159 (Netscape non-standard DOM event attribute "which" unsupported)
+
+ * khtml/dom/dom2_events.cpp:
+ (UIEvent::which): Added which() definition.
+ * khtml/dom/dom2_events.h: Added declarations for which() functions in UIEvent.
+ * khtml/ecma/kjs_events.cpp:
+ (DOMUIEvent::getValueProperty): Added which property.
+ * khtml/ecma/kjs_events.h: Ditto.
+ * khtml/ecma/kjs_events.lut.h: File regenerated.
+
2002-12-13 Richard Williamson <rjw at apple.com>
Fixed 3127310 and 3127920.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index b2fe684..51eed9c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,19 @@
+2002-12-14 Ken Kocienda <kocienda at apple.com>
+
+ Reviewed by Maciej
+
+ Fix for this bug:
+
+ Radar 3128159 (Netscape non-standard DOM event attribute "which" unsupported)
+
+ * khtml/dom/dom2_events.cpp:
+ (UIEvent::which): Added which() definition.
+ * khtml/dom/dom2_events.h: Added declarations for which() functions in UIEvent.
+ * khtml/ecma/kjs_events.cpp:
+ (DOMUIEvent::getValueProperty): Added which property.
+ * khtml/ecma/kjs_events.h: Ditto.
+ * khtml/ecma/kjs_events.lut.h: File regenerated.
+
2002-12-13 Richard Williamson <rjw at apple.com>
Fixed 3127310 and 3127920.
diff --git a/WebCore/khtml/dom/dom2_events.cpp b/WebCore/khtml/dom/dom2_events.cpp
index ad93d86..db3d381 100644
--- a/WebCore/khtml/dom/dom2_events.cpp
+++ b/WebCore/khtml/dom/dom2_events.cpp
@@ -315,6 +315,29 @@ int UIEvent::layerY() const
return 0;
}
+int UIEvent::which() const
+{
+ if (!impl)
+ throw DOMException(DOMException::INVALID_STATE_ERR);
+
+ // Note: This property supports both key events and mouse events
+
+ // Value is just like keyCode()
+ KeyEventImpl *keyEvent = dynamic_cast<KeyEventImpl*>(impl);
+ if (keyEvent)
+ return keyEvent->keyVal();
+
+ // For khtml, the return values for left, middle and right mouse buttons are 0, 1, 2, respectively.
+ // For the Netscape "which" property, the return values for left, middle and right mouse buttons are 1, 2, 3, respectively.
+ // So we can just add 1 to the value returned by calling button().
+ MouseEventImpl *mouseEvent = dynamic_cast<MouseEventImpl*>(impl);
+ if (mouseEvent)
+ return mouseEvent->button() + 1;
+
+ return 0;
+}
+
+
void UIEvent::initUIEvent(const DOMString &typeArg,
bool canBubbleArg,
bool cancelableArg,
diff --git a/WebCore/khtml/dom/dom2_events.h b/WebCore/khtml/dom/dom2_events.h
index 1687666..024a81f 100644
--- a/WebCore/khtml/dom/dom2_events.h
+++ b/WebCore/khtml/dom/dom2_events.h
@@ -342,6 +342,12 @@ public:
int layerY() const;
/**
+ * Non-standard extension to support Netscape-style "which" event property.
+ *
+ */
+ int which() const;
+
+ /**
* The initUIEvent method is used to initialize the value of a UIEvent
* created through the DocumentEvent interface. This method may only be
* called before the UIEvent has been dispatched via the dispatchEvent
diff --git a/WebCore/khtml/ecma/kjs_events.cpp b/WebCore/khtml/ecma/kjs_events.cpp
index 9d459bf..2b2fe13 100644
--- a/WebCore/khtml/ecma/kjs_events.cpp
+++ b/WebCore/khtml/ecma/kjs_events.cpp
@@ -339,7 +339,7 @@ Value KJS::getEventExceptionConstructor(ExecState *exec)
const ClassInfo DOMUIEvent::info = { "UIEvent", &DOMEvent::info, &DOMUIEventTable, 0 };
/*
- at begin DOMUIEventTable 5
+ at begin DOMUIEventTable 8
view DOMUIEvent::View DontDelete|ReadOnly
detail DOMUIEvent::Detail DontDelete|ReadOnly
keyCode DOMUIEvent::KeyCode DontDelete|ReadOnly
@@ -347,6 +347,7 @@ const ClassInfo DOMUIEvent::info = { "UIEvent", &DOMEvent::info, &DOMUIEventTabl
layerY DOMUIEvent::LayerY DontDelete|ReadOnly
pageX DOMUIEvent::PageX DontDelete|ReadOnly
pageY DOMUIEvent::PageY DontDelete|ReadOnly
+ which DOMUIEvent::Which DontDelete|ReadOnly
@end
@begin DOMUIEventProtoTable 1
initUIEvent DOMUIEvent::InitUIEvent DontDelete|Function 5
@@ -382,6 +383,8 @@ Value DOMUIEvent::getValueProperty(ExecState *exec, int token) const
return Number(static_cast<DOM::UIEvent>(event).pageX());
case PageY:
return Number(static_cast<DOM::UIEvent>(event).pageY());
+ case Which:
+ return Number(static_cast<DOM::UIEvent>(event).which());
default:
kdWarning() << "Unhandled token in DOMUIEvent::getValueProperty : " << token << endl;
return Undefined();
diff --git a/WebCore/khtml/ecma/kjs_events.h b/WebCore/khtml/ecma/kjs_events.h
index 9149d85..56448d9 100644
--- a/WebCore/khtml/ecma/kjs_events.h
+++ b/WebCore/khtml/ecma/kjs_events.h
@@ -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, LayerX, LayerY, PageX, PageY, InitUIEvent };
+ enum { View, Detail, KeyCode, LayerX, LayerY, PageX, PageY, Which, InitUIEvent };
DOM::UIEvent toUIEvent() const { return static_cast<DOM::UIEvent>(event); }
};
diff --git a/WebCore/khtml/ecma/kjs_events.lut.h b/WebCore/khtml/ecma/kjs_events.lut.h
index 8fc9997..603e99d 100644
--- a/WebCore/khtml/ecma/kjs_events.lut.h
+++ b/WebCore/khtml/ecma/kjs_events.lut.h
@@ -76,16 +76,21 @@ const struct HashTable EventExceptionConstructorTable = { 2, 1, EventExceptionCo
namespace KJS {
const struct HashEntry DOMUIEventTableEntries[] = {
- { "layerY", DOMUIEvent::LayerY, 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] },
- { "layerX", DOMUIEvent::LayerX, DontDelete|ReadOnly, 0, 0 },
+ { 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0 },
+ { "view", DOMUIEvent::View, DontDelete|ReadOnly, 0, &DOMUIEventTableEntries[8] },
{ "keyCode", DOMUIEvent::KeyCode, DontDelete|ReadOnly, 0, 0 },
- { "pageY", DOMUIEvent::PageY, DontDelete|ReadOnly, 0, 0 }
+ { "layerX", DOMUIEvent::LayerX, DontDelete|ReadOnly, 0, &DOMUIEventTableEntries[9] },
+ { "layerY", DOMUIEvent::LayerY, DontDelete|ReadOnly, 0, &DOMUIEventTableEntries[10] },
+ { 0, 0, 0, 0, 0 },
+ { "detail", DOMUIEvent::Detail, DontDelete|ReadOnly, 0, &DOMUIEventTableEntries[11] },
+ { "pageX", DOMUIEvent::PageX, DontDelete|ReadOnly, 0, 0 },
+ { "pageY", DOMUIEvent::PageY, DontDelete|ReadOnly, 0, 0 },
+ { "which", DOMUIEvent::Which, DontDelete|ReadOnly, 0, 0 }
};
-const struct HashTable DOMUIEventTable = { 2, 7, DOMUIEventTableEntries, 5 };
+const struct HashTable DOMUIEventTable = { 2, 12, DOMUIEventTableEntries, 8 };
}; // namespace
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list