Fix updating snap containers on loss/gain of focus
In the linked bug, a smooth anchor scroll failed to happen because
a snap area within the snap container would gain focus, causing Blink
to AddPendingSnapUpdates[1] for this container. Doing so also
causes it to snap when the updates are executed[2] which causes all
ongoing animations to be cancelled[3].
This patch fixes this by having the focus update simply update the
snap container's snap areas and avoid triggering a snap.
[1]https://source.chromium.org/chromium/chromium/src/+/6f8108c5c41a2c71c48143103bf3d80222286996:third_party/blink/renderer/core/dom/element.cc;l=6568
[2]https://source.chromium.org/chromium/chromium/src/+/6f8108c5c41a2c71c48143103bf3d80222286996:third_party/blink/renderer/core/frame/local_frame_view.cc;l=5007
[3]https://source.chromium.org/chromium/chromium/src/+/a8cc9d0a5ba00223ba0ee90220b4f20663286673:third_party/blink/renderer/core/scroll/scrollable_area.cc;l=1331
Bug: 338094933
Change-Id: Id597f0c80fa256ef53777f26cbc0bcfa463dac5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5527253
Commit-Queue: David Awogbemila awogbemila@chromium.org
Reviewed-by: Steve Kobes skobes@chromium.org
Cr-Commit-Position: refs/heads/main@{#1301972}