Truly independent web browser
/*
* Copyright (c) 2022, Sam Atkins <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/SVG/AttributeParsing.h>
#include <LibWeb/SVG/SVGGeometryElement.h>
namespace Web::SVG {
class SVGEllipseElement final : public SVGGeometryElement {
WEB_WRAPPABLE(SVGEllipseElement, SVGGeometryElement);
GC_DECLARE_ALLOCATOR(SVGEllipseElement);
public:
virtual ~SVGEllipseElement() override = default;
// AD-HOC: The spec states that the cx, cy, rx and ry IDL attributes reflect the respective computed values and their
// corresponding presentation attributes but other browsers reflect the attribute values instead - see
// https://github.com/w3c/svgwg/issues/1153
// https://w3c.github.io/svgwg/svg2-draft/shapes.html#__svg__SVGEllipseElement__cx
REFLECT_ANIMATED_LENGTH_ATTRIBUTE(cx, Horizontal, SVGLengthValue::number(0));
// https://w3c.github.io/svgwg/svg2-draft/shapes.html#__svg__SVGEllipseElement__cy
REFLECT_ANIMATED_LENGTH_ATTRIBUTE(cy, Vertical, SVGLengthValue::number(0));
// https://w3c.github.io/svgwg/svg2-draft/shapes.html#__svg__SVGEllipseElement__rx
REFLECT_ANIMATED_LENGTH_ATTRIBUTE(rx, Horizontal, SVGLengthValue::number(0));
// https://w3c.github.io/svgwg/svg2-draft/shapes.html#__svg__SVGEllipseElement__ry
REFLECT_ANIMATED_LENGTH_ATTRIBUTE(ry, Vertical, SVGLengthValue::number(0));
private:
virtual bool is_svg_ellipse_element() const final { return true; }
SVGEllipseElement(DOM::Document&, DOM::QualifiedName);
};
}
namespace Web::DOM {
template<>
inline bool Node::fast_is<SVG::SVGEllipseElement>() const { return is_svg_ellipse_element(); }
}