Eliminate calls to TextTrackCue::setIsActive outside of CueTimeline

Hoisting the calls to setIsActive and removeDisplayTree out of
TextTrackCueList::updateCueIndex into its single caller
(TextTrack::cueDidChange), it becomes evident that at this point in the
state update, the cue in question should already be both inactive and
have had its "display tree" removed. Hence the pair of calls can be
dropped.
The same logic can also be applied in TextTrack::removeCue where we
have the same operations being performed.
Reorganize the code slightly to get timeline updates at the end of the
cue{Will,Did}Change methods, and document the invariants.

BUG=321654

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

git-svn-id: svn://svn.chromium.org/blink/trunk@190927 bbb929c8-8fbe-4397-9dbb-9b2b20218538
2 files changed
tree: cdc4dfa49260136f0d066a7ae1b9aeabcfdea8a1
  1. third_party/