Don't allow scripts to run when a node is being adopted.

Running a script in the middle of rescoping nodes can break a lot of invariants and leave DOM in an inconsistent state.

This patch adds a ScriptForbiddenScope in TreeScope::adoptIfNeeded to ensure it never happens.

BUG=605766

Review URL: https://codereview.chromium.org/1910403003

Cr-Commit-Position: refs/heads/master@{#389425}
(cherry picked from commit 146ff1bb11c88778d466bd7a49b544f2b5806ee0)

TBR=dominicc@chromium.org,esprehn@chromium.org

Review URL: https://codereview.chromium.org/1953323002 .

Cr-Commit-Position: refs/branch-heads/2661@{#665}
Cr-Branched-From: ef6f6ae5e4c96622286b563658d5cd62a6cf1197-refs/heads/master@{#378081}
1 file changed