Fix script-lifecycle violations with fragment anchors

In https://crrev.com/dbd4eed1920a2aafbc87236db7efb98f108ba063 I moved
around some fragment scrolling code to simplify and clean it up. As part
of that, I made focusing and scrolling happen at the same time.

Unfortunately, as noted in [1], this violates the lifecycle assumptions
since focus() can synchronously execute an event handler - script is
forbidden in the entire lifecycle, not just within layout.

This CL undoes the loosening of the ScriptForbiddenScopes from the CL
above. To do that, FragmentAnchor splits up the application of focus
from scrolling and tries to apply focus at the time of FragmentAnchor
creation (i.e. during parsing/navigation). If we can't apply it then
(because rendering is blocked) it'll be applied at BeginFrame time,
before rAF callbacks are executed.

[1] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/5BJSTl-FMGY

Change-Id: If2c4c638f3f0faa7dab23e7e129c196357076fad
Bug: 795381
Reviewed-on: https://chromium-review.googlesource.com/c/1408217
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625402}
11 files changed