Don't updateRenderTree in the middle of a DOM insertion.

After [1] landed, this CL is now a revert of using a flag for postponing
scrolling, and scroll from didNotifySubtreeInsertion instead. The original
description for this fix below. The crasher was fixed by [1].
    
[1] https://codereview.chromium.org/783983005

The original description:

When inserting an OPTION element with the selected attribute set, we
synchronously scroll to that OPTION to make it visible. A prerequisite for
scrolling is to have the render tree up-to-date. At this point only parts
of the inserted fragment had its inDocument() flag set which caused a crash
when a nullptr was returned for the computed style of an input spinner.

Ideally, we should not scroll synchronously from the dom insertion code.
This CL moves scrolling from insertedInto() to didNotifySubtreeInsertion().
The inDocument() flags are up-to-date when didNotifySubtreeInsertion()
is called.

An ASSERT is added to Element::recalcStyle to catch other cases of calling
updateRenderTree in the middle of a dom insertion.

R=esprehn@chromium.org
BUG=438615

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

git-svn-id: svn://svn.chromium.org/blink/trunk@187437 bbb929c8-8fbe-4397-9dbb-9b2b20218538
7 files changed
tree: d6decc785176c921d22faef5ee28da5204dc8bc0
  1. third_party/