DescriptionDo not mutate ui::Event properties during nested event processing
If an EventProcessor starts to process a ui::Event while
it is already being processed by another EventProcessor,
then the properties of the event (e.g., target, phase)
should not be mutated by the inner processor before
control is returned to the outer processor. The exception
being whether or not the event has been handled.
To guarantee this, the inner processor should dispatch
a copy of the event rather than the original event
itself. This CL also introduces the static
ui::Event::Clone() method, which is used to create a
copy of a ui::Event.
BUG=404232
TEST=EventProcessorTest.NestedEventProcessing,
updated WindowManagerTest.Focus
Committed: https://crrev.com/88d8e4e3f6ced79844bf7a296bb5b9d6ac0ef4f5
Cr-Commit-Position: refs/heads/master@{#293410}
Patch Set 1 #
Total comments: 4
Patch Set 2 : forgot a Clone() override in a test suite #Patch Set 3 : allow copying of TestEvent #Patch Set 4 : comments addressed, test modified #
Total comments: 4
Patch Set 5 : only Clone() when needed #
Total comments: 4
Patch Set 6 : comments changed #
Messages
Total messages: 21 (5 generated)
|