Issue #2030 - (chore) refactor event dispatch functions

Based on selected bits of M-C 1461708:
- EventStateManager::CheckForAndDispatchClick() to early-return style
- split EventStateManager::CheckForAndDispatchClick() into:
  EventCausesClickEvents, PostHandleMouseUp, DispatchClickEvents
- Move implementation of UIEvent::GetRangeParent() and UIEvent::RangeOffset() to nsLayoutUtils
This commit is contained in:
Martok 2022-11-27 16:35:25 +01:00 • committed by roytam1
commit 4d310562d9
5 changed files with 292 additions and 97 deletions

View file

@ -728,6 +728,21 @@ public:
nsPresContext* aPresContext,
const mozilla::WidgetEvent* aEvent);
/**
* Get container and offset if aEvent collapses Selection.
* @param aPresShell The PresShell handling aEvent.
* @param aEvent The event having coordinates where you want to
* collapse Selection.
* @param aContainer Returns the container node at the point.
* Set nullptr if you don't need this.
* @param aOffset Returns offset in the container node at the point.
* Set nullptr if you don't need this.
*/
static void GetContainerAndOffsetAtEvent(nsIPresShell* aPresShell,
const mozilla::WidgetEvent* aEvent,
nsIContent** aContainer,
int32_t* aOffset);
/**
* Translate from widget coordinates to the view's coordinates
* @param aPresContext the PresContext for the view