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
We can reuse the variable which is already declared.

It is better to reuse the already declared variable than function call.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171730 bbb929c8-8fbe-4397-9dbb-9b2b20218538
We don't need overloading about fill, clip, isPointInPath anymore.

We can use default parameter instead of method overloading about fill, clip, isPointInPath.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171731 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Avoid duplication of calling getTransformedClipBounds in stroke APIs.

We can avoid duplication of calling getTransformedClipBounds by using computeDirtyRect which takes three arguments.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171733 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Document.dir should reflect the 'dir' attribute of the root html element

Document.dir should reflect the 'dir' attribute of the root html element as per
the specification:
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-document-dir

Previously, Chromium was reflecting the the 'dir' attribute of the body
element. The new behavior is consistent with Firefox 28 and IE11.

R=arv@chromium.org,tkent@chromium.org
BUG=363107
TEST=fast/dom/document-dir-property.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171734 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Web Animations: Fix test for Element destructor clean-up

This fixes a small typo in a test introduced in crrev.com/236833002. The
test checks that an animation's target member is cleared upon element
destruction, but I forgot to actually set the target initially on the
animation.

BUG=362404

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171735 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove style check for comparison to zero

Keeps comparison to true/false and null/non-null, hence renaming test to
[readability/comparison_to_boolean]

Per discussion:
Can we lose readability/comparison_to_zero?
https://groups.google.com/a/chromium.org/d/topic/blink-dev/3HVOC-5mFxE/discussion

Docs updated:
http://www.chromium.org/blink/coding-style#TOC-Null-false-and-0

TEST=test-webkitpy

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171736 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Web Animations: Rename TimedItem.specified to TimedItem.timing.

Meeting minutes describing this change:
http://lists.w3.org/Archives/Public/public-fx/2014AprJun/0005.html.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171737 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use filters in build/ scripts

Only change to generated files is to add a comment on closing #endif, as:
#if ENABLE(Foo)
...
#endif // ENABLE(Foo)

build/ scripts unnecessarily use macros (and |call|) where a filter
would be clearer, notably for wrapping with an #if directive.
This fixes it, simplifying the template usage.

Also factors out some name-mangling functions to the name-mangling library
(removes 2 FIXMEs) and simplifies a rather twisty regex into a simple
split + join.

(Also fixes hasher.py, which shouldn't have a #! shebang.)

R=abarth

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171738 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Call WorkerGlobalScope::dispose() before the WorkerGlobalScope object is destructed

(This is a preparation to replace workerGlobalScopeDestroyed() with willBeWorkerGlobalScopeDestroyed().
See https://codereview.chromium.org/238273004/ for more details.)

Currently in the oilpan build, WorkerGlobalScope::dispose() is called before ~WorkerGlobalScope is called.
In the non-oilpan build, WorkerGlobalScope::dispose() is called inside ~WorkerGlobalScope.
This is inconsistent and it is not a good thing to have different call sequences between the oilpan build
and the non-oilpan build.

This CL makes a change so that WorkerGlobalScope::dispose() is called before ~WorkerGlobalScope is called
in the non-oilpan build.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171739 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rAc: dispatch 'invalid' events when checking validity after autofilling.

R=tkent@chromium.org
BUG=361843

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171740 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Web Animations: Schedule restart of compositor animations following a timing change

When a change to the timing of an animation was made the system cancels
any corresponding animations and falls back to animation on the main
thread.

r171123[1] added support for starting compositor animations with fixed
start times. That allows this patch to schedule animations to attempt
a restart on the compositor following a timing change. The new compositor
animation is given a start time that seeks to the current position in
the animation.

[1] http://src.chromium.org/viewvc/blink?view=rev&rev=171123

BUG=360471,352422

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171741 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add WorkerReportingProxy::willDestroyWorkerGlobalScope() method

Before r169460 workerGlobalScopeDestroyed() used to be called in
WorkerGlobalScope's destructor, but after r169460 it has started
to be called *after* WorkerGlobalScope destruction, which broke
ServiceWorker code that was relying on the validity of WorkerGlobalScope
in workerGlobalScopeDestroyed().

To clarify the behavior of this notification (since the method name
suggests it's called during or after destruction) this patch adds
WorkerReportingProxy::willDestroyWorkerGlobalScope()
which is guaranteed to be called *before* WorkerGlobalScope is actually
destructed, and use the method for last-minutes cleanup in ServiceWorker.

chromium-side patch is:
https://codereview.chromium.org/238603004/
BUG=361790
TEST=content_browsertests:ServiceWorker\*

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

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