Only connected shadow roots can be active tree scopes.

Stylesheet collection will be ensured, active scope added, and active
style will be marked dirty on ShadowRootInsertedIntoDocument(). Skip on
adopted stylesheets changes.

Added DCHECK to make sure we don't mark disconnected tree scopes dirty.

Bug: 942553
Change-Id: I71b991dbeec540e69f85a1fef3961f3b9efaa1e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1532104
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642746}
2 files changed