Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3e45e6390201e5c933ad911fbf856437e05e30d5
https://github.com/WebKit/WebKit/commit/3e45e6390201e5c933ad911fbf856437e05e30d5
Author: Chris Dumez <[email protected]>
Date: 2023-03-20 (Mon, 20 Mar 2023)
Changed paths:
M Source/WebCore/dom/EventDispatcher.cpp
Log Message:
-----------
Minor optimizations to EventDispatcher::dispatchEvent()
https://bugs.webkit.org/show_bug.cgi?id=254170
Reviewed by Darin Adler.
Minor optimizations to EventDispatcher::dispatchEvent():
- Use a bool instead of a std::optional<bool> for
shouldClearTargetsAfterDispatch
since we don't need 3 states.
- Minimize calls to `event.type() == eventNames().clickEvent` since
`eventNames()`
is not super cheap.
- Minimize calls to shouldSuppressEventDispatchInDOM() and avoid calling
`event.stopPropagation()` when this function returns true. We can factor the
`if` check so that setting the stop propagation flag on the event is not
actually
necessary. Note that we call `resetAfterDispatch()` on the event shortly
after,
which resets the stop propagation flag anyway.
* Source/WebCore/dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent):
Canonical link: https://commits.webkit.org/261906@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes