bool TextTrackCue::hasEquivalentStartTime(const TextTrackCue& cue) const { MediaTime startTimeVariance = MediaTime::zeroTime(); if (track()) startTimeVariance = track()->startTimeVariance(); else if (cue.track()) startTimeVariance = cue.track()->startTimeVariance(); return abs(abs(startMediaTime()) - abs(cue.startMediaTime())) <= startTimeVariance; }
void VTTCue::updateDisplayTree(const MediaTime& movieTime) { // The display tree may contain WebVTT timestamp objects representing // timestamps (processing instructions), along with displayable nodes. if (!track()->isRendered()) return; // Clear the contents of the set. m_cueHighlightBox->removeChildren(); // Update the two sets containing past and future WebVTT objects. RefPtr<DocumentFragment> referenceTree = createCueRenderingTree(); if (!referenceTree) return; markFutureAndPastNodes(referenceTree.get(), startMediaTime(), movieTime); m_cueHighlightBox->appendChild(referenceTree.releaseNonNull()); }
bool TextTrackCue::isOrderedBefore(const TextTrackCue* other) const { return startMediaTime() < other->startMediaTime() || (startMediaTime() == other->startMediaTime() && endMediaTime() > other->endMediaTime()); }