so that the click() method on checkboxes actually works.
Also eliminate the WinIE compatibiilty for event.button and match the
standard DOM behavior instead (like Firefox does).
Reviewed by darin
Test cases added: None, since one of the level 2 DOM tests changes to
pass and tests this feature.
* khtml/ecma/kjs_events.cpp:
(KJS::DOMMouseEvent::getValueProperty):
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::click):
* layout-tests/dom/html/level2/html/HTMLInputElement21-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10398
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
-Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLInputElement21
-Status: failure
-Detail: checkedAfterClick: assertTrue failed
+Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLInputElement21
+Status: Success
+2005-08-30 David Hyatt <hyatt@apple.com>
+
+ Fix for bugzilla bug 4573, make sure click() fires CLICK and not KHTML_CLICK,
+ so that the click() method on checkboxes actually works.
+
+ Also eliminate the WinIE compatibiilty for event.button and match the
+ standard DOM behavior instead (like Firefox does).
+
+ Reviewed by darin
+
+ Test cases added: None, since one of the level 2 DOM tests changes to
+ pass and tests this feature.
+
+ * khtml/ecma/kjs_events.cpp:
+ (KJS::DOMMouseEvent::getValueProperty):
+ * khtml/html/html_elementimpl.cpp:
+ (HTMLElementImpl::click):
+ * layout-tests/dom/html/level2/html/HTMLInputElement21-expected.txt:
+
2005-08-30 David Hyatt <hyatt@apple.com>
Change the value of "element" for khtml-user-select to "ignore". Also undo the support of "-moz"
case MetaKey:
return Boolean(event.metaKey());
case Button:
- {
- // Tricky. The DOM (and khtml) use 0 for LMB, 1 for MMB and 2 for RMB
- // but MSIE uses 1=LMB, 2=RMB, 4=MMB, as a bitfield
- int domButton = event.button();
- int button = domButton==0 ? 1 : domButton==1 ? 4 : domButton==2 ? 2 : 0;
- return Number( (unsigned int)button );
- }
+ // WinIE uses 1,4,2 for left/middle/right but not for click (just for mousedown/up, maybe others), but we will match the standard DOM.
+ return Number(event.button());
case ToElement:
// MSIE extension - "the object toward which the user is moving the mouse pointer"
if (event.id() == DOM::EventImpl::MOUSEOUT_EVENT)
// always send click
QMouseEvent clickEvent(QEvent::MouseButtonRelease, QPoint(x,y), Qt::LeftButton, 0);
- dispatchMouseEvent(&clickEvent, EventImpl::KHTML_CLICK_EVENT);
+ dispatchMouseEvent(&clickEvent, EventImpl::CLICK_EVENT);
}
// accessKeyAction is used by the accessibility support code