Closed Bug 1278748 Opened 8 years ago Closed 8 years ago

[webvtt] Fix the fail for "webvtt/webvtt-file-format-parsing/webvtt-file-parsing/001.html"

Categories

(Core :: Audio/Video: Playback, defect, P3)

Other Branch
defect

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(7 files)

Need to pass more tests!
This file still has 9 fails, I'm working on that.
Depends on: 1283803
The remaining fails are related with the parsing algorithm, it's little complex. Therefore, I open the bug1283803 to solve it independently.
There are some mistakes in the parsing rule part in the spec, so I'm discussing it [1] with the spec's author. [1] https://github.com/w3c/webvtt/issues/310
Comment on attachment 8766205 [details] Bug 1278748 - part1 : cue's attribute can be set multiple times. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61194/diff/1-2/
Comment on attachment 8766206 [details] Bug 1278748 - part2 : correct default value of webidl's property. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61196/diff/1-2/
Comment on attachment 8766207 [details] Bug 1278748 - part3 : change align from 'middle' to 'center'. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61198/diff/1-2/
Comment on attachment 8766208 [details] Bug 1278748 - part4 : should not throw error if the correct signature doesn't follow with new line. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61200/diff/1-2/
Comment on attachment 8766209 [details] Bug 1278748 - part5 : the value of position and line are double. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61202/diff/1-2/
Mass change P2 -> P3
Priority: P2 → P3
Attachment #8768301 - Flags: review?(giles)
Attachment #8766205 - Flags: review?(giles)
Attachment #8766206 - Flags: review?(giles)
Attachment #8766207 - Flags: review?(giles)
Attachment #8766208 - Flags: review?(giles)
Attachment #8766209 - Flags: review?(giles)
Attachment #8767939 - Flags: review?(giles)
Comment on attachment 8766205 [details] Bug 1278748 - part1 : cue's attribute can be set multiple times. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61194/diff/2-3/
Comment on attachment 8766206 [details] Bug 1278748 - part2 : correct default value of webidl's property. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61196/diff/2-3/
Comment on attachment 8766207 [details] Bug 1278748 - part3 : change align from 'middle' to 'center'. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61198/diff/2-3/
Comment on attachment 8766208 [details] Bug 1278748 - part4 : should not throw error if the correct signature doesn't follow with new line. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61200/diff/2-3/
Comment on attachment 8766209 [details] Bug 1278748 - part5 : the value of position and line are double. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61202/diff/2-3/
Comment on attachment 8767939 [details] Bug 1278748 - part6 : modify timestamp parsing rule. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62338/diff/1-2/
Comment on attachment 8766205 [details] Bug 1278748 - part1 : cue's attribute can be set multiple times. https://reviewboard.mozilla.org/r/61194/#review59536
Attachment #8766205 - Flags: review?(giles) → review+
Comment on attachment 8766206 [details] Bug 1278748 - part2 : correct default value of webidl's property. https://reviewboard.mozilla.org/r/61196/#review59540
Attachment #8766206 - Flags: review?(giles) → review+
Comment on attachment 8766207 [details] Bug 1278748 - part3 : change align from 'middle' to 'center'. https://reviewboard.mozilla.org/r/61198/#review59542
Attachment #8766207 - Flags: review?(giles) → review+
Comment on attachment 8766208 [details] Bug 1278748 - part4 : should not throw error if the correct signature doesn't follow with new line. https://reviewboard.mozilla.org/r/61200/#review59544
Attachment #8766208 - Flags: review?(giles) → review+
Comment on attachment 8766209 [details] Bug 1278748 - part5 : the value of position and line are double. https://reviewboard.mozilla.org/r/61202/#review59546
Attachment #8766209 - Flags: review?(giles) → review+
Attachment #8767939 - Flags: review?(giles) → review+
Comment on attachment 8767939 [details] Bug 1278748 - part6 : modify timestamp parsing rule. https://reviewboard.mozilla.org/r/62338/#review59556 ::: dom/media/webvtt/vtt.jsm:77 (Diff revision 2) > + } > return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000; > } > > - var m = input.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/); > - if (!m) { > + var timestamp = input.match(/^(\d+:)?\d{2}:\d{2}\.\d+/); > + if (!timestamp) { Do you need to capture the first stanza here? I don't see `timestamp[1]` referenced. Might be worth capturing the milliseconds field though, so you can use the regexp to do the work of the later split to check the length.
Comment on attachment 8768301 [details] Bug 1278748 - part7 : vertical tab isn't a space characters. https://reviewboard.mozilla.org/r/62598/#review59564 Nice that the test caught this error!
Attachment #8768301 - Flags: review?(giles) → review+
Comment on attachment 8766205 [details] Bug 1278748 - part1 : cue's attribute can be set multiple times. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61194/diff/3-4/
Comment on attachment 8766206 [details] Bug 1278748 - part2 : correct default value of webidl's property. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61196/diff/3-4/
Comment on attachment 8766207 [details] Bug 1278748 - part3 : change align from 'middle' to 'center'. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61198/diff/3-4/
Comment on attachment 8766208 [details] Bug 1278748 - part4 : should not throw error if the correct signature doesn't follow with new line. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61200/diff/3-4/
Comment on attachment 8766209 [details] Bug 1278748 - part5 : the value of position and line are double. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61202/diff/3-4/
Comment on attachment 8767939 [details] Bug 1278748 - part6 : modify timestamp parsing rule. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62338/diff/2-3/
Comment on attachment 8768301 [details] Bug 1278748 - part7 : vertical tab isn't a space characters. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62598/diff/1-2/
Attachment #8767939 - Flags: review+ → review?(giles)
Just for record, we fix 17 web-platform-tests in this bug.
Comment on attachment 8767939 [details] Bug 1278748 - part6 : modify timestamp parsing rule. https://reviewboard.mozilla.org/r/62338/#review60488 Thanks for fixing all this up. 14 new tests passing is really good! ::: dom/media/webvtt/vtt.jsm:81 (Diff revision 3) > + } > return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000; > } > > - var m = input.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/); > - if (!m) { > + var timestamp = input.match(/^((\d+:)?(\d{2}):(\d{2}))\.(\d+)/); > + if (!timestamp || timestamp.length !== 6) { That's better, thanks. The logic of the timestamp[1] capture is a little non-obvious, but I'm not sure a comment helps with a regex unless it's a whole paragraph explaining the technique.
Attachment #8767939 - Flags: review?(giles) → review+
(In reply to Ralph Giles (:rillian) needinfo me from comment #39) > That's better, thanks. The logic of the timestamp[1] capture is a little > non-obvious, but I'm not sure a comment helps with a regex unless it's a > whole paragraph explaining the technique. Ah, I think we could modify the regex not to capture the timestamp[1]. Thanks!
Comment on attachment 8766205 [details] Bug 1278748 - part1 : cue's attribute can be set multiple times. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61194/diff/4-5/
Comment on attachment 8766206 [details] Bug 1278748 - part2 : correct default value of webidl's property. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61196/diff/4-5/
Comment on attachment 8766207 [details] Bug 1278748 - part3 : change align from 'middle' to 'center'. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61198/diff/4-5/
Comment on attachment 8766208 [details] Bug 1278748 - part4 : should not throw error if the correct signature doesn't follow with new line. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61200/diff/4-5/
Comment on attachment 8766209 [details] Bug 1278748 - part5 : the value of position and line are double. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/61202/diff/4-5/
Comment on attachment 8767939 [details] Bug 1278748 - part6 : modify timestamp parsing rule. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62338/diff/3-4/
Comment on attachment 8768301 [details] Bug 1278748 - part7 : vertical tab isn't a space characters. Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62598/diff/2-3/
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bd048078af43 part1 : cue's attribute can be set multiple times. r=rillian https://hg.mozilla.org/integration/autoland/rev/7c48311a55d2 part2 : correct default value of webidl's property. r=rillian https://hg.mozilla.org/integration/autoland/rev/c32d76936446 part3 : change align from 'middle' to 'center'. r=rillian https://hg.mozilla.org/integration/autoland/rev/59c445c3e604 part4 : should not throw error if the correct signature doesn't follow with new line. r=rillian https://hg.mozilla.org/integration/autoland/rev/2905747bae6e part5 : the value of position and line are double. r=rillian https://hg.mozilla.org/integration/autoland/rev/3414ed32d520 part6 : modify timestamp parsing rule. r=rillian https://hg.mozilla.org/integration/autoland/rev/9b1032ae8fac part7 : vertical tab isn't a space characters. r=rillian
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: