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/. */
10 // Keep others in (case-insensitive) order:
11 #include "mozilla/dom/SVGElement.h"
12 #include "mozilla/PresShell.h"
13 #include "nsGkAtoms.h"
16 using namespace mozilla::dom
;
18 //----------------------------------------------------------------------
21 nsIFrame
* NS_NewSVGGFrame(mozilla::PresShell
* aPresShell
,
22 mozilla::ComputedStyle
* aStyle
) {
23 return new (aPresShell
)
24 mozilla::SVGGFrame(aStyle
, aPresShell
->GetPresContext());
29 NS_IMPL_FRAMEARENA_HELPERS(SVGGFrame
)
32 void SVGGFrame::Init(nsIContent
* aContent
, nsContainerFrame
* aParent
,
33 nsIFrame
* aPrevInFlow
) {
34 NS_ASSERTION(aContent
->IsSVGElement() &&
35 static_cast<SVGElement
*>(aContent
)->IsTransformable(),
36 "The element is not transformable");
38 SVGDisplayContainerFrame::Init(aContent
, aParent
, aPrevInFlow
);
42 //----------------------------------------------------------------------
43 // ISVGDisplayableFrame methods
45 nsresult
SVGGFrame::AttributeChanged(int32_t aNameSpaceID
, nsAtom
* aAttribute
,
47 if (aNameSpaceID
== kNameSpaceID_None
&& aAttribute
== nsGkAtoms::transform
) {
48 // We don't invalidate for transform changes (the layers code does that).
49 // Also note that SVGTransformableElement::GetAttributeChangeHint will
50 // return nsChangeHint_UpdateOverflow for "transform" attribute changes
51 // and cause DoApplyRenderingChangeToTree to make the SchedulePaint call.
52 NotifySVGChanged(TRANSFORM_CHANGED
);
58 } // namespace mozilla