Changeset 145884 in webkit


Ignore:
Timestamp:
Mar 15, 2013 1:08:07 AM (11 years ago)
Author:
mihnea@adobe.com
Message:

[CSS Regions] Selecting text inside an empty region causes selection outside the region area
https://bugs.webkit.org/show_bug.cgi?id=107752

Reviewed by David Hyatt.

Source/WebCore:

When performing hit testing inside a flow thread, we need to make sure that
we actually hit some node from the flow thread content and not the flow thread
itself (which would set the hit test result node to the document node, allowing
wrong selection of content outside the empty region).

Test: fast/regions/selecting-text-in-empty-region.html

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::hitTestFlowThreadPortionInRegion):

LayoutTests:

Add test showing that you cannot select content outside a empty region (without flow thread content).

  • fast/regions/selecting-text-in-empty-region-expected.txt: Added.
  • fast/regions/selecting-text-in-empty-region.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r145876 r145884  
     12013-03-15  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSS Regions] Selecting text inside an empty region causes selection outside the region area
     4        https://bugs.webkit.org/show_bug.cgi?id=107752
     5
     6        Reviewed by David Hyatt.
     7
     8        Add test showing that you cannot select content outside a empty region (without flow thread content).
     9
     10        * fast/regions/selecting-text-in-empty-region-expected.txt: Added.
     11        * fast/regions/selecting-text-in-empty-region.html: Added.
     12
    1132013-03-14  Sheriff Bot  <webkit.review.bot@gmail.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r145883 r145884  
     12013-03-15  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        [CSS Regions] Selecting text inside an empty region causes selection outside the region area
     4        https://bugs.webkit.org/show_bug.cgi?id=107752
     5
     6        Reviewed by David Hyatt.
     7
     8        When performing hit testing inside a flow thread, we need to make sure that
     9        we actually hit some node from the flow thread content and not the flow thread
     10        itself (which would set the hit test result node to the document node, allowing
     11        wrong selection of content outside the empty region).
     12
     13        Test: fast/regions/selecting-text-in-empty-region.html
     14
     15        * rendering/RenderFlowThread.cpp:
     16        (WebCore::RenderFlowThread::hitTestFlowThreadPortionInRegion):
     17
    1182013-03-15  Luiz Agostini  <luiz.agostini@nokia.com>
    219
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r144773 r145884  
    314314    // Always ignore clipping, since the RenderFlowThread has nothing to do with the bounds of the FrameView.
    315315    HitTestRequest newRequest(request.type() | HitTestRequest::IgnoreClipping);
     316    HitTestResult tempResult(result);
    316317
    317318    // Make a new temporary HitTestLocation in the new region.
    318319    HitTestLocation newHitTestLocation(locationInContainer, -renderFlowThreadOffset, region);
    319320
    320     bool isPointInsideFlowThread = layer()->hitTest(newRequest, newHitTestLocation, result);
     321    bool isPointInsideFlowThread = layer()->hitTest(newRequest, newHitTestLocation, tempResult);
     322
     323    // We want to make sure we hit a node from the content inside the flow thread.
     324    isPointInsideFlowThread = isPointInsideFlowThread && !tempResult.innerNode()->isDocumentNode();
     325    if (isPointInsideFlowThread)
     326        result = tempResult;
    321327
    322328    // FIXME: Should we set result.m_localPoint back to the RenderRegion's coordinate space or leave it in the RenderFlowThread's coordinate
Note: See TracChangeset for help on using the changeset viewer.