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 LAYOUT_SVG_SVGUSEFRAME_H_
8 #define LAYOUT_SVG_SVGUSEFRAME_H_
10 // Keep in (case-insensitive) order:
11 #include "SVGGFrame.h"
15 } // namespace mozilla
17 nsIFrame
* NS_NewSVGUseFrame(mozilla::PresShell
* aPresShell
,
18 mozilla::ComputedStyle
* aStyle
);
22 class SVGUseFrame final
: public SVGGFrame
{
23 friend nsIFrame
* ::NS_NewSVGUseFrame(mozilla::PresShell
* aPresShell
,
24 ComputedStyle
* aStyle
);
27 explicit SVGUseFrame(ComputedStyle
* aStyle
, nsPresContext
* aPresContext
)
28 : SVGGFrame(aStyle
, aPresContext
, kClassID
), mHasValidDimensions(true) {}
31 NS_DECL_FRAMEARENA_HELPERS(SVGUseFrame
)
33 // nsIFrame interface:
34 void Init(nsIContent
* aContent
, nsContainerFrame
* aParent
,
35 nsIFrame
* aPrevInFlow
) override
;
37 // Called when the href attributes changed.
40 // Called when the width or height attributes changed.
41 void DimensionAttributeChanged(bool aHadValidDimensions
,
42 bool aAttributeIsUsed
);
44 nsresult
AttributeChanged(int32_t aNamespaceID
, nsAtom
* aAttribute
,
45 int32_t aModType
) override
;
46 void DidSetComputedStyle(ComputedStyle
* aOldComputedStyle
) override
;
48 #ifdef DEBUG_FRAME_DUMP
49 nsresult
GetFrameName(nsAString
& aResult
) const override
{
50 return MakeFrameName(u
"SVGUse"_ns
, aResult
);
54 // ISVGDisplayableFrame interface:
55 void ReflowSVG() override
;
56 void NotifySVGChanged(uint32_t aFlags
) override
;
59 bool mHasValidDimensions
;
62 } // namespace mozilla
64 #endif // LAYOUT_SVG_SVGUSEFRAME_H_