#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/svg/animation/svg_smil_element.h"
#include <algorithm>
#include "base/auto_reset.h"
#include "base/time/time.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/renderer/bindings/core/v8/js_event_handler_for_content_attribute.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/events/native_event_listener.h"
#include "third_party/blink/renderer/core/dom/id_target_observer.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/svg/animation/smil_time_container.h"
#include "third_party/blink/renderer/core/svg/svg_set_element.h"
#include "third_party/blink/renderer/core/svg/svg_svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_uri_reference.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink {
namespace {
SMILTime ComputeNextRepeatTime(SMILTime interval_begin,
SMILTime simple_duration,
SMILTime presentation_time) { … }
}
void SMILInstanceTimeList::Append(SMILTime time, SMILTimeOrigin origin) { … }
void SMILInstanceTimeList::InsertSortedAndUnique(SMILTime time,
SMILTimeOrigin origin) { … }
void SMILInstanceTimeList::RemoveWithOrigin(SMILTimeOrigin origin) { … }
void SMILInstanceTimeList::Sort() { … }
SMILTime SMILInstanceTimeList::NextAfter(SMILTime time) const { … }
static constexpr SMILTime kInvalidCachedTime = …;
class ConditionEventListener final : public NativeEventListener { … };
SVGSMILElement::Condition::Condition(Type type,
BeginOrEnd begin_or_end,
const AtomicString& base_id,
const AtomicString& name,
SMILTime offset,
unsigned repeat)
: … { … }
SVGSMILElement::Condition::~Condition() = default;
void SVGSMILElement::Condition::Trace(Visitor* visitor) const { … }
void SVGSMILElement::Condition::ConnectSyncBase(SVGSMILElement& timed_element) { … }
void SVGSMILElement::Condition::DisconnectSyncBase(
SVGSMILElement& timed_element) { … }
void SVGSMILElement::Condition::ConnectEventBase(
SVGSMILElement& timed_element) { … }
void SVGSMILElement::Condition::DisconnectEventBase(
SVGSMILElement& timed_element) { … }
SVGSMILElement::SVGSMILElement(const QualifiedName& tag_name, Document& doc)
: … { … }
SVGSMILElement::~SVGSMILElement() = default;
void SVGSMILElement::ClearResourceAndEventBaseReferences() { … }
void SVGSMILElement::BuildPendingResource() { … }
void SVGSMILElement::Reset() { … }
Node::InsertionNotificationRequest SVGSMILElement::InsertedInto(
ContainerNode& root_parent) { … }
void SVGSMILElement::RemovedFrom(ContainerNode& root_parent) { … }
SMILTime SVGSMILElement::ParseOffsetValue(const String& data) { … }
SMILTime SVGSMILElement::ParseClockValue(const String& data) { … }
bool SVGSMILElement::ParseCondition(const String& value,
BeginOrEnd begin_or_end) { … }
void SVGSMILElement::ParseBeginOrEnd(const String& parse_string,
BeginOrEnd begin_or_end) { … }
void SVGSMILElement::ParseAttribute(const AttributeModificationParams& params) { … }
bool SVGSMILElement::IsPresentationAttribute(
const QualifiedName& attr_name) const { … }
void SVGSMILElement::CollectStyleForPresentationAttribute(
const QualifiedName& attr_name,
const AtomicString& value,
MutableCSSPropertyValueSet* style) { … }
void SVGSMILElement::ConnectConditions() { … }
void SVGSMILElement::DisconnectConditions() { … }
void SVGSMILElement::ClearConditions() { … }
void SVGSMILElement::SetTargetElement(SVGElement* target) { … }
SMILTime SVGSMILElement::Elapsed() const { … }
SMILTime SVGSMILElement::BeginTimeForPrioritization(
SMILTime presentation_time) const { … }
bool SVGSMILElement::IsHigherPriorityThan(const SVGSMILElement* other,
SMILTime presentation_time) const { … }
SMILTime SVGSMILElement::Dur() const { … }
SMILTime SVGSMILElement::RepeatDur() const { … }
static SMILRepeatCount ParseRepeatCount(const AtomicString& value) { … }
SMILRepeatCount SVGSMILElement::RepeatCount() const { … }
SMILTime SVGSMILElement::MaxValue() const { … }
SMILTime SVGSMILElement::MinValue() const { … }
SMILTime SVGSMILElement::SimpleDuration() const { … }
void SVGSMILElement::AddInstanceTime(BeginOrEnd begin_or_end,
SMILTime time,
SMILTimeOrigin origin) { … }
void SVGSMILElement::AddInstanceTimeAndUpdate(BeginOrEnd begin_or_end,
SMILTime time,
SMILTimeOrigin origin) { … }
SMILTime SVGSMILElement::RepeatingDuration() const { … }
SMILTime SVGSMILElement::ResolveActiveEnd(SMILTime resolved_begin) const { … }
SMILInterval SVGSMILElement::ResolveInterval(SMILTime begin_after,
SMILTime end_after) { … }
void SVGSMILElement::SetNewInterval(const SMILInterval& interval) { … }
void SVGSMILElement::SetNewIntervalEnd(SMILTime new_end) { … }
SMILTime SVGSMILElement::ComputeNextIntervalTime(
SMILTime presentation_time,
IncludeRepeats include_repeats) const { … }
void SVGSMILElement::InstanceListChanged() { … }
void SVGSMILElement::IntervalStateChanged() { … }
void SVGSMILElement::DiscardOrRevalidateCurrentInterval(
SMILTime presentation_time) { … }
bool SVGSMILElement::HandleIntervalRestart(SMILTime presentation_time) { … }
SMILTime SVGSMILElement::LastIntervalEndTime() const { … }
void SVGSMILElement::UpdateInterval(SMILTime presentation_time) { … }
void SVGSMILElement::AddedToTimeContainer() { … }
void SVGSMILElement::RemovedFromTimeContainer() { … }
const SMILInterval& SVGSMILElement::GetActiveInterval(SMILTime elapsed) const { … }
SVGSMILElement::ProgressState SVGSMILElement::CalculateProgressState(
SMILTime presentation_time) const { … }
SMILTime SVGSMILElement::NextProgressTime(SMILTime presentation_time) const { … }
SVGSMILElement::ActiveState SVGSMILElement::DetermineActiveState(
const SMILInterval& interval,
SMILTime elapsed) const { … }
bool SVGSMILElement::IsContributing(SMILTime elapsed) const { … }
SVGSMILElement::EventDispatchMask SVGSMILElement::UpdateActiveState(
SMILTime presentation_time,
bool skip_repeat) { … }
SVGSMILElement::EventDispatchMask SVGSMILElement::ComputeSeekEvents(
const SMILInterval& starting_interval) const { … }
void SVGSMILElement::DispatchEvents(EventDispatchMask events_to_dispatch) { … }
void SVGSMILElement::AddedEventListener(
const AtomicString& event_type,
RegisteredEventListener& registered_listener) { … }
void SVGSMILElement::UpdateProgressState(SMILTime presentation_time) { … }
struct SVGSMILElement::NotifyDependentsInfo { … };
void SVGSMILElement::NotifyDependentsOnNewInterval(
const SMILInterval& interval) { … }
void SVGSMILElement::NotifyDependentsOnRepeat(unsigned repeat_nr,
SMILTime repeat_time) { … }
void SVGSMILElement::NotifyDependents(const NotifyDependentsInfo& info) { … }
void SVGSMILElement::CreateInstanceTimesFromSyncBase(
SVGSMILElement* timed_element,
const NotifyDependentsInfo& info) { … }
void SVGSMILElement::AddSyncBaseDependent(SVGSMILElement& animation) { … }
void SVGSMILElement::RemoveSyncBaseDependent(SVGSMILElement& animation) { … }
void SVGSMILElement::BeginByLinkActivation() { … }
void SVGSMILElement::StartedActiveInterval() { … }
void SVGSMILElement::EndedActiveInterval() { … }
bool SVGSMILElement::HasValidTarget() const { … }
void SVGSMILElement::WillChangeAnimationTarget() { … }
void SVGSMILElement::DidChangeAnimationTarget() { … }
void SVGSMILElement::Trace(Visitor* visitor) const { … }
}