--nextPart1606931.SW8dipThts Content-Type: multipart/mixed; boundary="Boundary-01=_DLZ4AgF2qkD2gqW" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_DLZ4AgF2qkD2gqW Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Improved (non-leaking) version of my patch. --Boundary-01=_DLZ4AgF2qkD2gqW Content-Type: text/x-diff; charset="iso-8859-15"; name="formsclick3.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="formsclick3.diff" Index: khtmlview.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdelibs/khtml/khtmlview.cpp,v retrieving revision 1.639 diff -u -3 -r1.639 khtmlview.cpp =2D-- khtmlview.cpp 19 Jun 2004 20:47:34 -0000 1.639 +++ khtmlview.cpp 29 Jun 2004 13:49:57 -0000 @@ -727,17 +733,17 @@ d->clickX =3D xm; d->clickY =3D ym; } =2D bool swallowEvent =3D dispatchMouseEvent(EventImpl::MOUSEDOWN_EVENT,me= v.innerNode.handle(),true, d->clickCount,_mouse,true,DOM::= NodeImpl::MousePress); =2D + =20 khtml::RenderObject* r =3D mev.innerNode.handle() ? mev.innerNode.hand= le()->renderer() : 0; if (r && r->isWidget()) _mouse->ignore(); =2D + =20 if (!swallowEvent) { emit m_part->nodeActivated(mev.innerNode); =2D + if (mev.innerNode.handle()->parentNode()->id()=3D=3DID_LABEL)=20 + static_cast(mev.innerNode.handle()->parentNod= e())->activateFormElement(); khtml::MousePressEvent event( _mouse, xm, ym, mev.url, mev.target, mev.in= nerNode ); QApplication::sendEvent( m_part, &event ); // we might be deleted after this Index: html/html_formimpl.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdelibs/khtml/html/html_formimpl.cpp,v retrieving revision 1.372 diff -u -3 -r1.372 html_formimpl.cpp =2D-- html/html_formimpl.cpp 22 Jun 2004 05:46:41 -0000 1.372 +++ html/html_formimpl.cpp 29 Jun 2004 13:50:03 -0000 @@ -1553,6 +1553,21 @@ } } =20 +void HTMLInputElementImpl::activateInput() +{ +switch (m_type) +{ +case RADIO: +setChecked(true); +break; +case CHECKBOX: +setChecked(!checked()); +break; +default: +focus(); +} +} + bool HTMLInputElementImpl::isEditable() { return ((m_type =3D=3D TEXT) || (m_type =3D=3D PASSWORD) || (m_type = =3D=3D ISINDEX) || (m_type =3D=3D FILE)); @@ -1580,15 +1595,24 @@ HTMLElementImpl::attach(); } =20 =2D#if 0 =2DElementImpl *HTMLLabelElementImpl::formElement() + +void HTMLLabelElementImpl::activateFormElement() { DOMString formElementId =3D getAttribute(ATTR_FOR); =2D if (formElementId.isEmpty()) =2D return 0; =2D return getDocument()->getElementById(formElementId); + if (!formElementId.isEmpty()) + static_cast(getDocument()->getElementById(= formElementId))->activateInput(); + else + { + uint children=3DchildNodeCount(); + if (children>1)=20 + for (unsigned int i=3D0;iid()=3D=3DID_INPUT) + { + static_cast(childNode(i))->activateInput(); + break; + } + } } =2D#endif =20 // -----------------------------------------------------------------------= =2D- =20 Index: html/html_formimpl.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdelibs/khtml/html/html_formimpl.h,v retrieving revision 1.152 diff -u -3 -r1.152 html_formimpl.h =2D-- html/html_formimpl.h 22 Jun 2004 05:46:41 -0000 1.152 +++ html/html_formimpl.h 29 Jun 2004 13:50:04 -0000 @@ -291,6 +291,7 @@ =20 DOMString altText() const; void activate(); + void activateInput(); =20 protected: =20 @@ -319,6 +320,7 @@ =20 virtual Id id() const; virtual void attach(); + virtual void activateFormElement(); =20 private: DOMString m_formElementID; --Boundary-01=_DLZ4AgF2qkD2gqW-- --nextPart1606931.SW8dipThts Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQBA4ZLHB+BYfnGUHkURAijJAJwMklR4jhKkJtAruszWRVS3BYrYggCeJOyT 5G4y/2vBez3Wmd82Ant45+4= =Tap6 -----END PGP SIGNATURE----- --nextPart1606931.SW8dipThts--