1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_SVG_SVGGRAPHICSELEMENT_H_
8 #define DOM_SVG_SVGGRAPHICSELEMENT_H_
10 #include "mozilla/dom/SVGTests.h"
11 #include "mozilla/dom/SVGTransformableElement.h"
13 namespace mozilla::dom
{
15 using SVGGraphicsElementBase
= SVGTransformableElement
;
17 class SVGGraphicsElement
: public SVGGraphicsElementBase
, public SVGTests
{
19 explicit SVGGraphicsElement(
20 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
21 ~SVGGraphicsElement() = default;
25 NS_DECL_ISUPPORTS_INHERITED
27 NS_IMPL_FROMNODE_HELPER(SVGGraphicsElement
, IsSVGGraphicsElement())
30 SVGElement
* GetNearestViewportElement();
31 SVGElement
* GetFarthestViewportElement();
33 already_AddRefed
<SVGRect
> GetBBox(const SVGBoundingBoxOptions
&);
34 already_AddRefed
<SVGMatrix
> GetCTM();
35 already_AddRefed
<SVGMatrix
> GetScreenCTM();
37 bool IsFocusableInternal(int32_t* aTabIndex
, bool aWithMouse
) override
;
38 bool IsSVGGraphicsElement() const final
{ return true; }
41 // Overrides SVGTests.
42 SVGElement
* AsSVGElement() final
{ return this; }
45 // returns true if focusability has been definitively determined otherwise
47 bool IsSVGFocusable(bool* aIsFocusable
, int32_t* aTabIndex
);
50 bool IsInLengthInfo(const nsAtom
* aAttribute
, const T
& aLengthInfos
) const {
51 for (auto const& e
: aLengthInfos
) {
52 if (e
.mName
== aAttribute
) {
60 } // namespace mozilla::dom
62 #endif // DOM_SVG_SVGGRAPHICSELEMENT_H_