When snap-to-lines flag is false the boxes should not overlap, if possible: [...] 10.13.4 If there is a position to which the boxes in boxes can be moved while maintaining the relative positions of the boxes in boxes to each other such that none of the boxes in boxes would overlap any of the boxes in output, and all the boxes in output would be within the video's rendering area, then move the boxes in boxes to the closest such position to their current position, and then jump to the step labeled done positioning below. If there are multiple such positions that are equidistant from their current position, use the highest one amongst them; if there are several at that height, then use the leftmost one amongst them. [...]
http://dev.w3.org/html5/webvtt/
Updating the title and moving under advanced rendering main bug
<rdar://problem/13760909>
Created attachment 202308 [details] Patch
Comment on attachment 202308 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=202308&action=review > Source/WebCore/rendering/RenderTextTrackCue.cpp:221 > +void RenderTextTrackCue::moveToWithinContainer() Nit: I am not wild about this name. "keepWithinContainer" or "moveIfNecessaryToKeepWithinContainer"?
Committed r150452: <http://trac.webkit.org/changeset/150452>
The test added by this patch appears to be failing everywhere: http://build.webkit.org/results/Apple%20MountainLion%20Release%20WK1%20(Tests)/r150461%20(10183)/results.html --- /Volumes/Data/slave/mountainlion-release-tests-wk1/build/layout-test-results/media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt +++ /Volumes/Data/slave/mountainlion-release-tests-wk1/build/layout-test-results/media/track/track-cue-rendering-snap-to-lines-not-set-actual.txt @@ -85,7 +85,7 @@ * Cue 2 * EXPECTED (cueDisplayElement.innerText == 'Top-right cue.') OK Cue left position (percentage): 100 -Cue top position (percentage): 0 +Cue top position (percentage): 7 * Cue 3 * EXPECTED (cueDisplayElement.innerText == 'Bottom cue.') OK @@ -105,6 +105,6 @@ * Cue 6 * EXPECTED (cueDisplayElement.innerText == 'Random cue 3.') OK Cue left position (percentage): 23 -Cue top position (percentage): 55 +Cue top position (percentage): 43 END OF TEST