Bug 71334 - Small fixes for WebVTTParser
Summary: Small fixes for WebVTTParser
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anna Cavender
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-01 15:50 PDT by Anna Cavender
Modified: 2011-11-01 22:48 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.44 KB, patch)
2011-11-01 15:57 PDT, Anna Cavender
no flags Details | Formatted Diff | Diff
Patch for landing (2.59 KB, patch)
2011-11-01 21:42 PDT, Anna Cavender
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anna Cavender 2011-11-01 15:50:12 PDT
hasLongWebVTTIdentifier needs to return true even for WebVTT Identifiers that are not long (exactly 6 chars when they match "WEBVTT").
Comment 1 Anna Cavender 2011-11-01 15:57:06 PDT
Created attachment 113246 [details]
Patch
Comment 2 Darin Adler 2011-11-01 16:29:39 PDT
Comment on attachment 113246 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=113246&action=review

> Source/WebCore/ChangeLog:8
> +        No new tests.  This is needed to enable other tests, coming soon.

OK. I’m going to hold you to that one!

> Source/WebCore/html/track/WebVTTParser.cpp:193
> -    if (line[position++] != ' ' && line[position++] != '\t')
> +    if (line[position] != ' ' && line[position] != '\t')

What guarantees we are not at the end of the line here?

By the way, I think the ++ was OK, but not two different ++. A local variable would have been another way to do it.

> Source/WebCore/html/track/WebVTTParser.cpp:201
> -    if (line[position++] != ' ' && line[position++] != '\t')
> +    if (line[position] != ' ' && line[position] != '\t')

Same question/comment.
Comment 3 Anna Cavender 2011-11-01 18:18:54 PDT
Comment on attachment 113246 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=113246&action=review

>> Source/WebCore/ChangeLog:8
>> +        No new tests.  This is needed to enable other tests, coming soon.
> 
> OK. I’m going to hold you to that one!

Thanks Darin.

>> Source/WebCore/html/track/WebVTTParser.cpp:193
>> +    if (line[position] != ' ' && line[position] != '\t')
> 
> What guarantees we are not at the end of the line here?
> 
> By the way, I think the ++ was OK, but not two different ++. A local variable would have been another way to do it.

Good point, I'll add a check.

I suppose it doesn't matter since the next action is to ignore remaining white space, but it would eliminate one extra check.  I'll use a local var like you suggest.

>> Source/WebCore/html/track/WebVTTParser.cpp:201
>> +    if (line[position] != ' ' && line[position] != '\t')
> 
> Same question/comment.

Ditto.
Comment 4 Anna Cavender 2011-11-01 21:42:56 PDT
Created attachment 113276 [details]
Patch for landing
Comment 5 WebKit Review Bot 2011-11-01 22:48:29 PDT
Comment on attachment 113276 [details]
Patch for landing

Clearing flags on attachment: 113276

Committed r99039: <http://trac.webkit.org/changeset/99039>
Comment 6 WebKit Review Bot 2011-11-01 22:48:35 PDT
All reviewed patches have been landed.  Closing bug.