Title: [97883] trunk/Source/WebCore
- Revision
- 97883
- Author
- ann...@chromium.org
- Date
- 2011-10-19 15:30:04 -0700 (Wed, 19 Oct 2011)
Log Message
Update WebVTTParser to require at least one space between timestamps and arrows, e.g.:
00:04:01.000 --> 00:03:00.500 is OK
00:04:01.000-->00:03:00.500 is not OK
https://bugs.webkit.org/show_bug.cgi?id=70274
Reviewed by Eric Carlson.
Existing tests:
media/track/track-webvtt-tc008-timings-no-hours.html
(see media/track/captions-webvtt/tc008-timings-no-hour-errors.vtt #6)
media/track/track-webvtt-tc009-timings-hour.html
(see media/track/captions-webvtt/tc009-timings-hour-error.vtt #6)
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::collectTimingsAndSettings): Check that the
character before and after the '-->' is a space character
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (97882 => 97883)
--- trunk/Source/WebCore/ChangeLog 2011-10-19 22:03:41 UTC (rev 97882)
+++ trunk/Source/WebCore/ChangeLog 2011-10-19 22:30:04 UTC (rev 97883)
@@ -1,3 +1,22 @@
+2011-10-19 Anna Cavender <ann...@chromium.org>
+
+ Update WebVTTParser to require at least one space between timestamps and arrows, e.g.:
+ 00:04:01.000 --> 00:03:00.500 is OK
+ 00:04:01.000-->00:03:00.500 is not OK
+ https://bugs.webkit.org/show_bug.cgi?id=70274
+
+ Reviewed by Eric Carlson.
+
+ Existing tests:
+ media/track/track-webvtt-tc008-timings-no-hours.html
+ (see media/track/captions-webvtt/tc008-timings-no-hour-errors.vtt #6)
+ media/track/track-webvtt-tc009-timings-hour.html
+ (see media/track/captions-webvtt/tc009-timings-hour-error.vtt #6)
+
+ * html/track/WebVTTParser.cpp:
+ (WebCore::WebVTTParser::collectTimingsAndSettings): Check that the
+ character before and after the '-->' is a space character
+
2011-10-19 Daniel Cheng <dch...@chromium.org>
Don't always select images during an image drag.
Modified: trunk/Source/WebCore/html/track/WebVTTParser.cpp (97882 => 97883)
--- trunk/Source/WebCore/html/track/WebVTTParser.cpp 2011-10-19 22:03:41 UTC (rev 97882)
+++ trunk/Source/WebCore/html/track/WebVTTParser.cpp 2011-10-19 22:30:04 UTC (rev 97883)
@@ -190,12 +190,16 @@
m_currentStartTime = collectTimeStamp(line, &position);
if (m_currentStartTime == malformedTime)
return BadCue;
+ if (line[position++] != ' ' && line[position++] != '\t')
+ return BadCue;
skipWhiteSpace(line, &position);
// 6-9 - If the next three characters are not "-->", abort and return failure.
if (line.find("-->", position) == notFound)
return BadCue;
position += 3;
+ if (line[position++] != ' ' && line[position++] != '\t')
+ return BadCue;
skipWhiteSpace(line, &position);
// 10-11 - Collect a WebVTT timestamp. If that fails, then abort and return failure. Otherwise, let cue's text track cue end time be the collected time.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes