Handle recovery on "timestamp-looking" lines in the WebVTT parser
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 18:41:08 +0000 (18:41 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 18:41:08 +0000 (18:41 +0000)
commit8d02a856b1d161612e7042ad30c8c2d2876fccfc
tree943589297a3d4876c06b3e666d91e083e9a622f3
parent939053cdbaff4c9ec5af78f67c05ddee4695b79f
Handle recovery on "timestamp-looking" lines in the WebVTT parser
https://bugs.webkit.org/show_bug.cgi?id=130610

Reviewed by Eric Carlson.

Merged from Blink (patch by fs@opera.com):
https://chromium.googlesource.com/chromium/blink/+/b669a380efbffe25f3b154b026b57b9822ce08e2
http://crbug.com/75273002

Source/WebCore:

Tests: media/track/track-webvtt-tc031-cue-recovery.html
       media/track/track-webvtt-tc032-degenerate-cues.html

* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::parse):
(WebCore::WebVTTParser::collectCueText):
(WebCore::WebVTTParser::recoverCue):
(WebCore::WebVTTParser::ignoreBadCue):
* html/track/WebVTTParser.h:

LayoutTests:

* media/track/captions-webvtt/tc006-cue-id-error.vtt:
* media/track/captions-webvtt/tc007-cue-no-id-error.vtt:
* media/track/captions-webvtt/tc011-cues-no-separation.vtt:
* media/track/captions-webvtt/tc031-cue-recovery-cuetext.vtt: Added.
* media/track/captions-webvtt/tc031-cue-recovery-header.vtt: Added.
* media/track/captions-webvtt/tc031-cue-recovery-note.vtt: Added.
* media/track/captions-webvtt/tc032-degenerate-cues.vtt: Added.
* media/track/track-webvtt-tc006-cue-identifiers-expected.txt:
* media/track/track-webvtt-tc006-cue-identifiers.html:
* media/track/track-webvtt-tc007-cue-no-id-expected.txt:
* media/track/track-webvtt-tc007-cue-no-id.html:
* media/track/track-webvtt-tc011-blank-lines-expected.txt:
* media/track/track-webvtt-tc011-blank-lines.html:
* media/track/track-webvtt-tc031-cue-recovery-expected.txt: Added.
* media/track/track-webvtt-tc031-cue-recovery.html: Added.
* media/track/track-webvtt-tc032-degenerate-cues-expected.txt: Added.
* media/track/track-webvtt-tc032-degenerate-cues.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/media/track/captions-webvtt/tc006-cue-id-error.vtt
LayoutTests/media/track/captions-webvtt/tc007-cue-no-id-error.vtt
LayoutTests/media/track/captions-webvtt/tc011-cues-no-separation.vtt
LayoutTests/media/track/captions-webvtt/tc031-cue-recovery-cuetext.vtt [new file with mode: 0644]
LayoutTests/media/track/captions-webvtt/tc031-cue-recovery-header.vtt [new file with mode: 0644]
LayoutTests/media/track/captions-webvtt/tc031-cue-recovery-note.vtt [new file with mode: 0644]
LayoutTests/media/track/captions-webvtt/tc032-degenerate-cues.vtt [new file with mode: 0644]
LayoutTests/media/track/track-webvtt-tc006-cue-identifiers-expected.txt
LayoutTests/media/track/track-webvtt-tc006-cue-identifiers.html
LayoutTests/media/track/track-webvtt-tc007-cue-no-id-expected.txt
LayoutTests/media/track/track-webvtt-tc007-cue-no-id.html
LayoutTests/media/track/track-webvtt-tc011-blank-lines-expected.txt
LayoutTests/media/track/track-webvtt-tc011-blank-lines.html
LayoutTests/media/track/track-webvtt-tc031-cue-recovery-expected.txt [new file with mode: 0644]
LayoutTests/media/track/track-webvtt-tc031-cue-recovery.html [new file with mode: 0644]
LayoutTests/media/track/track-webvtt-tc032-degenerate-cues-expected.txt [new file with mode: 0644]
LayoutTests/media/track/track-webvtt-tc032-degenerate-cues.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/track/WebVTTParser.cpp
Source/WebCore/html/track/WebVTTParser.h