+2007-01-26 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Darin.
+
+ Fix for <rdar://problem/4956565> REGRESSION: After scrolling frame,
+ hovering over link in this frame doesn't change cursor to pointing
+ hand
+
+ The mouseMove event was not being propagated correctly after using
+ the mouse to scroll the frame because m_mousePressed was never
+ getting set to false.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleMousePressEvent): This code does not
+ belong here.
+ * page/EventHandler.h: lastEventIsMouseUp() is only ever relevant
+ in EventHandlerMac, so it can just be a static function there.
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::lastEventIsMouseUp): Make this static.
+ (WebCore::EventHandler::passMouseDownEventToWidget): Here is where
+ we need to set m_mousePressed to false if lastEventIsMouseUp() is
+ true.
+
2007-01-26 David Hyatt <hyatt@apple.com>
Fix for style regression caused by strictness checking of the number of properties. This caused code like:
swallowEvent = true;
else
swallowEvent = handleMousePressEvent(mev);
-
- // Many AK widgets run their own event loops and consume events while the mouse is down.
- // When they finish, currentEvent is the mouseUp that they exited on. We need to update
- // the khtml state with this mouseUp, which khtml never saw.
- // If this event isn't a mouseUp, we assume that the mouseUp will be coming later. There
- // is a hole here if the widget consumes the mouseUp and subsequent events.
- if (lastEventIsMouseUp())
- m_mousePressed = false;
}
return swallowEvent;
return passMouseDownEventToWidget(renderWidget->widget());
}
+static bool lastEventIsMouseUp()
+{
+ // Many AK widgets run their own event loops and consume events while the mouse is down.
+ // When they finish, currentEvent is the mouseUp that they exited on. We need to update
+ // the khtml state with this mouseUp, which khtml never saw. This method lets us detect
+ // that state.
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent];
+ if (currentEvent != currentEventAfterHandlingMouseDown &&
+ [currentEventAfterHandlingMouseDown type] == NSLeftMouseUp &&
+ [currentEventAfterHandlingMouseDown timestamp] >= [currentEvent timestamp])
+ return true;
+ END_BLOCK_OBJC_EXCEPTIONS;
+
+ return false;
+}
+
bool EventHandler::passMouseDownEventToWidget(Widget* widget)
{
// FIXME: this method always returns true
// Remember which view we sent the event to, so we can direct the release event properly.
m_mouseDownView = view;
m_mouseDownWasInSubframe = false;
-
- END_BLOCK_OBJC_EXCEPTIONS;
-
- return true;
-}
-
-bool EventHandler::lastEventIsMouseUp() const
-{
- // Many AK widgets run their own event loops and consume events while the mouse is down.
+
+ // Many AppKit widgets run their own event loops and consume events while the mouse is down.
// When they finish, currentEvent is the mouseUp that they exited on. We need to update
- // the khtml state with this mouseUp, which khtml never saw. This method lets us detect
- // that state.
+ // the EventHandler state with this mouseUp, which we never saw.
+ // If this event isn't a mouseUp, we assume that the mouseUp will be coming later. There
+ // is a hole here if the widget consumes both the mouseUp and subsequent events.
+ if (lastEventIsMouseUp())
+ m_mousePressed = false;
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent];
- if (currentEvent != currentEventAfterHandlingMouseDown &&
- [currentEventAfterHandlingMouseDown type] == NSLeftMouseUp &&
- [currentEventAfterHandlingMouseDown timestamp] >= [currentEvent timestamp])
- return true;
END_BLOCK_OBJC_EXCEPTIONS;
- return false;
+ return true;
}
// Note that this does the same kind of check as [target isDescendantOf:superview].