Diff
Modified: trunk/LayoutTests/ChangeLog (102424 => 102425)
--- trunk/LayoutTests/ChangeLog 2011-12-09 04:19:48 UTC (rev 102424)
+++ trunk/LayoutTests/ChangeLog 2011-12-09 04:22:14 UTC (rev 102425)
@@ -1,3 +1,15 @@
+2011-12-08 Sheriff Bot <webkit.review....@gmail.com>
+
+ Unreviewed, rolling out r101619.
+ http://trac.webkit.org/changeset/101619
+ https://bugs.webkit.org/show_bug.cgi?id=74158
+
+ this patch produces bad behaviour on mac (Requested by
+ jeremya_ on #webkit).
+
+ * fast/css/hover-active-drag-expected.txt: Removed.
+ * fast/css/hover-active-drag.html: Removed.
+
2011-12-08 Adam Klein <ad...@chromium.org>
[MutationObservers] V8LazyEventHandler breaks microtask delivery semantics
Deleted: trunk/LayoutTests/fast/css/hover-active-drag-expected.txt (102424 => 102425)
--- trunk/LayoutTests/fast/css/hover-active-drag-expected.txt 2011-12-09 04:19:48 UTC (rev 102424)
+++ trunk/LayoutTests/fast/css/hover-active-drag-expected.txt 2011-12-09 04:22:14 UTC (rev 102425)
@@ -1,20 +0,0 @@
-Dragging out of an element should cause it to lose :hover
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-PASS background is "rgb(255, 0, 0)"
-PASS background is "rgb(0, 0, 0)"
-PASS background is "rgb(255, 255, 0)"
-PASS background is "rgb(0, 0, 0)"
-PASS background is "rgb(0, 255, 0)"
-PASS background is "rgb(0, 0, 0)"
-PASS background is "rgb(0, 255, 0)"
-PASS background is "rgb(0, 0, 0)"
-PASS background is "rgb(0, 0, 0)"
-PASS background is "rgb(0, 0, 0)"
-
-
-
-
-
-
Deleted: trunk/LayoutTests/fast/css/hover-active-drag.html (102424 => 102425)
--- trunk/LayoutTests/fast/css/hover-active-drag.html 2011-12-09 04:19:48 UTC (rev 102424)
+++ trunk/LayoutTests/fast/css/hover-active-drag.html 2011-12-09 04:22:14 UTC (rev 102425)
@@ -1,57 +0,0 @@
-<!DOCTYPE html>
-<style>
- div { background: rgb(0, 0, 0); }
- div:hover { background: rgb(255, 0, 0); }
- div:hover:active { background: rgb(255, 255, 0); }
- div:active { background: rgb(0, 255, 0); }
- div {
- width: 100px;
- height: 100px;
- border: 2px solid rgb(0, 0, 255);
- }
-</style>
-
-<body>
- <div id="box"></div>
- <div id="box2"></div>
- <pre id="description"></div>
- <pre id="console"></pre>
-</body>
-
-<script src=""
-<script>
- function backgroundOf(element) {
- return getComputedStyle(element, null).getPropertyValue("background-color")
- }
- function shouldHaveBackground(element, bg) {
- background = "" null).getPropertyValue("background-color")
- shouldBeEqualToString('background', bg)
- }
- if (window.layoutTestController) {
- description("Dragging out of an element should cause it to lose :hover")
- var box = document.getElementById('box')
- var box2 = document.getElementById('box2')
- layoutTestController.dumpAsText();
-
- eventSender.dragMode = false;
- eventSender.mouseMoveTo(50, 50)
- shouldHaveBackground(box, 'rgb(255, 0, 0)')
- shouldHaveBackground(box2, 'rgb(0, 0, 0)')
-
- eventSender.mouseDown()
- shouldHaveBackground(box, 'rgb(255, 255, 0)')
- shouldHaveBackground(box2, 'rgb(0, 0, 0)')
-
- eventSender.mouseMoveTo(50, 150)
- shouldHaveBackground(box, 'rgb(0, 255, 0)')
- shouldHaveBackground(box2, 'rgb(0, 0, 0)')
-
- eventSender.mouseMoveTo(400, 50)
- shouldHaveBackground(box, 'rgb(0, 255, 0)')
- shouldHaveBackground(box2, 'rgb(0, 0, 0)')
-
- eventSender.mouseUp()
- shouldHaveBackground(box, 'rgb(0, 0, 0)')
- shouldHaveBackground(box2, 'rgb(0, 0, 0)')
- }
-</script>
Modified: trunk/Source/WebCore/ChangeLog (102424 => 102425)
--- trunk/Source/WebCore/ChangeLog 2011-12-09 04:19:48 UTC (rev 102424)
+++ trunk/Source/WebCore/ChangeLog 2011-12-09 04:22:14 UTC (rev 102425)
@@ -1,3 +1,18 @@
+2011-12-08 Sheriff Bot <webkit.review....@gmail.com>
+
+ Unreviewed, rolling out r101619.
+ http://trac.webkit.org/changeset/101619
+ https://bugs.webkit.org/show_bug.cgi?id=74158
+
+ this patch produces bad behaviour on mac (Requested by
+ jeremya_ on #webkit).
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleMouseMoveEvent):
+ (WebCore::EventHandler::dragSourceEndedAt):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::updateHoverActiveState):
+
2011-12-08 Adam Klein <ad...@chromium.org>
[MutationObservers] V8LazyEventHandler breaks microtask delivery semantics
Modified: trunk/Source/WebCore/page/EventHandler.cpp (102424 => 102425)
--- trunk/Source/WebCore/page/EventHandler.cpp 2011-12-09 04:19:48 UTC (rev 102424)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2011-12-09 04:22:14 UTC (rev 102425)
@@ -1612,7 +1612,14 @@
if (m_lastScrollbarUnderMouse && m_mousePressed)
return m_lastScrollbarUnderMouse->mouseMoved(mouseEvent);
+ // Mouse events should be treated as "read-only" in prepareMouseEvent if the mouse is
+ // pressed and we are allowed to select OR if we're updating only scrollbars. This
+ // means that :hover and :active freeze in the state they were in, rather than updating
+ // for nodes the mouse moves over while you hold the mouse down (in the mouse pressed case)
+ // or while the window is not key (as in the onlyUpdateScrollbars case).
HitTestRequest::HitTestRequestType hitType = HitTestRequest::MouseMove;
+ if ((m_mousePressed && m_mouseDownMayStartSelect) || onlyUpdateScrollbars)
+ hitType |= HitTestRequest::ReadOnly;
if (m_mousePressed)
hitType |= HitTestRequest::Active;
@@ -2754,10 +2761,6 @@
void EventHandler::dragSourceEndedAt(const PlatformMouseEvent& event, DragOperation operation)
{
- // Send a hit test request so that RenderLayer gets a chance to update the :hover and :active pseudoclasses.
- HitTestRequest request(HitTestRequest::MouseUp);
- prepareMouseEvent(request, event);
-
if (dragState().m_dragSrc && dragState().shouldDispatchEvents()) {
dragState().m_dragClipboard->setDestinationOperation(operation);
// for now we don't care if event handler cancels default behavior, since there is none
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (102424 => 102425)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-12-09 04:19:48 UTC (rev 102424)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-12-09 04:22:14 UTC (rev 102425)
@@ -3978,10 +3978,8 @@
if (activeNode && !request.active()) {
// We are clearing the :active chain because the mouse has been released.
for (RenderObject* curr = activeNode->renderer(); curr; curr = curr->parent()) {
- if (curr->node() && !curr->isText()) {
- curr->node()->setActive(false);
+ if (curr->node() && !curr->isText())
curr->node()->clearInActiveChain();
- }
}
doc->setActiveNode(0);
} else {
@@ -3997,9 +3995,6 @@
doc->setActiveNode(newActiveNode);
}
}
- // If the mouse has just been pressed, set :active on the chain. Those (and only those)
- // nodes should remain :active until the mouse is released.
- bool allowActiveChanges = !activeNode && doc->activeNode();
// If the mouse is down and if this is a mouse move event, we want to restrict changes in
// :hover/:active to only apply to elements that are in the :active chain that we froze
@@ -4042,13 +4037,13 @@
size_t removeCount = nodesToRemoveFromChain.size();
for (size_t i = 0; i < removeCount; ++i) {
+ nodesToRemoveFromChain[i]->setActive(false);
nodesToRemoveFromChain[i]->setHovered(false);
}
size_t addCount = nodesToAddToChain.size();
for (size_t i = 0; i < addCount; ++i) {
- if (allowActiveChanges)
- nodesToAddToChain[i]->setActive(true);
+ nodesToAddToChain[i]->setActive(request.active());
nodesToAddToChain[i]->setHovered(true);
}
}