[webkit-reviews] review requested: [Bug 44089] [Qt] Making effective use of Document::nodesFromRect : [Attachment 64549] patch v1

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 16 20:38:29 PDT 2010


Antonio Gomes <tonikitoo at webkit.org> has asked	for review:
Bug 44089: [Qt] Making effective use of Document::nodesFromRect
https://bugs.webkit.org/show_bug.cgi?id=44089

Attachment 64549: patch v1
https://bugs.webkit.org/attachment.cgi?id=64549&action=review

------- Additional Comments from Antonio Gomes <tonikitoo at webkit.org>
Patch adds a helper class (named TouchAdjuster) to improve tap actions on
mobile touch devices. TouchAdjuster makes use of the newly added rect based hit
test extension through the Document::nodesFromRect method. Given a rectangle as
input, nodesFromRect returns a z-index ordered list of nodes whose boundaries
intersect the rectangle.

Basically the TouchAdjuster class intercepts the QGraphicsSceneMouseEvent
passed to both QWebPagePrivate::mouse{Press,Release}Event methods before they
are passed down to WebCore. The goal is to infer the target click position. For
that, a rectangle is built up using the event position as a center point and
expanding it both horizontally and vertically, based on the values set in
QWebSettings::hitTestPadding.

TouchAdjuster iterates over the list of nodes returned by nodesFromRect and
picks the clickable one that has the largest intersection area with the hit
test rectangle. The target position is then the center point of this
intersection area.

In case of no clickable node intersects the hit test area, the click position
is not altered.

TouchAdjuster is *only* working for QGraphicsWebView based views.


More information about the webkit-reviews mailing list