Fix delegation combined with delegatesFocus by consolidating code.
This fixes bugs with clicks on a being delegated to the
labelled element combined with the label element being the shadow host
for a ShadowRoot with delegatesFocus (in particular, that the delegation
only works when the click is on the directly and not a
descendant) by consolidating the code with the existing focus delegation
code for labels rather than having it in two places.
Fixed: 347356462
Bug: 1300587, 329003651
Change-Id: Id28f590e25ca0589a147e1a0fe233b6f14e877ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5665482
Commit-Queue: David Baron dbaron@chromium.org
Reviewed-by: Joey Arhar jarhar@chromium.org
Cr-Commit-Position: refs/heads/main@{#1325248}