From 986c5f9738cd40b5679d8ce2128b18eaaa00aa92 Mon Sep 17 00:00:00 2001 From: alwu Date: Thu, 13 Jun 2019 20:10:53 +0000 Subject: [PATCH] Bug 1556079 - part1 : hide cue if we can't find a good place to put it fully inside the rendering area. r=heycam According to the spec 7.2.10.17 [1], if we have tried both direction and there is no place to put the cue inside the rendering area without overlapping with other cues or the boundary of rendering area, then we have to discard all CSS boxes, which means that we should not display this cue. [1] https://www.w3.org/TR/webvtt1/#processing-cue-settings Differential Revision: https://phabricator.services.mozilla.com/D33729 --HG-- extra : moz-landing-system : lando --- dom/media/webvtt/vtt.jsm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dom/media/webvtt/vtt.jsm b/dom/media/webvtt/vtt.jsm index 01a2f0d70c3b..13604c627a33 100644 --- a/dom/media/webvtt/vtt.jsm +++ b/dom/media/webvtt/vtt.jsm @@ -1263,6 +1263,9 @@ XPCOMUtils.defineLazyPreferenceGetter(this, "DEBUG_LOG", boxPositions.push(cueBox); LOG(`cue ${i}, ` + cueBox.getBoxInfoInChars()); } + } else { + LOG(`can not find a proper position to place cue ${i}`); + rootOfCues.removeChild(styleBox.div); } } } else {