Changeset 140370 in webkit


Ignore:
Timestamp:
Jan 21, 2013 4:31:57 PM (11 years ago)
Author:
leviw@chromium.org
Message:

Event target rects on the top level document shouldn't be clipped.
https://bugs.webkit.org/show_bug.cgi?id=107339

Reviewed by James Robinson.

Source/WebCore:

clippedOverflowRectForRepaint clips the top-level RenderView to the viewport, which
is wrong for generating event target rects, as the result will not extend to the bounds
of the document on pages that scroll. Changing the top-level view to use documentRect
instead.

Tests updated to cover bug: platform/chromium/fast/events/touch/touch-hit-rects-in-iframe.html

platform/chromium/fast/events/touch/compositor-touch-hit-rects.html

  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::accumulateRendererTouchEventTargetRects): Use converToRootView instead of
a loop around convertToContaining view. This is not a change in behavior.
(WebCore::accumulateDocumentEventTargetRects): Switch to use documentRect instead of
clippedOverflowRectForRepaint for the top-level Document, and use converToRootView
to put rects in the coordinates of the top-level document.

LayoutTests:

Updating existing tests to cover this issue.

  • platform/chromium-linux/platform/chromium/fast/events/touch/compositor-touch-hit-rects-expected.txt:
  • platform/chromium/fast/events/touch/compositor-touch-hit-rects.html:
  • platform/chromium/fast/events/touch/touch-hit-rects-in-iframe-expected.txt:
  • platform/chromium/fast/events/touch/touch-hit-rects-in-iframe.html:
  • platform/chromium/fast/events/touch/resources/frame-with-document-touch-handler.html: Added.
  • platform/chromium/TestExpectations:
Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140368 r140370  
     12013-01-21  Levi Weintraub  <leviw@chromium.org>
     2
     3        Event target rects on the top level document shouldn't be clipped.
     4        https://bugs.webkit.org/show_bug.cgi?id=107339
     5
     6        Reviewed by James Robinson.
     7
     8        Updating existing tests to cover this issue.
     9
     10        * platform/chromium-linux/platform/chromium/fast/events/touch/compositor-touch-hit-rects-expected.txt:
     11        * platform/chromium/fast/events/touch/compositor-touch-hit-rects.html:
     12        * platform/chromium/fast/events/touch/touch-hit-rects-in-iframe-expected.txt:
     13        * platform/chromium/fast/events/touch/touch-hit-rects-in-iframe.html:
     14        * platform/chromium/fast/events/touch/resources/frame-with-document-touch-handler.html: Added.
     15        * platform/chromium/TestExpectations:
     16
    1172013-01-21  Nico Weber  <thakis@chromium.org>
    218
  • trunk/LayoutTests/platform/chromium-linux/platform/chromium/fast/events/touch/compositor-touch-hit-rects-expected.txt

    r139167 r140370  
    11This tests verifies the hit test regions given to the compositor. It can only be run in DumpRenderTree. The outputted rects should cover the hit test regions of all the listed elements.
    22
    3 normalFlow[0]: (8, 72, 784, 10)
    4 absoluteChildContainer[0]: (8, 102, 784, 10)
     3normalFlow[0]: (8, 72, 769, 10)
     4absoluteChildContainer[0]: (8, 102, 769, 10)
    55absoluteChildContainer[1]: (118, 300, 140, 10)
    6 relativeChildContainer[0]: (8, 152, 784, 10)
     6relativeChildContainer[0]: (8, 152, 769, 10)
    77relativeChildContainer[1]: (128, 352, 140, 10)
    8 overhangingContainer[0]: (8, 202, 784, 10)
     8overhangingContainer[0]: (8, 202, 769, 10)
    99overhangingContainer[1]: (8, 202, 110, 80)
    10 transformedChildContainer[0]: (63, 240, 674, 34)
    11 transformedChildContainer[1]: (8, 252, 784, 10)
     10transformedChildContainer[0]: (62, 241, 661, 32)
     11transformedChildContainer[1]: (8, 252, 769, 10)
    1212continuation[0]: (108, 302, 100, 10)
    1313inlineAbsoluteChildContainer[0]: (378, 300, 250, 10)
    1414inlineAbsoluteChildContainer[1]: (108, 352, 270, 10)
     15document[0]: (0, 0, 785, 1024)
    1516
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r140368 r140370  
    39083908webkit.org/b/98275 media/event-queue-crash.html [ Skip ]
    39093909
     3910# Needs rebaselining on after webkit.org/b/107339
     3911webkit.org/b/107339 [ Mac Android Win ] platform/chromium/fast/events/touch/compositor-touch-hit-rects.html [ Pass Failure ]
     3912
    39103913# Requires rebaselining after https://bugs.webkit.org/show_bug.cgi?id=11645
    39113914webkit.org/b/11645 [ Mac Android ] fast/table/025.html [ Failure ]
  • trunk/LayoutTests/platform/chromium/fast/events/touch/compositor-touch-hit-rects.html

    r138717 r140370  
    2323#tests {
    2424        font: 10px Ahem;
     25}
     26body {
     27        height: 1000px;
    2528}
    2629</style>
     
    7780}
    7881
    79 function logRects(id) {
     82function testElementWithId(id)
     83{
    8084        element = document.getElementById(id);
    8185        element.addEventListener('touchstart', listener, false);
     86        logRects(id);
     87        element.removeEventListener('touchstart', listener, false);
     88}
     89
     90function logRects(testName) {
     91
    8292        rects = window.internals.touchEventTargetClientRects(document);
    8393        var sortedRects = new Array();
     
    8696        sortedRects.sort(sortRects);
    8797        for (var i = 0; i < rects.length; ++i)
    88                 log(id + "[" + i + "]: (" + sortedRects[i].left + ", " + sortedRects[i].top + ", " + sortedRects[i].width + ", " + sortedRects[i].height + ")");
    89         element.removeEventListener('touchstart', listener, false);
     98                log(testName + "[" + i + "]: (" + sortedRects[i].left + ", " + sortedRects[i].top + ", " + sortedRects[i].width + ", " + sortedRects[i].height + ")");
    9099}
    91100
     
    95104
    96105        window.testRunner.dumpAsText();
    97         logRects("normalFlow");
    98         logRects("absoluteChildContainer");
    99         logRects("relativeChildContainer");
    100         logRects("overhangingContainer");
    101         logRects("transformedChildContainer");
    102         logRects("continuation");
    103         logRects("inlineAbsoluteChildContainer");
     106        testElementWithId("normalFlow");
     107        testElementWithId("absoluteChildContainer");
     108        testElementWithId("relativeChildContainer");
     109        testElementWithId("overhangingContainer");
     110        testElementWithId("transformedChildContainer");
     111        testElementWithId("continuation");
     112        testElementWithId("inlineAbsoluteChildContainer");
     113
     114        document.addEventListener('touchstart', listener, false);
     115        logRects("document");
    104116
    105117        var testContainer = document.getElementById("tests");
  • trunk/LayoutTests/platform/chromium/fast/events/touch/touch-hit-rects-in-iframe-expected.txt

    r139346 r140370  
    11This test validates that touch hit tests rects are created in the coordinates of the outermost view, not their containing view. This test only works in DumpRenderTree.
    2 [0]: (60, 110, 50, 50)
    3 [1]: (420, 170, 50, 50)
     2[0]: (10, 50, 285, 135)
     3[1]: (60, 110, 50, 50)
     4[2]: (420, 170, 50, 50)
    45
  • trunk/LayoutTests/platform/chromium/fast/events/touch/touch-hit-rects-in-iframe.html

    r139346 r140370  
    2424<iframe id="iframe1" src="resources/frame-with-touch-handler.html"></iframe>
    2525<iframe id="iframe2"></iframe>
     26<iframe id="iframe3" src="resources/frame-with-document-touch-handler.html"></iframe>
    2627<script>
    2728
  • trunk/Source/WebCore/ChangeLog

    r140366 r140370  
     12013-01-21  Levi Weintraub  <leviw@chromium.org>
     2
     3        Event target rects on the top level document shouldn't be clipped.
     4        https://bugs.webkit.org/show_bug.cgi?id=107339
     5
     6        Reviewed by James Robinson.
     7
     8        clippedOverflowRectForRepaint clips the top-level RenderView to the viewport, which
     9        is wrong for generating event target rects, as the result will not extend to the bounds
     10        of the document on pages that scroll. Changing the top-level view to use documentRect
     11        instead.
     12
     13        Tests updated to cover bug: platform/chromium/fast/events/touch/touch-hit-rects-in-iframe.html
     14                                    platform/chromium/fast/events/touch/compositor-touch-hit-rects.html
     15
     16        * page/scrolling/ScrollingCoordinator.cpp:
     17        (WebCore::accumulateRendererTouchEventTargetRects): Use converToRootView instead of
     18        a loop around convertToContaining view. This is not a change in behavior.
     19        (WebCore::accumulateDocumentEventTargetRects): Switch to use documentRect instead of
     20        clippedOverflowRectForRepaint for the top-level Document, and use converToRootView
     21        to put rects in the coordinates of the top-level document.
     22
    1232013-01-17  Andy Estes  <aestes@apple.com>
    224
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r140229 r140370  
    189189            // Convert to the top-level view's coordinates.
    190190            ASSERT(renderer->document()->view());
    191             for (ScrollView* view = renderer->document()->view(); view && view->parent(); view = view->parent())
    192                 r = view->convertToContainingView(r);
     191            r = renderer->document()->view()->convertToRootView(r);
    193192
    194193            if (!parentRect.contains(r)) {
     
    217216        if (touchTarget == document) {
    218217            if (RenderView* view = document->renderView()) {
    219                 IntRect r = enclosingIntRect(view->clippedOverflowRectForRepaint(0));
    220                 if (!r.isEmpty())
     218                IntRect r;
     219                if (touchTarget == document->topDocument())
     220                    r = view->documentRect();
     221                else
     222                    r = enclosingIntRect(view->clippedOverflowRectForRepaint(0));
     223
     224                if (!r.isEmpty()) {
     225                    ASSERT(view->document()->view());
     226                    r = view->document()->view()->convertToRootView(r);
    221227                    rects.append(r);
     228                }
    222229            }
    223230            return;
Note: See TracChangeset for help on using the changeset viewer.