chromium/third_party/blink/renderer/core/svg/svg_element.cc

/*
 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann
 * <[email protected]>
 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <[email protected]>
 * Copyright (C) 2008 Apple Inc. All rights reserved.
 * Copyright (C) 2008 Alp Toker <[email protected]>
 * Copyright (C) 2009 Cameron McCormack <[email protected]>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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) {}

}  // namespace

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  // DCHECK_IS_ON()

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 {}

}  // namespace blink