VTTCue::~VTTCue() { if (!hasDisplayTree()) return; displayTreeInternal()->remove(ASSERT_NO_EXCEPTION); }
void TextTrackCue::setFontSize(int fontSize, const IntSize&, bool important) { if (!hasDisplayTree() || !fontSize) return; LOG(Media, "TextTrackCue::setFontSize - setting cue font size to %i", fontSize); displayTreeInternal()->setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue::CSS_PX, important); }
void VTTCue::setIsActive(bool active) { TextTrackCue::setIsActive(active); if (!active) { if (!hasDisplayTree()) return; // Remove the display tree as soon as the cue becomes inactive. removeDisplayTree(); } }
void VTTCue::setIsActive(bool active) { TextTrackCue::setIsActive(active); if (!active) { if (!hasDisplayTree()) return; // Remove the display tree as soon as the cue becomes inactive. displayTreeInternal()->remove(ASSERT_NO_EXCEPTION); } }
void VTTCue::removeDisplayTree() { // The region needs to be informed about the cue removal. if (m_notifyRegion && track()) { if (VTTRegionList* regions = track()->regions()) { if (VTTRegion* region = regions->getRegionById(m_regionId)) region->willRemoveTextTrackCueBox(m_displayTree.get()); } } if (!hasDisplayTree()) return; displayTreeInternal()->remove(ASSERT_NO_EXCEPTION); }
void TextTrackCueGeneric::setFontSize(int fontSize, const IntSize& videoSize, bool important) { if (!hasDisplayTree() || !fontSize) return; if (important || !baseFontSizeRelativeToVideoHeight()) { VTTCue::setFontSize(fontSize, videoSize, important); return; } double size = videoSize.height() * baseFontSizeRelativeToVideoHeight() / 100; if (fontSizeMultiplier()) size *= fontSizeMultiplier() / 100; displayTreeInternal()->setInlineStyleProperty(CSSPropertyFontSize, lround(size), CSSPrimitiveValue::CSS_PX); LOG(Media, "TextTrackCueGeneric::setFontSize - setting cue font size to %li", lround(size)); }