Version: 3.0.3 (using KDE KDE 3.0.3) Installed from: Compiled From Sources Compiler: gcc version 2.95.3 20010315 (release) OS: Linux If I disable a checkbox it is grayed out correctly, however I'm still able to click it, all other browsers I've tried this in does not allow a onclick event if the checkbox is disabled. Either I am using the wrong event or it's a bug... The code I use is this: <form name="blah"> <input disabled type="checkbox" name="check1x1" OnClick="alert('clicked');"> </form>
No checkmark will appear, but the JS popup will.
Subject: kdelibs/khtml [POSSIBLY UNSAFE] CVS commit by mueller: ignore events that shouldn't be sent to us in the first place CCMAIL: 50326-done@bugs.kde.org M +26 -2 khtmlview.cpp 1.517 [POSSIBLY UNSAFE: qDebug] --- kdelibs/khtml/khtmlview.cpp #1.516:1.517 @@ -535,4 +535,10 @@ void KHTMLView::viewportMousePressEvent( m_part->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev ); + // Qt bug: sometimes Qt sends us events that should be sent + // to the widget instead + if ( mev.innerNode.handle() && mev.innerNode.handle()->renderer() && + mev.innerNode.handle()->renderer()->isWidget() ) + return; + if (d->clickCount > 0 && QPoint(d->clickX-xm,d->clickY-ym).manhattanLength() <= QApplication::startDragDistance()) @@ -612,4 +618,11 @@ void KHTMLView::viewportMouseMoveEvent( DOM::NodeImpl::MouseEvent mev( _mouse->stateAfter(), DOM::NodeImpl::MouseMove ); m_part->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev ); + + // Qt bug: sometimes Qt sends us events that should be sent + // to the widget instead + if ( mev.innerNode.handle() && mev.innerNode.handle()->renderer() && + mev.innerNode.handle()->renderer()->isWidget() ) + return; + bool swallowEvent = dispatchMouseEvent(EventImpl::MOUSEMOVE_EVENT,mev.innerNode.handle(),false, 0,_mouse,true,DOM::NodeImpl::MouseMove); @@ -701,16 +714,27 @@ void KHTMLView::viewportMouseReleaseEven viewportToContents(_mouse->x(), _mouse->y(), xm, ym); - //kdDebug( 6000 ) << "\nmouseReleaseEvent: x=" << xm << ", y=" << ym << endl; + kdDebug( 6000 ) << "\nmouseReleaseEvent: x=" << xm << ", y=" << ym << endl; DOM::NodeImpl::MouseEvent mev( _mouse->stateAfter(), DOM::NodeImpl::MouseRelease ); m_part->xmlDocImpl()->prepareMouseEvent( false, xm, ym, &mev ); + // Qt bug: sometimes Qt sends us events that should be sent + // to the widget instead + if ( mev.innerNode.handle() && mev.innerNode.handle()->renderer() && + mev.innerNode.handle()->renderer()->isWidget() ) + return; + bool swallowEvent = dispatchMouseEvent(EventImpl::MOUSEUP_EVENT,mev.innerNode.handle(),true, d->clickCount,_mouse,false,DOM::NodeImpl::MouseRelease); + qDebug("clickCount: %d, mL: %d", + d->clickCount, QPoint(d->clickX-xm,d->clickY-ym).manhattanLength()); + if (d->clickCount > 0 && - QPoint(d->clickX-xm,d->clickY-ym).manhattanLength() <= QApplication::startDragDistance()) + QPoint(d->clickX-xm,d->clickY-ym).manhattanLength() <= QApplication::startDragDistance()) { + qDebug( "dispatching CLICK EVENT" ); dispatchMouseEvent(EventImpl::CLICK_EVENT,mev.innerNode.handle(),true, d->clickCount,_mouse,true,DOM::NodeImpl::MouseRelease); + } if (mev.innerNode.handle())