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
This commit is contained in:
alwu 2019-06-14 00:26:54 +00:00
parent 841d3eea32
commit c7b361e5b5

View File

@ -1264,6 +1264,9 @@ XPCOMUtils.defineLazyPreferenceGetter(this, "DEBUG_LOG",
cue.displayState = styleBox.div;
boxPositions.push(cueBox);
LOG(`cue ${i}, ` + cueBox.getBoxInfoInChars());
} else {
LOG(`can not find a proper position to place cue ${i}`);
rootOfCues.removeChild(styleBox.div);
}
}
}