#include "third_party/blink/renderer/core/svg/svg_svg_element.h"
#include "base/ranges/algorithm.h"
#include "third_party/blink/renderer/bindings/core/v8/js_event_handler_for_content_attribute.h"
#include "third_party/blink/renderer/core/css/css_resolution_units.h"
#include "third_party/blink/renderer/core/css/style_change_reason.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/event_listener.h"
#include "third_party/blink/renderer/core/dom/static_node_list.h"
#include "third_party/blink/renderer/core/dom/xml_document.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/layout/hit_test_location.h"
#include "third_party/blink/renderer/core/layout/hit_test_result.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/layout/svg/layout_svg_model_object.h"
#include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h"
#include "third_party/blink/renderer/core/layout/svg/layout_svg_viewport_container.h"
#include "third_party/blink/renderer/core/layout/svg/svg_layout_support.h"
#include "third_party/blink/renderer/core/layout/svg/transformed_hit_test_location.h"
#include "third_party/blink/renderer/core/svg/animation/smil_time_container.h"
#include "third_party/blink/renderer/core/svg/svg_angle_tear_off.h"
#include "third_party/blink/renderer/core/svg/svg_animated_length.h"
#include "third_party/blink/renderer/core/svg/svg_animated_preserve_aspect_ratio.h"
#include "third_party/blink/renderer/core/svg/svg_animated_rect.h"
#include "third_party/blink/renderer/core/svg/svg_document_extensions.h"
#include "third_party/blink/renderer/core/svg/svg_g_element.h"
#include "third_party/blink/renderer/core/svg/svg_length_context.h"
#include "third_party/blink/renderer/core/svg/svg_length_tear_off.h"
#include "third_party/blink/renderer/core/svg/svg_matrix_tear_off.h"
#include "third_party/blink/renderer/core/svg/svg_number_tear_off.h"
#include "third_party/blink/renderer/core/svg/svg_point_tear_off.h"
#include "third_party/blink/renderer/core/svg/svg_preserve_aspect_ratio.h"
#include "third_party/blink/renderer/core/svg/svg_rect_tear_off.h"
#include "third_party/blink/renderer/core/svg/svg_transform.h"
#include "third_party/blink/renderer/core/svg/svg_transform_list.h"
#include "third_party/blink/renderer/core/svg/svg_transform_tear_off.h"
#include "third_party/blink/renderer/core/svg/svg_use_element.h"
#include "third_party/blink/renderer/core/svg/svg_view_element.h"
#include "third_party/blink/renderer/core/svg/svg_view_spec.h"
#include "third_party/blink/renderer/core/svg_names.h"
#include "third_party/blink/renderer/platform/geometry/length_functions.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/transforms/affine_transform.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "ui/gfx/geometry/rect_f.h"
namespace blink {
SVGSVGElement::SVGSVGElement(Document& doc)
: … { … }
SVGSVGElement::~SVGSVGElement() = default;
float SVGSVGElement::currentScale() const { … }
void SVGSVGElement::setCurrentScale(float scale) { … }
class SVGCurrentTranslateTearOff : public SVGPointTearOff { … };
SVGPointTearOff* SVGSVGElement::currentTranslateFromJavascript() { … }
void SVGSVGElement::SetCurrentTranslate(const gfx::Vector2dF& point) { … }
void SVGSVGElement::UpdateUserTransform() { … }
bool SVGSVGElement::ZoomAndPanEnabled() const { … }
void SVGSVGElement::ParseAttribute(const AttributeModificationParams& params) { … }
bool SVGSVGElement::IsPresentationAttribute(const QualifiedName& name) const { … }
void SVGSVGElement::CollectStyleForPresentationAttribute(
const QualifiedName& name,
const AtomicString& value,
MutableCSSPropertyValueSet* style) { … }
void SVGSVGElement::SvgAttributeChanged(
const SvgAttributeChangedParams& params) { … }
void SVGSVGElement::DidMoveToNewDocument(Document& old_document) { … }
namespace {
const SVGElement* InnermostCommonSubtreeRoot(
const SVGSVGElement& svg_root,
const SVGElement* reference_element) { … }
enum class ElementResultFilter { … };
HeapVector<Member<Element>> ComputeIntersectionList(
const SVGSVGElement& root,
const SVGElement* reference_element,
const gfx::RectF& rect,
ElementResultFilter filter) { … }
}
StaticNodeTypeList<Element>* SVGSVGElement::getIntersectionList(
SVGRectTearOff* rect,
SVGElement* reference_element) const { … }
bool SVGSVGElement::checkIntersection(SVGElement* element,
SVGRectTearOff* rect) const { … }
static bool IsEnclosureTarget(const LayoutObject* layout_object) { … }
bool SVGSVGElement::CheckEnclosure(const SVGElement& element,
const gfx::RectF& rect) const { … }
StaticNodeList* SVGSVGElement::getEnclosureList(
SVGRectTearOff* query_rect,
SVGElement* reference_element) const { … }
bool SVGSVGElement::checkEnclosure(SVGElement* element,
SVGRectTearOff* rect) const { … }
void SVGSVGElement::deselectAll() { … }
SVGNumberTearOff* SVGSVGElement::createSVGNumber() { … }
SVGLengthTearOff* SVGSVGElement::createSVGLength() { … }
SVGAngleTearOff* SVGSVGElement::createSVGAngle() { … }
SVGPointTearOff* SVGSVGElement::createSVGPoint() { … }
SVGMatrixTearOff* SVGSVGElement::createSVGMatrix() { … }
SVGRectTearOff* SVGSVGElement::createSVGRect() { … }
SVGTransformTearOff* SVGSVGElement::createSVGTransform() { … }
SVGTransformTearOff* SVGSVGElement::createSVGTransformFromMatrix(
SVGMatrixTearOff* matrix) { … }
AffineTransform SVGSVGElement::LocalCoordinateSpaceTransform(
CTMScope mode) const { … }
bool SVGSVGElement::LayoutObjectIsNeeded(const DisplayStyle& style) const { … }
void SVGSVGElement::AttachLayoutTree(AttachContext& context) { … }
LayoutObject* SVGSVGElement::CreateLayoutObject(const ComputedStyle&) { … }
Node::InsertionNotificationRequest SVGSVGElement::InsertedInto(
ContainerNode& root_parent) { … }
void SVGSVGElement::RemovedFrom(ContainerNode& root_parent) { … }
void SVGSVGElement::pauseAnimations() { … }
void SVGSVGElement::unpauseAnimations() { … }
bool SVGSVGElement::animationsPaused() const { … }
float SVGSVGElement::getCurrentTime() const { … }
void SVGSVGElement::setCurrentTime(float seconds) { … }
bool SVGSVGElement::SelfHasRelativeLengths() const { … }
bool SVGSVGElement::HasEmptyViewBox() const { … }
bool SVGSVGElement::ShouldSynthesizeViewBox() const { … }
const SVGRect& SVGSVGElement::CurrentViewBox() const { … }
gfx::RectF SVGSVGElement::CurrentViewBoxRect() const { … }
const SVGPreserveAspectRatio* SVGSVGElement::CurrentPreserveAspectRatio()
const { … }
std::optional<float> SVGSVGElement::IntrinsicWidth() const { … }
std::optional<float> SVGSVGElement::IntrinsicHeight() const { … }
AffineTransform SVGSVGElement::ViewBoxToViewTransform(
const gfx::SizeF& viewport_size) const { … }
void SVGSVGElement::SetViewSpec(const SVGViewSpec* view_spec) { … }
const SVGViewSpec* SVGSVGElement::ParseViewSpec(
const String& fragment_identifier,
Element* anchor_node) const { … }
void SVGSVGElement::FinishParsingChildren() { … }
void SVGSVGElement::Trace(Visitor* visitor) const { … }
SVGAnimatedPropertyBase* SVGSVGElement::PropertyFromAttribute(
const QualifiedName& attribute_name) const { … }
void SVGSVGElement::SynchronizeAllSVGAttributes() const { … }
void SVGSVGElement::CollectExtraStyleForPresentationAttribute(
MutableCSSPropertyValueSet* style) { … }
}