Bug 1571908 - part2 : return null if we can't place the cue box inside the video rendering area. r=heycam

When adjusting the position of the cue box, if we can't find a proper place to display the cue within the video rendering area, we should return `null` and not to show it on the screen.

Differential Revision: https://phabricator.services.mozilla.com/D40901

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alastor Wu 2019-08-21 07:10:25 +00:00
parent 80cb50a3a9
commit f5fee479ba

View File

@ -1065,6 +1065,11 @@ XPCOMUtils.defineLazyPreferenceGetter(this, "DEBUG_LOG",
box = specifiedPosition.clone();
}
// Can not find a place to place this box inside the rendering area.
if (!box.within(containerBox)) {
return null;
}
styleBox.applyStyles({
top: getPercentagePosition(box.top, containerBox.height),
left: getPercentagePosition(box.left, containerBox.width),