#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/svg/svg_element.h"
#include "base/auto_reset.h"
#include "third_party/blink/renderer/bindings/core/v8/js_event_handler_for_content_attribute.h"
#include "third_party/blink/renderer/core/animation/document_animations.h"
#include "third_party/blink/renderer/core/animation/effect_stack.h"
#include "third_party/blink/renderer/core/animation/element_animations.h"
#include "third_party/blink/renderer/core/animation/invalidatable_interpolation.h"
#include "third_party/blink/renderer/core/animation/keyframe_effect.h"
#include "third_party/blink/renderer/core/animation/svg_interpolation_environment.h"
#include "third_party/blink/renderer/core/animation/svg_interpolation_types_map.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_context.h"
#include "third_party/blink/renderer/core/css/post_style_update_scope.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/css/style_sheet_contents.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/events/add_event_listener_options_resolved.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/events/simulated_click_options.h"
#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/frame/csp/content_security_policy.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/layout/svg/layout_svg_resource_container.h"
#include "third_party/blink/renderer/core/layout/svg/transform_helper.h"
#include "third_party/blink/renderer/core/svg/animation/element_smil_animations.h"
#include "third_party/blink/renderer/core/svg/properties/svg_animated_property.h"
#include "third_party/blink/renderer/core/svg/properties/svg_property.h"
#include "third_party/blink/renderer/core/svg/svg_animated_string.h"
#include "third_party/blink/renderer/core/svg/svg_document_extensions.h"
#include "third_party/blink/renderer/core/svg/svg_element_rare_data.h"
#include "third_party/blink/renderer/core/svg/svg_foreign_object_element.h"
#include "third_party/blink/renderer/core/svg/svg_graphics_element.h"
#include "third_party/blink/renderer/core/svg/svg_image_element.h"
#include "third_party/blink/renderer/core/svg/svg_resource.h"
#include "third_party/blink/renderer/core/svg/svg_svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_symbol_element.h"
#include "third_party/blink/renderer/core/svg/svg_title_element.h"
#include "third_party/blink/renderer/core/svg/svg_tree_scope_resources.h"
#include "third_party/blink/renderer/core/svg/svg_use_element.h"
#include "third_party/blink/renderer/core/svg_names.h"
#include "third_party/blink/renderer/core/xml_names.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/wtf/threading.h"
namespace blink {
SVGElement::SVGElement(const QualifiedName& tag_name,
Document& document,
ConstructionType construction_type)
: … { … }
SVGElement::~SVGElement() { … }
void SVGElement::DetachLayoutTree(bool performing_reattach) { … }
void SVGElement::WillRecalcStyle(const StyleRecalcChange change) { … }
SVGElementRareData* SVGElement::EnsureSVGRareData() { … }
bool SVGElement::IsOutermostSVGSVGElement() const { … }
void SVGElement::ReportAttributeParsingError(SVGParsingError error,
const QualifiedName& name,
const AtomicString& value) { … }
String SVGElement::title() const { … }
bool SVGElement::InstanceUpdatesBlocked() const { … }
void SVGElement::SetInstanceUpdatesBlocked(bool value) { … }
void SVGElement::SetWebAnimationsPending() { … }
static bool IsSVGAttributeHandle(const PropertyHandle& property_handle) { … }
void SVGElement::ApplyActiveWebAnimations() { … }
template <typename T>
static void ForSelfAndInstances(SVGElement* element, T callback) { … }
void SVGElement::SetWebAnimatedAttribute(const QualifiedName& attribute,
SVGPropertyBase* value) { … }
void SVGElement::ClearWebAnimatedAttributes() { … }
ElementSMILAnimations* SVGElement::GetSMILAnimations() const { … }
ElementSMILAnimations& SVGElement::EnsureSMILAnimations() { … }
void SVGElement::SetAnimatedAttribute(const QualifiedName& attribute,
SVGPropertyBase* value) { … }
void SVGElement::ClearAnimatedAttribute(const QualifiedName& attribute) { … }
void SVGElement::SetAnimatedMotionTransform(
const AffineTransform& motion_transform) { … }
void SVGElement::ClearAnimatedMotionTransform() { … }
bool SVGElement::HasNonCSSPropertyAnimations() const { … }
AffineTransform SVGElement::LocalCoordinateSpaceTransform(CTMScope) const { … }
bool SVGElement::HasTransform(
ApplyMotionTransformTag apply_motion_transform) const { … }
AffineTransform SVGElement::CalculateTransform(
ApplyMotionTransformTag apply_motion_transform) const { … }
void SVGElement::ApplyMotionTransform(AffineTransform& matrix) const { … }
Node::InsertionNotificationRequest SVGElement::InsertedInto(
ContainerNode& root_parent) { … }
void SVGElement::RemovedFrom(ContainerNode& root_parent) { … }
void SVGElement::ChildrenChanged(const ChildrenChange& change) { … }
CSSPropertyID SVGElement::CssPropertyIdForSVGAttributeName(
const ExecutionContext* execution_context,
const QualifiedName& attr_name) { … }
void SVGElement::UpdateRelativeLengthsInformation(
bool client_has_relative_lengths,
SVGElement* client_element) { … }
void SVGElement::InvalidateRelativeLengthClients() { … }
SVGSVGElement* SVGElement::ownerSVGElement() const { … }
SVGElement* SVGElement::viewportElement() const { … }
void SVGElement::AddInstance(SVGElement* instance) { … }
void SVGElement::RemoveInstance(SVGElement* instance) { … }
static HeapHashSet<WeakMember<SVGElement>>& EmptyInstances() { … }
const HeapHashSet<WeakMember<SVGElement>>& SVGElement::InstancesForElement()
const { … }
SVGElement* SVGElement::CorrespondingElement() const { … }
SVGUseElement* SVGElement::GeneratingUseElement() const { … }
SVGResourceTarget& SVGElement::EnsureResourceTarget() { … }
bool SVGElement::IsResourceTarget() const { … }
void SVGElement::SetCorrespondingElement(SVGElement* corresponding_element) { … }
bool SVGElement::InUseShadowTree() const { … }
void SVGElement::ParseAttribute(const AttributeModificationParams& params) { … }
AttributeToPropertyTypeMap;
AnimatedPropertyType SVGElement::AnimatedPropertyTypeForCSSAttribute(
const QualifiedName& attribute_name) { … }
SVGAnimatedPropertyBase* SVGElement::PropertyFromAttribute(
const QualifiedName& attribute_name) const { … }
bool SVGElement::IsAnimatableCSSProperty(const QualifiedName& attr_name) { … }
bool SVGElement::IsPresentationAttribute(const QualifiedName& name) const { … }
namespace {
bool ProbablyUrlFunction(const AtomicString& value) { … }
}
void SVGElement::CollectStyleForPresentationAttribute(
const QualifiedName& name,
const AtomicString& value,
MutableCSSPropertyValueSet* style) { … }
bool SVGElement::HaveLoadedRequiredResources() { … }
static inline void CollectInstancesForSVGElement(
SVGElement* element,
HeapHashSet<WeakMember<SVGElement>>& instances) { … }
void SVGElement::AddedEventListener(
const AtomicString& event_type,
RegisteredEventListener& registered_listener) { … }
void SVGElement::RemovedEventListener(
const AtomicString& event_type,
const RegisteredEventListener& registered_listener) { … }
static bool HasLoadListener(Element* element) { … }
bool SVGElement::SendSVGLoadEventIfPossible() { … }
void SVGElement::SendSVGLoadEventToSelfAndAncestorChainIfPossible() { … }
void SVGElement::AttributeChanged(const AttributeModificationParams& params) { … }
void SVGElement::SvgAttributeChanged(const SvgAttributeChangedParams& params) { … }
void SVGElement::BaseValueChanged(
const SVGAnimatedPropertyBase& animated_property) { … }
void SVGElement::UpdateWebAnimatedAttributeOnBaseValChange(
const QualifiedName& attribute) { … }
void SVGElement::EnsureAttributeAnimValUpdated() { … }
void SVGElement::SynchronizeSVGAttribute(const QualifiedName& name) const { … }
void SVGElement::SynchronizeAllSVGAttributes() const { … }
void SVGElement::CollectExtraStyleForPresentationAttribute(
MutableCSSPropertyValueSet* style) { … }
const ComputedStyle* SVGElement::CustomStyleForLayoutObject(
const StyleRecalcContext& style_recalc_context) { … }
bool SVGElement::LayoutObjectIsNeeded(const DisplayStyle& style) const { … }
bool SVGElement::HasSVGParent() const { … }
MutableCSSPropertyValueSet* SVGElement::AnimatedSMILStyleProperties() const { … }
MutableCSSPropertyValueSet* SVGElement::EnsureAnimatedSMILStyleProperties() { … }
const ComputedStyle* SVGElement::BaseComputedStyleForSMIL() { … }
bool SVGElement::HasFocusEventListeners() const { … }
void SVGElement::MarkForLayoutAndParentResourceInvalidation(
LayoutObject& layout_object) { … }
void SVGElement::NotifyResourceClients() const { … }
void SVGElement::InvalidateInstances() { … }
void SVGElement::SetNeedsStyleRecalcForInstances(
StyleChangeType change_type,
const StyleChangeReasonForTracing& reason) { … }
SVGElement::InstanceUpdateBlocker::InstanceUpdateBlocker(
SVGElement* target_element)
: … { … }
SVGElement::InstanceUpdateBlocker::~InstanceUpdateBlocker() { … }
#if DCHECK_IS_ON()
bool SVGElement::IsAnimatableAttribute(const QualifiedName& name) const { … }
#endif
SVGElementSet* SVGElement::SetOfIncomingReferences() const { … }
void SVGElement::AddReferenceTo(SVGElement* target_element) { … }
SVGElementSet& SVGElement::GetDependencyTraversalVisitedSet() { … }
void SVGElement::RemoveAllIncomingReferences() { … }
void SVGElement::RemoveAllOutgoingReferences() { … }
SVGElementResourceClient* SVGElement::GetSVGResourceClient() { … }
SVGElementResourceClient& SVGElement::EnsureSVGResourceClient() { … }
void SVGElement::Trace(Visitor* visitor) const { … }
void SVGElement::AccessKeyAction(SimulatedClickCreationScope creation_scope) { … }
void SVGElement::SynchronizeListOfSVGAttributes(
const base::span<SVGAnimatedPropertyBase*> attributes) { … }
void SVGElement::AttachLayoutTree(AttachContext& context) { … }
SMILTimeContainer* SVGElement::GetTimeContainer() const { … }
}