Changeset 102632 in webkit
- Timestamp:
- Dec 12, 2011 3:51:03 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r102630 r102632 1 2011-12-12 Jeremy Apthorp <jeremya@chromium.org> 2 3 When the mouse is dragged out of an :active element, it should lose :hover. 4 https://bugs.webkit.org/show_bug.cgi?id=57206 5 6 Reviewed by Ryosuke Niwa. 7 8 * fast/css/hover-active-drag-expected.txt: Added. 9 * fast/css/hover-active-drag.html: Added. 10 * platform/mac/fast/css/hover-active-drag-expected.txt: Removed. 11 * platform/chromium/fast/css/hover-active-drag-expected.txt: Removed. 12 1 13 2011-12-12 Kenneth Russell <kbr@google.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r102628 r102632 1 2011-12-12 Jeremy Apthorp <jeremya@chromium.org> 2 3 When the mouse is dragged out of an :active element, it should lose :hover. 4 https://bugs.webkit.org/show_bug.cgi?id=57206 5 6 Reviewed by Ryosuke Niwa. 7 8 Test: fast/css/hover-active-drag.html 9 10 * page/EventHandler.cpp: 11 (WebCore::EventHandler::handleMouseMoveEvent): Don't mark mouse-drag hit tests read-only, since they no longer are. 12 (WebCore::EventHandler::dragSourceEndedAt): Send a hit test request when the mouse goes up after a drag, so 13 RenderLayer has a chance to update the hover/active status. 14 * rendering/RenderLayer.cpp: 15 (WebCore::RenderLayer::updateHoverActiveState): Only allow the :active state to change on mouse down or mouse up. 16 1 17 2011-12-12 Kenneth Russell <kbr@google.com> 2 18 -
trunk/Source/WebCore/page/EventHandler.cpp
r102425 r102632 1613 1613 return m_lastScrollbarUnderMouse->mouseMoved(mouseEvent); 1614 1614 1615 // Mouse events should be treated as "read-only" in prepareMouseEvent if the mouse is1616 // pressed and we are allowed to select OR if we're updating only scrollbars. This1617 // means that :hover and :active freeze in the state they were in, rather than updating1618 // for nodes the mouse moves over while you hold the mouse down (in the mouse pressed case)1619 // or while the window is not key (as in the onlyUpdateScrollbars case).1620 1615 HitTestRequest::HitTestRequestType hitType = HitTestRequest::MouseMove; 1621 if ((m_mousePressed && m_mouseDownMayStartSelect) || onlyUpdateScrollbars)1622 hitType |= HitTestRequest::ReadOnly;1623 1616 if (m_mousePressed) 1624 1617 hitType |= HitTestRequest::Active; … … 2762 2755 void EventHandler::dragSourceEndedAt(const PlatformMouseEvent& event, DragOperation operation) 2763 2756 { 2757 // Send a hit test request so that RenderLayer gets a chance to update the :hover and :active pseudoclasses. 2758 HitTestRequest request(HitTestRequest::MouseUp); 2759 prepareMouseEvent(request, event); 2760 2764 2761 if (dragState().m_dragSrc && dragState().shouldDispatchEvents()) { 2765 2762 dragState().m_dragClipboard->setDestinationOperation(operation); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r102425 r102632 3979 3979 // We are clearing the :active chain because the mouse has been released. 3980 3980 for (RenderObject* curr = activeNode->renderer(); curr; curr = curr->parent()) { 3981 if (curr->node() && !curr->isText()) 3981 if (curr->node() && !curr->isText()) { 3982 curr->node()->setActive(false); 3982 3983 curr->node()->clearInActiveChain(); 3984 } 3983 3985 } 3984 3986 doc->setActiveNode(0); … … 3996 3998 } 3997 3999 } 4000 // If the mouse has just been pressed, set :active on the chain. Those (and only those) 4001 // nodes should remain :active until the mouse is released. 4002 bool allowActiveChanges = !activeNode && doc->activeNode(); 3998 4003 3999 4004 // If the mouse is down and if this is a mouse move event, we want to restrict changes in … … 4038 4043 size_t removeCount = nodesToRemoveFromChain.size(); 4039 4044 for (size_t i = 0; i < removeCount; ++i) { 4040 nodesToRemoveFromChain[i]->setActive(false);4041 4045 nodesToRemoveFromChain[i]->setHovered(false); 4042 4046 } … … 4044 4048 size_t addCount = nodesToAddToChain.size(); 4045 4049 for (size_t i = 0; i < addCount; ++i) { 4046 nodesToAddToChain[i]->setActive(request.active()); 4050 if (allowActiveChanges) 4051 nodesToAddToChain[i]->setActive(true); 4047 4052 nodesToAddToChain[i]->setHovered(true); 4048 4053 }
Note: See TracChangeset
for help on using the changeset viewer.