Closed Bug 1010707 Opened 11 years ago Closed 9 years ago

[WebVTT] hang with VTTCue and canvas

Categories

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

x86_64
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: jruderman, Assigned: alwu)

References

(Blocks 1 open bug)

Details

(Keywords: hang, testcase)

Attachments

(4 files, 1 obsolete file)

No description provided.
Attached file sample
Attached file a stack (C++ and JS) (obsolete) —
I got this by disabling the JITs and pressing ^C during the hang.
Attached file a stack (C++ and JS)
Attachment #8422956 - Attachment is obsolete: true
Component: Audio/Video → Audio/Video: Playback
This issue is due to we're in the infinite while-loop [1]. [1] https://dxr.mozilla.org/mozilla-central/source/dom/media/webvtt/vtt.jsm#1006
Assignee: nobody → alwu
Still debugging, don't find the root cause.. Now I observed that the CueStyleBox doesn't be updated correctly after [1], so we can't move a StyleBox to the specific position. I also found that the test won't be crashed if we do one of following modifications, (1) remove |canvas.getContext("2d").measureText("Z")| (2) add |video.controls = true| before |video.pause()| (3) pause video on |video.onplay = function() { ... }| The possible reason might be related with canvas reflowing process, but I don't know what is the exactly root cause now...
Hi, Ralph, Sorry to bother you, Could you give me any suggestion about this issue? Now, the problem I found is that we're in the infinite while-loop [1] when we want to move element to specific position. In the BoxPosition::move, if the |toMove| is not defined, then we would use its line height [2] as moving offset. In this case, because the line height [3] is ZERO, we can never move the box to the right place, so we're stuck in that while-loop. I have some possible ways to solve that problem, but I don't sure which one is the better method. More important is that I don't know whether these modification would cause other side effect, because I don't familiar with this field. So I need your help to see which following option is a better choice. (1) we should avoid ZERO line height in BoxPosition ctor (2) in BoxPosition::move, when |toMove| is not defined and line height is ZERO, we gave it another default value (3) maybe the computing condition [4] of |lh| is incorrect and we need to modify it? (4) the line height shouldn't be ZERO, it might be a bug in the reflow process and we need to figure it out Very appreciate your help! [1] https://dxr.mozilla.org/mozilla-central/source/dom/media/webvtt/vtt.jsm#1004 [2] https://dxr.mozilla.org/mozilla-central/source/dom/media/webvtt/vtt.jsm#880 [3] https://dxr.mozilla.org/mozilla-central/source/dom/media/webvtt/vtt.jsm#869 [4] https://dxr.mozilla.org/mozilla-central/source/dom/media/webvtt/vtt.jsm#859
Flags: needinfo?(giles)
CC ruxton who's also looked at this code recently.
Flags: needinfo?(ruxton)
Sorry, Alastor, I don't have any great insight. Let's try to compare with the spec and see if there's an more correct behaviour here. In any case we should make sure it can't hang!
After study the spec, the solution can be found in the part "Processing model". [1] In addition, I observed that the css setting flow is not consistent with spec, so I would work for the solution to follow the spec and fix the hanging problem. [1] https://w3c.github.io/webvtt/#processing-model
Flags: needinfo?(ruxton)
Flags: needinfo?(giles)
Blocks: webvtt
https://reviewboard.mozilla.org/r/54576/#review51448 There are 15 steps in https://w3c.github.io/webvtt/#processing-model. Could you add comments(step1 to step 15) in vtt.jsm to show me which step is wrong?
The error is in the step 11-5 of "apply WebVTT cue settings" [1] which is in the step 14-2-1 of "rules for updating the display of WebVTT text tracks". [2] I think it's not very useful if just add a comment for this step, I would prefer to re-factor the whole flow to make all steps clear because there are still some steps we don't have the implementation, eg. for "apply WebVTT cue settings", the step 2~8 (setting the CSS attributes). [1] https://w3c.github.io/webvtt/#apply-webvtt-cue-settings [2] https://w3c.github.io/webvtt/#processing-model
Attachment #8755373 - Flags: review?(giles)
Hi, Ralph, Could you help me review this patch? The changing is based on spec, > "if step is zero, then jump to the step labeled done positioning below" You can see more details in the comment12. Thanks!
Comment on attachment 8755373 [details] MozReview Request: Bug 1010707 - don't adjust position when line-height is zero. https://reviewboard.mozilla.org/r/54576/#review52976 Works for me! Thanks.
Attachment #8755373 - Flags: review?(giles) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: