Changeset 101619 in webkit
- Timestamp:
- Nov 30, 2011 11:20:59 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
- Property svn:executable deleted
r101617 r101619 1 2011-11-30 Jeremy Apthorp <jeremya@google.com> 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 1 11 2011-11-30 Hayato Ito <hayato@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
- Property svn:executable deleted
r101612 r101619 1 2011-11-30 Jeremy Apthorp <jeremya@google.com> 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-11-30 Hans Muller <hmuller@adobe.com> 2 18 -
trunk/Source/WebCore/page/EventHandler.cpp
r101416 r101619 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
r101333 r101619 3952 3952 // We are clearing the :active chain because the mouse has been released. 3953 3953 for (RenderObject* curr = activeNode->renderer(); curr; curr = curr->parent()) { 3954 if (curr->node() && !curr->isText()) 3954 if (curr->node() && !curr->isText()) { 3955 curr->node()->setActive(false); 3955 3956 curr->node()->clearInActiveChain(); 3957 } 3956 3958 } 3957 3959 doc->setActiveNode(0); … … 3969 3971 } 3970 3972 } 3973 // If the mouse has just been pressed, set :active on the chain. Those (and only those) 3974 // nodes should remain :active until the mouse is released. 3975 bool allowActiveChanges = !activeNode && doc->activeNode(); 3971 3976 3972 3977 // If the mouse is down and if this is a mouse move event, we want to restrict changes in … … 4011 4016 size_t removeCount = nodesToRemoveFromChain.size(); 4012 4017 for (size_t i = 0; i < removeCount; ++i) { 4013 nodesToRemoveFromChain[i]->setActive(false);4014 4018 nodesToRemoveFromChain[i]->setHovered(false); 4015 4019 } … … 4017 4021 size_t addCount = nodesToAddToChain.size(); 4018 4022 for (size_t i = 0; i < addCount; ++i) { 4019 nodesToAddToChain[i]->setActive(request.active()); 4023 if (allowActiveChanges) 4024 nodesToAddToChain[i]->setActive(true); 4020 4025 nodesToAddToChain[i]->setHovered(true); 4021 4026 }
Note: See TracChangeset
for help on using the changeset viewer.