michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // Main header first: michael@0: #include "nsSVGGenericContainerFrame.h" michael@0: #include "nsSVGIntegrationUtils.h" michael@0: michael@0: //---------------------------------------------------------------------- michael@0: // nsSVGGenericContainerFrame Implementation michael@0: michael@0: nsIFrame* michael@0: NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) michael@0: { michael@0: return new (aPresShell) nsSVGGenericContainerFrame(aContext); michael@0: } michael@0: michael@0: NS_IMPL_FRAMEARENA_HELPERS(nsSVGGenericContainerFrame) michael@0: michael@0: //---------------------------------------------------------------------- michael@0: // nsIFrame methods michael@0: michael@0: nsresult michael@0: nsSVGGenericContainerFrame::AttributeChanged(int32_t aNameSpaceID, michael@0: nsIAtom* aAttribute, michael@0: int32_t aModType) michael@0: { michael@0: #ifdef DEBUG michael@0: nsAutoString str; michael@0: aAttribute->ToString(str); michael@0: printf("** nsSVGGenericContainerFrame::AttributeChanged(%s)\n", michael@0: NS_LossyConvertUTF16toASCII(str).get()); michael@0: #endif michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: nsIAtom * michael@0: nsSVGGenericContainerFrame::GetType() const michael@0: { michael@0: return nsGkAtoms::svgGenericContainerFrame; michael@0: } michael@0: michael@0: //---------------------------------------------------------------------- michael@0: // nsSVGContainerFrame methods: michael@0: michael@0: gfxMatrix michael@0: nsSVGGenericContainerFrame::GetCanvasTM(uint32_t aFor, michael@0: nsIFrame* aTransformRoot) michael@0: { michael@0: if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY) && !aTransformRoot) { michael@0: if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) || michael@0: (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) { michael@0: return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this); michael@0: } michael@0: } michael@0: michael@0: NS_ASSERTION(mParent, "null parent"); michael@0: michael@0: return static_cast(mParent)-> michael@0: GetCanvasTM(aFor, aTransformRoot); michael@0: }