Link stylesheets in shadow trees do not belong to document scope.

We have incorrectly kept DCHECKs checking that stylesheets in shadow
trees come from style elements. That is no longer true, and modifying
link elements in shadow trees would trigger some of these DCHECKs.

Also, we simply used Document as the TreeScope handling link elements.
Always use the treeScope() from the associated node instead. Using the
wrong TreeScope in these cases would cause missing updates of active
stylesheets in ShadowTreeStyleSheetCollections for AnalyzedStyleUpdate.
I have not been able to find a triggering test case for this.

R=hayato@chromium.org,kochi@chromium.org
BUG=661914

Review-Url: https://codereview.chromium.org/2472973002
Cr-Commit-Position: refs/heads/master@{#429877}
2 files changed