Changeset 139904 in webkit


Ignore:
Timestamp:
Jan 16, 2013 11:48:44 AM (11 years ago)
Author:
wjmaclean@chromium.org
Message:

LinkHighlight should use touch adjustment to match active state on GestureTapDown.
https://bugs.webkit.org/show_bug.cgi?id=107032

Reviewed by Adam Barth.

Source/WebKit/chromium:

LinkHighlight node selection should produce results that match the node marked
active during GestureTapDown.

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::bestTouchLinkNode):

  • tests/LinkHighlightTest.cpp:

(WebCore::TEST):

LayoutTests:

  • platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-multi-line.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139893 r139904  
     12013-01-16  W. James MacLean  <wjmaclean@chromium.org>
     2
     3        LinkHighlight should use touch adjustment to match active state on GestureTapDown.
     4        https://bugs.webkit.org/show_bug.cgi?id=107032
     5
     6        Reviewed by Adam Barth.
     7
     8        * platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-multi-line.html:
     9
    1102013-01-16  Levi Weintraub  <leviw@chromium.org>
    211
  • trunk/LayoutTests/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-multi-line.html

    r130551 r139904  
    1616    x = (clientRect.left + clientRect.right) / 2;
    1717    y = (clientRect.top + clientRect.bottom) / 2;
     18    touchWidth = (clientRect.right - clientRect.left) / 4;
     19    touchHeight = (clientRect.bottom - clientRect.top) / 4;
    1820    if (window.testRunner) {
    1921        testRunner.dumpAsText(true);
     
    2224
    2325    if (window.eventSender) {
    24         eventSender.gestureTapDown(x, y);
     26        eventSender.gestureTapDown(x, y, touchWidth, touchHeight);
    2527        window.setTimeout(function() { window.testRunner.notifyDone(); }, 0);
    2628    } else {
  • trunk/Source/WebKit/chromium/ChangeLog

    r139900 r139904  
     12013-01-16  W. James MacLean  <wjmaclean@chromium.org>
     2
     3        LinkHighlight should use touch adjustment to match active state on GestureTapDown.
     4        https://bugs.webkit.org/show_bug.cgi?id=107032
     5
     6        Reviewed by Adam Barth.
     7
     8        LinkHighlight node selection should produce results that match the node marked
     9        active during GestureTapDown.
     10
     11        * src/WebViewImpl.cpp:
     12        (WebKit::WebViewImpl::bestTouchLinkNode):
     13        * tests/LinkHighlightTest.cpp:
     14        (WebCore::TEST):
     15
    1162013-01-16  Kentaro Hara  <haraken@chromium.org>
    217
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r139829 r139904  
    12251225    Node* bestTouchNode = 0;
    12261226
    1227     // FIXME: Should accept a search region from the caller instead of hard-coding the size.
    1228     IntSize touchEventSearchRegionSize(4, 2);
     1227    IntSize touchEventSearchRegionSize(touchEvent.data.tapDown.width / 2, touchEvent.data.tapDown.height / 2);
    12291228    IntPoint touchEventLocation(touchEvent.x, touchEvent.y);
    1230     m_page->mainFrame()->eventHandler()->bestClickableNodeForTouchPoint(touchEventLocation, touchEventSearchRegionSize, touchEventLocation, bestTouchNode);
    1231     // bestClickableNodeForTouchPoint() doesn't always return a node that is a link, so let's try and find
    1232     // a link to highlight.
     1229#if ENABLE(TOUCH_ADJUSTMENT)
     1230    m_page->mainFrame()->eventHandler()->adjustGesturePosition(PlatformGestureEventBuilder(mainFrameImpl()->frameView(), touchEvent), touchEventLocation);
     1231#endif
     1232
     1233    IntPoint hitTestPoint = m_page->mainFrame()->view()->windowToContents(touchEventLocation);
     1234    HitTestResult result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(
     1235        hitTestPoint, false, false, DontHitTestScrollbars, HitTestRequest::TouchEvent);
     1236    bestTouchNode = result.targetNode();
     1237
     1238    // Make sure our highlight candidate uses a hand cursor as a heuristic to
     1239    // choose appropriate targets.
    12331240    bool shiftKey = touchEvent.modifiers & WebGestureEvent::ShiftKey;
    12341241    while (bestTouchNode && !invokesHandCursor(bestTouchNode, shiftKey, m_page->mainFrame()))
  • trunk/Source/WebKit/chromium/tests/LinkHighlightTest.cpp

    r132945 r139904  
    6262
    6363    WebGestureEvent touchEvent;
     64    touchEvent.type = WebInputEvent::GestureTapDown;
    6465
    6566    // The coordinates below are linked to absolute positions in the referenced .html file.
Note: See TracChangeset for help on using the changeset viewer.