Eliminate TextTrackCue::updateDisplayTree()

updateDisplayTree() cloned and inserted a new tree every time, and was
called continuously from CueTimeline::updateActiveCues(). The net effect
of this was to re-layout the cue continuously, causing cues to move into
areas where a cue was previously. The letter and spirit of the WebVTT
spec is to have a stable layout, where cues do not move once laid out.

TEST=LayoutTests/media/track/track-webvtt-two-cue-layout-after-first-end.html

As the display tree is now kept intact, it becomes necessary to
invalidate the style in setIsPastNode.

Test coverage of past and future cues:
LayoutTests/media/track/cue-style-invalidation.html
LayoutTests/media/track/track-css-matching-timestamps.html
LayoutTests/media/track/track-css-matching.html

Note that per spec a part of the cue could match neither :past nor
:future, but our implementation is mutually exclusive. It's not clear
what the best behavior is, so a spec bug was filed instead:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28237

BUG=322434

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

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