Fix LayoutTests that assume canplay, playing, and canplaythrough will only fire once.

Several tests are written under the assumption that the canplay, playing,
and canplaythrough events will only ever fire once. While this is true
for the current implementation, the HTML5 spec allows these events to
fire multiple times during the life of an HTMLMediaElement. This
change just modifies the tests so that they properly reflect their
intent, which is to run some code the first time these events fire.
This frees us to change how we do readyState transitions, which cause
extra events to fire, without breaking these tests.

BUG=144683

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162724 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Auto-rebaseline for r162676

http://src.chromium.org/viewvc/blink?view=revision&revision=162676

BUG=251500
TBR=noel@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162725 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Auto-rebaseline for r162666

http://src.chromium.org/viewvc/blink?view=revision&revision=162666

TBR=vollick@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162726 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Auto-rebaseline for r162650

http://src.chromium.org/viewvc/blink?view=revision&revision=162650

TBR=fmalita@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162727 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Auto-rebaseline for r162710

http://src.chromium.org/viewvc/blink?view=revision&revision=162710

BUG=322887
TBR=joth@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162728 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Auto-rebaseline for r162706

http://src.chromium.org/viewvc/blink?view=revision&revision=162706

BUG=302005
TBR=skobes@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162729 bbb929c8-8fbe-4397-9dbb-9b2b20218538
HTMLMediaElement::clearMediaPlayer should acquire MediaElementAudioSourceNode::lock()

Crash report: https://cluster-fuzz.appspot.com/testcase?key=5123869056696320

There is threading race between HTMLMediaElement::clearMediaPlayer and other methods which try to use HTMLMediaElement::m_player. clearMediaPlayer has to acquire a lock before clearing m_player, just like createMediaPlayer is acquiring the lock before clearing m_player.

c.f., https://chromiumcodereview.appspot.com/23691033/ is a CL that added the lock to createMediaPlayer.

BUG=320344

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162730 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Call toWebCoreAtomicString() in V8Window::namedSecurityCheckCustom()

Call toWebCoreAtomicString() in V8Window::namedSecurityCheckCustom() instead
of toWebCoreString(). This avoids uselessly creating a String and then
convert it to an AtomicString since FrameTree::scopedChild() takes an
AtomicString in argument.

R=haraken
BUG=323739

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162731 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Copy TextIterator.{cpp.h} to UnicodeUtilities.{cpp,h}

This patch copies Source/core/editing/TextIterator.{cpp,h} into Source/core/platform/text/UnicodeUtilities.{cpp,h} for decoupling TextIterator and a set of Unicode utility functions.

Another patch will complete decoupling.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162732 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Derive the step base for an input element as (now) specified.

Determine the step base for an input element per spec,

  http://www.whatwg.org/specs/web-apps/current-work/#concept-input-min-zero

That is, consult the 'value' attribute if 'min' is not present, and
then fallback to the default step base for the input type if that
isn't present either. Previously, 'value' was not considered.

R=
BUG=257369

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162733 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make Page::history() return a reference

This CL makes the calling code look safer as it can never return null.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162734 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Have Locale::create() take a String in argument

Have Locale::create() take a String in argument instead of an AtomicString
as the implementation then converts it back to a String anyway.

This also avoids uselessly converting a String a an AtomicString in one
of the callers: Locale::defaultLocale(). The languages are stored / exposed
as Strings in Language.*

R=abarth
BUG=323739

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

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