[Reland] Simplify scroll to fragment code

This patch simplifies the code to scroll to fragment (i.e. scrolling to
an Element with id="foo" when navigating to http://ex.pl/index.html#foo)
code by moving more of it into LocalFrameView rather than in Document.

Previously, we kept some state whether rendering was blocked when the
URL fragment was processed and if it was we'd try to perform the scroll
later in the document lifecycle. This patch removes the state tracking
and relies entirely on the scroll happening in PerformPostLayoutTasks if
it can't be done immediately.

It also moves focusing on the fragment element into the method that
performs the scrolling, tying these together. This appears to have been
the original intent based on the comment in ProcessUrlFragment but
changes behavior slightly.

Re-land Note: This was originally reverting because script could run
inside the ScriptForbiddenScope in UpdateLayout
(https://crbug.com/796222). This patch removes the ScriptForbiddenScope
in Document::UpdateStyleAndLayout since both UpdateStyleAndLayoutTree
and UpdateLayout are guarded internally by ScriptForbiddenScope. It also
narrows the scope of the ScriptForbidden section in UpdateLayout to not
include the call to Document::LayoutUpdated and moves the scrolling and
focus related methods there.

Bug: 795381, 830881
Change-Id: I571932217a0664f21fae8463d26b2c807a5f565e
Reviewed-on: https://chromium-review.googlesource.com/1010264
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551499}
4 files changed