While working on this, I realised that the `current_state`
computation was wrong. Instead, the spec actually clearly
defines what to do, but I hadn't found it yet. The code
now correctly implements state computation and voila, it
also fixes the previous underline issue that I didn't
understand why it would fail.
Part of #25005
Testing: WPT
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>