Bug 1867925 - Mark some storage-access-api tests as intermittent after wpt-sync....
[gecko.git] / layout / svg / SVGUseFrame.h
blobb72d29247a9b35c67ec09c5fdbbcaed90ce1c11d
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"
13 namespace mozilla {
14 class PresShell;
15 } // namespace mozilla
17 nsIFrame* NS_NewSVGUseFrame(mozilla::PresShell* aPresShell,
18 mozilla::ComputedStyle* aStyle);
20 namespace mozilla {
22 class SVGUseFrame final : public SVGGFrame {
23 friend nsIFrame* ::NS_NewSVGUseFrame(mozilla::PresShell* aPresShell,
24 ComputedStyle* aStyle);
26 protected:
27 explicit SVGUseFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
28 : SVGGFrame(aStyle, aPresContext, kClassID), mHasValidDimensions(true) {}
30 public:
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.
38 void HrefChanged();
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);
52 #endif
54 // ISVGDisplayableFrame interface:
55 void ReflowSVG() override;
56 void NotifySVGChanged(uint32_t aFlags) override;
58 private:
59 bool mHasValidDimensions;
62 } // namespace mozilla
64 #endif // LAYOUT_SVG_SVGUSEFRAME_H_