--nextPart1476062.usAr84ERx2 Content-Type: multipart/mixed; boundary="Boundary-01=_i9L4AEy9a9+BQhY" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_i9L4AEy9a9+BQhY Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline > The following patch implements (or fixes, since it is a w3c recommandation) > bug 59489 (http://bugs.kde.org/show_bug.cgi?id=59489). This new patch fixes a small bug (do not allow deselecting a radio button). regards --Boundary-01=_i9L4AEy9a9+BQhY Content-Type: text/x-diff; charset="iso-8859-15"; name="formsclick2.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="formsclick2.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 28 Jun 2004 22:49:07 -0000 @@ -727,17 +733,21 @@ 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 + { + DOM::ElementImpl *inputForm=3Dstatic_cast(mev= =2EinnerNode.handle()->parentNode())->formElement(); + if (inputForm) + static_cast(inputForm)->activateInput(); + } 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 28 Jun 2004 22:49:12 -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,20 @@ HTMLElementImpl::attach(); } =20 =2D#if 0 + ElementImpl *HTMLLabelElementImpl::formElement() { DOMString formElementId =3D getAttribute(ATTR_FOR); if (formElementId.isEmpty()) =2D return 0; + { + uint children=3DchildNodeCount(); + if (children>1)=20 + for (unsigned int i=3D0;iid()=3D=3DID_INPUT) return static_cast(childNode(i)); + return 0; + } return getDocument()->getElementById(formElementId); } =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 28 Jun 2004 22:49:13 -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 ElementImpl* formElement(); =20 private: DOMString m_formElementID; --Boundary-01=_i9L4AEy9a9+BQhY-- --nextPart1476062.usAr84ERx2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQBA4L9pB+BYfnGUHkURAtaqAJ4qczVCtIbdRVh5CQGPcl9+X+k1iACfZ/4u E+jZFzWi5clBd29I5sxLjfM= =GXHh -----END PGP SIGNATURE----- --nextPart1476062.usAr84ERx2--