Changeset 55353 in webkit


Ignore:
Timestamp:
Feb 27, 2010 4:39:27 AM (14 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/7696607> Links do not respect -webkit-user-drag: none
https://bugs.webkit.org/show_bug.cgi?id=35475

Reviewed by Maciej Stachowiak.

WebCore:

Test: fast/css/user-drag-none.html

  • page/DragController.cpp:

(WebCore::DragController::mayStartDragAtEventLocation): Added a node
parameter. The image drag check is done against the node, rather than
than against the hit test result. This prevents a non-draggable image
with an auto-draggable ancestor from being dragged alone. The link drag
check now ignores links that are -webkit-user-drag: none.

  • page/DragController.h:
  • page/EventHandler.cpp:

(WebCore::EventHandler::shouldDragAutoNode): Pass the current node
to mayStartDragAtEventLocation().

LayoutTests:

  • fast/css/user-drag-none-expected.txt: Added.
  • fast/css/user-drag-none.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r55351 r55353  
     12010-02-27  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        <rdar://problem/7696607> Links do not respect -webkit-user-drag: none
     6        https://bugs.webkit.org/show_bug.cgi?id=35475
     7
     8        * fast/css/user-drag-none-expected.txt: Added.
     9        * fast/css/user-drag-none.html: Added.
     10
    1112010-02-27  Xan Lopez  <xlopez@igalia.com>
    212
  • trunk/WebCore/ChangeLog

    r55352 r55353  
     12010-02-27  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        <rdar://problem/7696607> Links do not respect -webkit-user-drag: none
     6        https://bugs.webkit.org/show_bug.cgi?id=35475
     7
     8        Test: fast/css/user-drag-none.html
     9
     10        * page/DragController.cpp:
     11        (WebCore::DragController::mayStartDragAtEventLocation): Added a node
     12        parameter. The image drag check is done against the node, rather than
     13        than against the hit test result. This prevents a non-draggable image
     14        with an auto-draggable ancestor from being dragged alone. The link drag
     15        check now ignores links that are -webkit-user-drag: none.
     16        * page/DragController.h:
     17        * page/EventHandler.cpp:
     18        (WebCore::EventHandler::shouldDragAutoNode): Pass the current node
     19        to mayStartDragAtEventLocation().
     20
    1212010-02-27  Pavel Feldman  <pfeldman@chromium.org>
    222
  • trunk/WebCore/page/DragController.cpp

    r55029 r55353  
    513513}
    514514
    515 bool DragController::mayStartDragAtEventLocation(const Frame* frame, const IntPoint& framePos)
     515bool DragController::mayStartDragAtEventLocation(const Frame* frame, const IntPoint& framePos, Node* node)
    516516{
    517517    ASSERT(frame);
     
    524524
    525525    mouseDownTarget = frame->eventHandler()->hitTestResultAtPoint(framePos, true);
     526    if (node)
     527        mouseDownTarget.setInnerNonSharedNode(node);
    526528
    527529    if (mouseDownTarget.image()
     
    533535    if (!mouseDownTarget.absoluteLinkURL().isEmpty()
    534536        && m_dragSourceAction & DragSourceActionLink
    535         && mouseDownTarget.isLiveLink())
     537        && mouseDownTarget.isLiveLink()
     538        && mouseDownTarget.URLElement()->renderer() && mouseDownTarget.URLElement()->renderer()->style()->userDrag() != DRAG_NONE)
    536539        return true;
    537540
     
    541544
    542545    return false;
    543 
    544546}
    545547
  • trunk/WebCore/page/DragController.h

    r50810 r55353  
    7878        DragSourceAction delegateDragSourceAction(const IntPoint& pagePoint);
    7979       
    80         bool mayStartDragAtEventLocation(const Frame*, const IntPoint& framePos);
     80        bool mayStartDragAtEventLocation(const Frame*, const IntPoint& framePos, Node*);
    8181        void dragEnded();
    8282       
  • trunk/WebCore/page/EventHandler.cpp

    r55287 r55353  
    22182218        return false;
    22192219    Page* page = m_frame->page();
    2220     return page && page->dragController()->mayStartDragAtEventLocation(m_frame, point);
     2220    return page && page->dragController()->mayStartDragAtEventLocation(m_frame, point, node);
    22212221}
    22222222
Note: See TracChangeset for help on using the changeset viewer.