Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b5ebe19c24912a985953aa16786df965a9d7d12c
      
https://github.com/WebKit/WebKit/commit/b5ebe19c24912a985953aa16786df965a9d7d12c
  Author: Abrar Rahman Protyasha <[email protected]>
  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@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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to