Yegor 3c43a9939b
[web] do not send SemanticsAction.focus inside frame (#162554)
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
2025-02-04 02:29:19 +00:00
..

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:

  1. Copy one of the engine/scripts/*.gclient to the root folder as .gclient:
    1. Googlers: copy rbe.gclient to enable faster builds with RBE
    2. Everyone else: copy standard.gclient
  2. run gclient sync from the root folder