
When a `SemanticsAction` fires while rendering a frame, delay it by a zero-length timer. ## Explanation A concrete situation where this happens is when a semantics update causes DOM focus shift. DOM focus events are delivered synchronously when induced programmatically. We _want_ to notify the framework about the shift. Since it wasn't the framework that decided where the focus moved, the framework may end up out-of-sync with the engine about which widget is currently focused. However, if the framework is still in the middle of rendering a frame, the notification may induce an illegal `setState`. We have to wait until the framework is done before delivering the notification. ## How * Introduce `FrameService` and consolidate all frame scheduling logic into it (this also makes it way more testable). * Update all code that needs to schedule frames to use `FrameService`. * Introduce `isRenderingFrame` boolean that can be used to tell if a frame is being rendered. * Change `invokeOnSemanticsAction` to use `isRenderingFrame` to decide if the action can be delivered immediately, or delayed by a zero-length timer. Fixes https://github.com/flutter/flutter/issues/162472
Flutter Engine
Setting up the Engine development environment
See here
gclient
bootstrap
Flutter engine uses gclient
to manage dependencies.
If you've already cloned the flutter repository: