Bug 84296 - Implement overlap avoidance for cues with snap-to-lines flag not set
Summary: Implement overlap avoidance for cues with snap-to-lines flag not set
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
Keywords: InRadar
Depends on:
Blocks: 79347
  Show dependency treegraph
Reported: 2012-04-18 16:05 PDT by Victor Carbune
Modified: 2013-05-21 12:26 PDT (History)
10 users (show)

See Also:

Patch (14.30 KB, patch)
2013-05-20 12:53 PDT, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Carbune 2012-04-18 16:05:44 PDT
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.
Comment 1 Alexey Proskuryakov 2012-04-19 10:11:34 PDT
Comment 2 Victor Carbune 2012-08-12 07:08:58 PDT
Updating the title and moving under advanced rendering main bug
Comment 3 Jon Lee 2013-05-08 11:34:53 PDT
Comment 4 Jer Noble 2013-05-20 12:53:10 PDT
Created attachment 202308 [details]
Comment 5 Eric Carlson 2013-05-20 13:36:29 PDT
Comment on attachment 202308 [details]

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"?
Comment 6 Jer Noble 2013-05-21 10:14:28 PDT
Committed r150452: <http://trac.webkit.org/changeset/150452>
Comment 7 Ryosuke Niwa 2013-05-21 12:26:09 PDT
The test added by this patch appears to be failing everywhere:

--- /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