Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
PresShell::EventHandler::DispatchPrecedingPointerEvent
update …
…event target after dispatching a pointer event The reason of the bug is, no `mouseup` event is fired after the `pointerup` event listener removed the target. Therefore, `nsIFrame::HandleRelease()` does not run and nobody cleans up the drag state of the `nsFrameSelection`. This is caused by that `PresShell::EventHandler::DispatchPrecedingPointerEvent()` updates only event target frame of the following mouse event target if the pointer event target was removed from the tree, however, the frame may not be ready. In this case, `PresShell::GetCurrentContent()` will clear both current event target content and frame because its composed document (`nullptr`) never matches with the document for the `PresShell`. Therefore, it needs to update the target too. This patch makes all developers won't create similar bugs, this encapsulate `EventTargetData::mContent` and `EventTargetData::mFrame` to make their setters clean up or automatically check the relation. Differential Revision: https://phabricator.services.mozilla.com/D201053 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1877815 gecko-commit: 88c50740c90849f41b36a3ebdea5c1182d010b62 gecko-reviewers: smaug
- Loading branch information