Backed out 7 changesets (bug 1881620) for causing frequent media crashes. CLOSED...
[gecko.git] / layout / svg / SVGGFrame.cpp
blob92df721ffb3196c99e8066be96d1fc04b0292023
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 // Main header first:
8 #include "SVGGFrame.h"
10 // Keep others in (case-insensitive) order:
11 #include "mozilla/dom/SVGElement.h"
12 #include "mozilla/PresShell.h"
13 #include "nsGkAtoms.h"
14 #include "nsIFrame.h"
16 using namespace mozilla::dom;
18 //----------------------------------------------------------------------
19 // Implementation
21 nsIFrame* NS_NewSVGGFrame(mozilla::PresShell* aPresShell,
22 mozilla::ComputedStyle* aStyle) {
23 return new (aPresShell)
24 mozilla::SVGGFrame(aStyle, aPresShell->GetPresContext());
27 namespace mozilla {
29 NS_IMPL_FRAMEARENA_HELPERS(SVGGFrame)
31 #ifdef DEBUG
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);
40 #endif /* DEBUG */
42 //----------------------------------------------------------------------
43 // ISVGDisplayableFrame methods
45 nsresult SVGGFrame::AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
46 int32_t aModType) {
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);
55 return NS_OK;
58 } // namespace mozilla