[webkit-changes] cvs commit: WebCore/khtml/xml dom_nodeimpl.cpp
Maciej
mjs at opensource.apple.com
Mon Oct 3 14:34:49 PDT 2005
mjs 05/10/03 14:34:48
Modified: . ChangeLog
khtml/ecma kjs_events.cpp
khtml/html html_formimpl.cpp
khtml/xml dom_nodeimpl.cpp
Log:
Reviewed by Darin.
http://bugzilla.opendarwin.org/show_bug.cgi?id=5180
event.stopPropagation() prevents the default action - it shouldn't
Amusingly this bug existed in 3 different places.
* khtml/ecma/kjs_events.cpp:
(KJS::DOMEventProtoFunc::callAsFunction): Don't let stopPropagation fall through
to preventDefault.
* khtml/html/html_formimpl.cpp:
(DOM::HTMLInputElementImpl::postDispatchEventHandler): Only consider preventDefault
for purposes of reverting checkbox/radiobutton state change, not stopPropagation.
* khtml/xml/dom_nodeimpl.cpp:
(DOM::NodeImpl::dispatchGenericEvent): Don't let stopPropagation prevent calling
default event handlers; only preventDefault does that.
Revision Changes Path
1.189 +19 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.188
retrieving revision 1.189
diff -u -r1.188 -r1.189
--- ChangeLog 3 Oct 2005 21:11:59 -0000 1.188
+++ ChangeLog 3 Oct 2005 21:34:44 -0000 1.189
@@ -1,3 +1,22 @@
+2005-10-03 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Darin.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=5180
+ event.stopPropagation() prevents the default action - it shouldn't
+
+ Amusingly this bug existed in 3 different places.
+
+ * khtml/ecma/kjs_events.cpp:
+ (KJS::DOMEventProtoFunc::callAsFunction): Don't let stopPropagation fall through
+ to preventDefault.
+ * khtml/html/html_formimpl.cpp:
+ (DOM::HTMLInputElementImpl::postDispatchEventHandler): Only consider preventDefault
+ for purposes of reverting checkbox/radiobutton state change, not stopPropagation.
+ * khtml/xml/dom_nodeimpl.cpp:
+ (DOM::NodeImpl::dispatchGenericEvent): Don't let stopPropagation prevent calling
+ default event handlers; only preventDefault does that.
+
2005-09-28 Maciej Stachowiak <mjs at apple.com>
Reviewed by Darin.
1.64 +1 -0 WebCore/khtml/ecma/kjs_events.cpp
Index: kjs_events.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_events.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- kjs_events.cpp 3 Oct 2005 21:12:12 -0000 1.63
+++ kjs_events.cpp 3 Oct 2005 21:34:46 -0000 1.64
@@ -528,6 +528,7 @@
switch (id) {
case DOMEvent::StopPropagation:
event.stopPropagation();
+ return Undefined();
case DOMEvent::PreventDefault:
event.preventDefault();
return Undefined();
1.197 +2 -2 WebCore/khtml/html/html_formimpl.cpp
Index: html_formimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.cpp,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -r1.196 -r1.197
--- html_formimpl.cpp 3 Oct 2005 21:12:28 -0000 1.196
+++ html_formimpl.cpp 3 Oct 2005 21:34:47 -0000 1.197
@@ -2336,10 +2336,10 @@
static_cast<MouseEventImpl*>(evt)->button() == 0) {
if (m_type == CHECKBOX) {
// Reverse the checking we did in preDispatch.
- if (evt->propagationStopped() || evt->defaultPrevented() || evt->defaultHandled())
+ if (evt->defaultPrevented() || evt->defaultHandled())
setChecked(input);
} else if (input) {
- if (evt->propagationStopped() || evt->defaultPrevented() || evt->defaultHandled()) {
+ if (evt->defaultPrevented() || evt->defaultHandled()) {
// Restore the original selected radio button if possible.
// Make sure it is still a radio button and only do the restoration if it still
// belongs to our group.
1.196 +1 -1 WebCore/khtml/xml/dom_nodeimpl.cpp
Index: dom_nodeimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -r1.195 -r1.196
--- dom_nodeimpl.cpp 3 Oct 2005 21:12:52 -0000 1.195
+++ dom_nodeimpl.cpp 3 Oct 2005 21:34:48 -0000 1.196
@@ -620,7 +620,7 @@
// now we call all default event handlers (this is not part of DOM - it is internal to khtml)
it.toLast();
- for (; it.current() && !evt->propagationStopped() && !evt->defaultPrevented() && !evt->defaultHandled(); --it)
+ for (; it.current() && !evt->defaultPrevented() && !evt->defaultHandled(); --it)
it.current()->defaultEventHandler(evt);
}
More information about the webkit-changes
mailing list