[webkit-changes] cvs commit: WebCore/khtml/html html_formimpl.cpp
Vicki
vicki at opensource.apple.com
Tue Jul 12 10:52:32 PDT 2005
vicki 05/07/12 10:52:32
Modified: . Tag: Safari-2-0-branch ChangeLog
khtml/html Tag: Safari-2-0-branch html_formimpl.cpp
Log:
- merge this fix from HEAD
2005-05-30 Darin Adler <darin at apple.com>
Reviewed by John.
- fixed <rdar://problem/4105097> REGRESSION (138-139): Hitting Enter on a checkbox toggles check mark instead of submitting form
* khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::defaultEventHandler): Separate the checks for
the space bar and the Enter key and make Enter submit the form on a check box or radio button.
Revision Changes Path
No revision
No revision
1.4104.2.48 +13 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4104.2.47
retrieving revision 1.4104.2.48
diff -u -r1.4104.2.47 -r1.4104.2.48
--- ChangeLog 12 Jul 2005 17:35:52 -0000 1.4104.2.47
+++ ChangeLog 12 Jul 2005 17:52:24 -0000 1.4104.2.48
@@ -1,3 +1,16 @@
+2005-07-12 Vicki Murley <vicki at apple.com>
+
+ - merge this fix from HEAD
+
+ 2005-05-30 Darin Adler <darin at apple.com>
+
+ Reviewed by John.
+
+ - fixed <rdar://problem/4105097> REGRESSION (138-139): Hitting Enter on a checkbox toggles check mark instead of submitting form
+
+ * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::defaultEventHandler): Separate the checks for
+ the space bar and the Enter key and make Enter submit the form on a check box or radio button.
+
2005-07-12 Adele Peterson <adele at apple.com>
Merged fix from TOT to Safari-2-0-branch
No revision
No revision
1.156.6.2 +57 -27 WebCore/khtml/html/html_formimpl.cpp
Index: html_formimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/html_formimpl.cpp,v
retrieving revision 1.156.6.1
retrieving revision 1.156.6.2
diff -u -r1.156.6.1 -r1.156.6.2
--- html_formimpl.cpp 12 Jul 2005 00:45:44 -0000 1.156.6.1
+++ html_formimpl.cpp 12 Jul 2005 17:52:31 -0000 1.156.6.2
@@ -2088,34 +2088,64 @@
// Use key press event here since sending simulated mouse events
// on key down blocks the proper sending of the key press event.
if (evt->id() == EventImpl::KEYPRESS_EVENT && evt->isKeyboardEvent()) {
+ bool clickElement = false;
+ bool clickDefaultFormButton = false;
+
DOMString key = static_cast<KeyboardEventImpl *>(evt)->keyIdentifier();
- switch (m_type) {
- case BUTTON:
- case CHECKBOX:
- case FILE:
- case IMAGE:
- case RADIO:
- case RESET:
- case SUBMIT:
- // Simulate mouse click for enter or spacebar for these types of elements.
- // The AppKit already does this for spacebar for some, but not all, of them.
- if (key == "U+000020" || key == "Enter") {
- click(false);
- evt->setDefaultHandled();
- }
- break;
- case HIDDEN:
- case ISINDEX:
- case PASSWORD:
- case RANGE:
- case SEARCH:
- case TEXT:
- // Simulate mouse click on the default form button for enter for these types of elements.
- if (key == "Enter" && m_form) {
- m_form->submitClick();
- evt->setDefaultHandled();
- }
- break;
+
+ if (key == "U+000020") {
+ switch (m_type) {
+ case BUTTON:
+ case CHECKBOX:
+ case FILE:
+ case IMAGE:
+ case RADIO:
+ case RESET:
+ case SUBMIT:
+ // Simulate mouse click for spacebar for these types of elements.
+ // The AppKit already does this for some, but not all, of them.
+ clickElement = true;
+ break;
+ case HIDDEN:
+ case ISINDEX:
+ case PASSWORD:
+ case RANGE:
+ case SEARCH:
+ case TEXT:
+ break;
+ }
+ }
+
+ if (key == "Enter") {
+ switch (m_type) {
+ case BUTTON:
+ case CHECKBOX:
+ case HIDDEN:
+ case ISINDEX:
+ case PASSWORD:
+ case RANGE:
+ case SEARCH:
+ case TEXT:
+ // Simulate mouse click on the default form button for enter for these types of elements.
+ clickDefaultFormButton = true;
+ break;
+ case FILE:
+ case IMAGE:
+ case RADIO:
+ case RESET:
+ case SUBMIT:
+ // Simulate mouse click for enter for these types of elements.
+ clickElement = true;
+ break;
+ }
+ }
+
+ if (clickElement) {
+ click(false);
+ evt->setDefaultHandled();
+ } else if (clickDefaultFormButton && m_form) {
+ m_form->submitClick();
+ evt->setDefaultHandled();
}
}
#endif
More information about the webkit-changes
mailing list