Fix Decimal.floor() + Decimal.ceiling() for many non-integral values.

Extend the check for an integral value to consider all the digits
being truncated, and not just the rightmost/most-significant one, when
rounding the result towards positive and negative infinity for floor()
and ceiling(), respectively.

R=yosin,mkwst
BUG=234323

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Simplify state handling in WebVTTTokenizer::nextToken

When the WebVTT tokenizer returns a new token, it always returns to the
'Data' state - except for when encountering an opening '<' while in the
'Data' state, and having collected a non-empty text-node. In that
particular case though, we can avoid the transition to the 'Tag' state
by not advancing the input, and simply return indicating a new token.

With the above change, and the change to always set the FSM state to
'Data', the 'state' argument to emitAndResumeIn() becomes redundant -
so it can be removed. With the argument gone, rename the method to
advanceAndEmitToken (since it no longer needs to set a state to resume
in). Also add a new method emitToken which only returns true, and
is currently only used as a marker.

Add a (currently unused) argument to the various emitter methods in
WebVTTTokenizer. Use this new argument to indicate what type of token
each return statement should produce.

With the annotations in place it becomes clear that - after adding
additional "ensurance" to one of the instances - that the emitEndOfFile
emitter is redundant (always emits "Character" tokens and always has a
token "buffered" - i.e. haveBufferedCharacterToken() will return true),
and can be replaced by a call to emitToken instead. This also means that
WebVTTToken::makeEndOfFile and the corresponding state can be removed.

BUG=319391

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

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