Count references to adopted sheets in tree scopes
adoptedStyleSheets may contain multiple references to the same sheet. In
particular temporarily while modifying the array. Using a HashSet
without counting the references did not work.
Replace the HashSet with a HashMap to count the references to correctly
remove a sheet as referenced by a TreeScope.
Bug: 331051345
Change-Id: I4028ea995a647566dc586a7b0d05753f7d09c9ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5574986
Reviewed-by: Anders Hartvoll Ruud andruud@chromium.org
Commit-Queue: Rune Lillesveen futhark@chromium.org
Cr-Commit-Position: refs/heads/main@{#1306684}