SpinButtonElement should release mouse capturing on detach.

This is a regression by r171006.
We have to release mouse capturing on detach() because a SpinButtonElement
captures mouse events even if the host element isn't focused.

The main change is to call releaseCapture() in SpinButtonElement::
detach(). Because releaseCapture() can dispatch 'change' events and
dispatching events in detach() isn't allowed, this CL adds a flag to
releaseCapture() and SpinButtonOwner::spinButtonDidReleaseMouseCapture().

BUG=362480

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171728 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Should updateRequiresOwnBackingStoreForAncestorReasons before everything else

updateRequiresOwnBackingStoreForAncestorReasons changes whether a compositing
layer paints to its own backing, which in turns invalidates many other layer
properties. This can cause inconsistencies that some of the layer properties
are computed using the old dirty value while some other properties use newly
computed value.

This CL moves updateRequiresOwnBackingStoreForAncestorReasons to the very
beginning of layer update, and also optimizes how compositing container is
computed during layer tree update.

BUG=359940

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171729 bbb929c8-8fbe-4397-9dbb-9b2b20218538