Hassan f0e2596c5c [web] - Fix autofill group input ordering (flutter/engine#42268)
Ordering of input elements inside of the DOM tree for autofill groups does not reflect the order of the form rendered on screen.  This is causing some issues with password managers and autofill, specifically Bitwarden.

We are currently always appending the currently focused input element to the end of the form. 

This leads to a tree that appears out of order:
<img width="354" alt="Screenshot 2023-05-23 at 2 57 37 PM" src="https://github.com/flutter/engine/assets/110993981/7e90a93f-5522-4482-8fb6-a1607b403d10">

This fix is tracking the position of where the focused input node should be inserted and inserting it there, rather than always at the end of the form.  Once the tree is ordered correctly, Bitwarden's autofill logic works in Flutter forms. 

Tree order after fix:
<img width="502" alt="Screenshot 2023-05-23 at 6 01 05 PM" src="https://github.com/flutter/engine/assets/110993981/bd15a8a1-71f4-4f28-a86e-1903953bf030">

Fixes https://github.com/flutter/flutter/issues/61301
2023-05-26 16:17:18 +00:00
Languages
Dart 75%
C++ 16.5%
Objective-C++ 2.9%
Java 2.8%
Objective-C 0.7%
Other 1.9%