bool TextTrackCue::operator==(const TextTrackCue& cue) const { if (cueType() != cue.cueType()) return false; if (m_endTime != cue.endTime()) return false; if (m_startTime != cue.startTime()) return false; if (m_content != cue.text()) return false; if (m_settings != cue.cueSettings()) return false; if (m_id != cue.id()) return false; if (m_textPosition != cue.position()) return false; if (m_linePosition != cue.line()) return false; if (m_cueSize != cue.size()) return false; if (align() != cue.align()) return false; return true; }
bool DataCue::cueContentsMatch(const TextTrackCue& cue) const { if (cue.cueType() != TextTrackCue::Data) return false; const DataCue* dataCue = toDataCue(&cue); RefPtr<ArrayBuffer> otherData = dataCue->data(); if ((otherData && !m_data) || (!otherData && m_data)) return false; if (m_data && m_data->byteLength() != otherData->byteLength()) return false; if (m_data && m_data->data() && memcmp(m_data->data(), otherData->data(), m_data->byteLength())) return false; const SerializedPlatformRepresentation* otherPlatformValue = dataCue->platformValue(); if ((otherPlatformValue && !m_platformValue) || (!otherPlatformValue && m_platformValue)) return false; if (m_platformValue && !m_platformValue->isEqual(*otherPlatformValue)) return false; JSC::JSValue thisValue = valueOrNull(); JSC::JSValue otherValue = dataCue->valueOrNull(); if ((otherValue && !thisValue) || (!otherValue && thisValue)) return false; if (!JSC::JSValue::strictEqual(nullptr, thisValue, otherValue)) return false; return true; }
bool TextTrackCue::isEqual(const TextTrackCue& cue, CueMatchRules match) const { if (cueType() != cue.cueType()) return false; if (match != IgnoreDuration && m_endTime != cue.endTime()) return false; if (m_startTime != cue.startTime()) return false; if (m_content != cue.text()) return false; if (m_settings != cue.cueSettings()) return false; if (m_id != cue.id()) return false; if (m_textPosition != cue.position()) return false; if (m_linePosition != cue.line()) return false; if (m_cueSize != cue.size()) return false; if (align() != cue.align()) return false; return true; }
bool TextTrackCueGeneric::isEqual(const TextTrackCue& cue, TextTrackCue::CueMatchRules match) const { // Do not call the parent class isEqual here, because we are not cueType() == VTTCue, // and will fail that equality test. if (!TextTrackCue::isEqual(cue, match)) return false; if (cue.cueType() != TextTrackCue::Generic) return false; const TextTrackCueGeneric* other = static_cast<const TextTrackCueGeneric*>(&cue); if (m_baseFontSizeRelativeToVideoHeight != other->baseFontSizeRelativeToVideoHeight()) return false; if (m_fontSizeMultiplier != other->fontSizeMultiplier()) return false; if (m_fontName != other->fontName()) return false; if (m_foregroundColor != other->foregroundColor()) return false; if (m_backgroundColor != other->backgroundColor()) return false; return true; }
ExceptionOr<void> InbandDataTextTrack::removeCue(TextTrackCue& cue) { ASSERT(cue.cueType() == TextTrackCue::Data); m_incompleteCueMap.remove(const_cast<SerializedPlatformRepresentation*>(toDataCue(&cue)->platformValue())); return InbandTextTrack::removeCue(cue); }
bool DataCue::isEqual(const TextTrackCue& cue, TextTrackCue::CueMatchRules match) const { if (!TextTrackCue::isEqual(cue, match)) return false; if (cue.cueType() != TextTrackCue::Data) return false; return cueContentsMatch(cue); }
bool TextTrackCue::cueContentsMatch(const TextTrackCue& cue) const { if (cueType() != cue.cueType()) return false; if (id() != cue.id()) return false; return true; }
bool TextTrackCueGeneric::isEqual(const TextTrackCue& cue, TextTrackCue::CueMatchRules match) const { // Do not call the parent class isEqual here, because we are not cueType() == VTTCue, // and will fail that equality test. if (!TextTrackCue::isEqual(cue, match)) return false; if (cue.cueType() != TextTrackCue::Generic) return false; return cueContentsMatch(cue); }
bool TextTrackCue::isEqual(const TextTrackCue& cue, TextTrackCue::CueMatchRules match) const { if (cueType() != cue.cueType()) return false; if (match != IgnoreDuration && m_endTime != cue.m_endTime) return false; if (!cueContentsMatch(cue)) return false; return true; }
bool TextTrackCue::isEqual(const TextTrackCue& cue, TextTrackCue::CueMatchRules match) const { if (cueType() != cue.cueType()) return false; if (match != IgnoreDuration && endMediaTime() != cue.endMediaTime()) return false; if (!hasEquivalentStartTime(cue)) return false; if (!cueContentsMatch(cue)) return false; return true; }