Re-land r161702 after fixing the performance regression.

The previous codereview is: https://codereview.chromium.org/59903015.
The performance regression is: http://code.google.com/p/chromium/issues/detail?id=318057.

To fix the performance regression, I've updated the distribution resolution algorithm in the Shadow DOM
specification.

The spec change is:
  -  [Shadow]: Optimize the distribution resolution algorithm.
     https://github.com/w3c/webcomponents/commit/2b051a63c4c95edd3ab337bf49a67d12e4cd2061

This patch reflects the change of the spec. Now this patch shouldn't sacrifice the performance significantly in theory.


The followings are the result of performance tests on my local machine:

- /ShadowDOM/ChangingClassName.html: 3.76% worse
- /ShadowDOM/ChangingSelect.html: 5.54% worse
- /ShadowDOM/ChangingSelectWithoutShadow.html: 3.93% worse
- /ShadowDOM/ContentReprojection.html: 3.18% better
- /ShadowDOM/MultipleInsertionPoints.html: 3.98% Better
- /ShadowDOM/ShadowReprojection.html: 2.9% Better
- /ShadowDOM/SmallDistributionWithLayout.html: 4.53% Better

If you find any performance regression other that those tests, please file a bug.

BUG=316513, 318057

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162066 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 162050 "Rename es => exceptionState in other than bindings/"

2 files to check:
Source/core/xml/XPathExpression.cpp
Source/web/SharedWorkerRepositoryClientImpl.cpp

> Rename es => exceptionState in other than bindings/
> 
> Mechanical renaming, via sed replace:
> cd "$BLINK_DIR/Source" && \
> sed -ri 's/\<es\>/exceptionState/g' \
>     $(git grep -w es | grep -v '^bindings')
> 
> AFAICT there are no uses of 'es' in URLs or documentation which are
> affected by this, unlike for bindings/, where there are links to Web IDL
> spec using 'es-...'.
> 
> Followup to:
> Rename es => exceptionState in bindings/
> https://codereview.chromium.org/68893018/
> 
> R=haraken@chromium.org
> TBR=abarth
> 
> Review URL: https://codereview.chromium.org/72363002

TBR=nbarth@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162067 bbb929c8-8fbe-4397-9dbb-9b2b20218538
IndexedDB: Constness sprinkles for some accessor methods

Sprinkle "const" around a few accessor methods. This also lets us
eliminate the 'keyPathAny' hack for IDBObjectStore, and CL 73313002
is taking care of that for IDBIndex.

R=alecflett@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162068 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Update comment in NodeRenderingTraversal::parent

This comment came from long ago when we were still working on lazy attach,
now it seems the thing blocking the ASSERT is that some callers of
NodeRenderingTraversal::parent are in places where distribution might be
dirty, ex. HTMLSummaryElement::detailsElement().

Perhaps we should add calls to updateDistributionForNodeIfNeeded to those
callers and then add the assert. For now this patch just fixes the comment.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162069 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Removed unused function declaration and member variable from RenderText

R=abarth@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162070 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Web Animations CSS: Add missing return in calculateAnimationCompositableValues

The common case where we have no new or cancelled animations is supposed
to exit early but I missed a return statement in crrev.com/52093002.

BUG=258896

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162071 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Web Animations CSS: implement transform and filter support for scheduling
animations on the compositor.

BUG=298211

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162072 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Do not dispatch 'beforeload' event inside FrameView::layout().

Executing JavaScript code inside FrameView::layout() is problematic.
e.g. an assertion failure tested in fast/events/beforeload-assertion.html.
We should avoid it.

This CL  makes 'beforeload' event dispatching for plugins and iframes asynchronous,
except plugin access from JavaScript code (HTMLPlugInElement::
renderWidgetForJSBindings).

BUG=265889,313005,315979
R=esprehn@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162073 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Copy EditorClient.h and EditorClientImpl.{cpp,h} to SpellCheckerClient.h and SpellCheckerClientImpl.{cpp,h}

This patch is a part of introducing SpellCheckerClient and SpellCheckerClientImpl. Another patch will update GYP files, e.g. http://crrev.com/66503015

This patch copies following files to introduce SpellCheckerClient for ease of maintaining editing feature and spell check feature:
- core/page/EditorClient.h to core/page/SpellCheckerClient.h
- web/EditorClientImpl.{cpp,h} to web/SpellCheckerClientImpl.{cpp,h}

BUG=n/a
TEST=n/a; no behavior changes

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162074 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert "Use HarfBuzz on windows"

Looks like it breaks build on Win x64 Release build (chromium).

http://build.chromium.org/p/tryserver.chromium/builders/win_x64_rel/builds/54241/steps/compile/logs/stdio#error1

FAILED: ninja -t msvc -e environment.x64 -- E:\b\build\goma\gomacc.exe
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64\cl.exe"
/nologo /showIncludes /FC
@obj\third_party\harfbuzz-ng\src\harfbuzz-ng.hb-fallback-shape.obj.rsp /c
..\..\third_party\harfbuzz-ng\src\hb-fallback-shape.cc
/Foobj\third_party\harfbuzz-ng\src\harfbuzz-ng.hb-fallback-shape.obj
/Fdobj\third_party\harfbuzz-ng\harfbuzz-ng.pdb
e:\b\build\slave\win\build\src\third_party\harfbuzz-ng\src\hb-font-private.hh(237)
:error C2220: warning treated as error - no 'object' file generated
e:\b\build\slave\win\build\src\third_party\harfbuzz-ng\src\hb-font-private.hh(237)
: warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
e:\b\build\slave\win\build\src\third_party\harfbuzz-ng\src\hb-font-private.hh(375)
: warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data

BUG=313423
TBR=eae
R=eae

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

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