[Webkit-unassigned] [Bug 42892] [Qt] Decouple QTouchEvent's accepted flag from JS prevent default

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 28 04:44:23 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=42892





--- Comment #8 from Antonio Gomes <tonikitoo at webkit.org>  2010-07-28 04:44:23 PST ---
(From update of attachment 62798)

> diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
> index 853e637..8a94c9b 100644
> --- a/WebKit/qt/Api/qgraphicswebview.cpp
> +++ b/WebKit/qt/Api/qgraphicswebview.cpp
> @@ -319,6 +319,8 @@ bool QGraphicsWebView::sceneEvent(QEvent* event)
>                  || event->type() == QEvent::TouchEnd
>                  || event->type() == QEvent::TouchUpdate)) {
>          d->page->event(event);
> +
> +        // Always return true so that we'll receive also TouchUpdate and TouchEnd events
>          return true;

>From QWebPage::event you return if the event was canceled in JS, but you ignore the value returned here and on QWebView's case as well.

>      }
>  #endif
> diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
> index 1dda884..b689062 100644
> --- a/WebKit/qt/Api/qwebpage.cpp
> +++ b/WebKit/qt/Api/qwebpage.cpp
> @@ -1397,7 +1397,10 @@ bool QWebPagePrivate::touchEvent(QTouchEvent* event)
>      if (!frame->view())
>          return false;
>  
> +    // Always accept the QTouchEvent so that we'll receive also TouchUpdate and TouchEnd events
>      event->setAccepted(true);
> +
> +    // Return whether the default action was cancelled in the JS event handler
>      return frame->eventHandler()->handleTouchEvent(PlatformTouchEvent(event));
>  }
>  #endif
> @@ -2842,6 +2845,7 @@ bool QWebPage::event(QEvent *ev)
>      case QEvent::TouchBegin:
>      case QEvent::TouchUpdate:
>      case QEvent::TouchEnd:
> +        // Return whether the default action was cancelled in the JS event handler
>          return d->touchEvent(static_cast<QTouchEvent*>(ev));

You comments also raised a question: what indicates the touch engine to send follow up TouchUpdate and TouchEnd events? the setAccepted(true) sentence or returning 'true' from sceneEvent? your comments did not clarify that.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list