[webkit-changes] [WebKit/WebKit] b5ebe1: Element::dispatchMouseEvent should return whether ...
Abrar Rahman Protyasha
noreply at github.com
Thu Oct 12 12:42:43 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b5ebe19c24912a985953aa16786df965a9d7d12c
https://github.com/WebKit/WebKit/commit/b5ebe19c24912a985953aa16786df965a9d7d12c
Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
Date: 2023-10-12 (Thu, 12 Oct 2023)
Changed paths:
M Source/WebCore/dom/Element.cpp
M Source/WebCore/dom/Element.h
M Source/WebCore/page/EventHandler.cpp
Log Message:
-----------
Element::dispatchMouseEvent should return whether an event is prevented default
https://bugs.webkit.org/show_bug.cgi?id=263034
rdar://116859739
Reviewed by Wenson Hsieh.
As part of the changes in 269246 at main, Element::dispatchMouseEvent
received an extra out param to indicate whether a mouse event was
defaultPrevented.
This patch refactors dispatchMouseEvent to instead return a pair of
flags representing whether the event was dispatched and whether the
event was defaultPrevented. The former flag was already represented by
the original `bool` return type, while the latter flag was represented
through the out param.
I believe calling into dispatchMouseEvent, and receiving the
preventDefaulted information, is much more ergonomic following this
patch.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent):
* Source/WebCore/dom/Element.h:
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent):
Canonical link: https://commits.webkit.org/269266@main
More information about the webkit-changes
mailing list