layout/svg/nsSVGGenericContainerFrame.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/svg/nsSVGGenericContainerFrame.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,63 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +// Main header first:
    1.10 +#include "nsSVGGenericContainerFrame.h"
    1.11 +#include "nsSVGIntegrationUtils.h"
    1.12 +
    1.13 +//----------------------------------------------------------------------
    1.14 +// nsSVGGenericContainerFrame Implementation
    1.15 +
    1.16 +nsIFrame*
    1.17 +NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
    1.18 +{
    1.19 +  return new (aPresShell) nsSVGGenericContainerFrame(aContext);
    1.20 +}
    1.21 +
    1.22 +NS_IMPL_FRAMEARENA_HELPERS(nsSVGGenericContainerFrame)
    1.23 +
    1.24 +//----------------------------------------------------------------------
    1.25 +// nsIFrame methods
    1.26 +
    1.27 +nsresult
    1.28 +nsSVGGenericContainerFrame::AttributeChanged(int32_t         aNameSpaceID,
    1.29 +                                             nsIAtom*        aAttribute,
    1.30 +                                             int32_t         aModType)
    1.31 +{
    1.32 +#ifdef DEBUG
    1.33 +    nsAutoString str;
    1.34 +    aAttribute->ToString(str);
    1.35 +    printf("** nsSVGGenericContainerFrame::AttributeChanged(%s)\n",
    1.36 +           NS_LossyConvertUTF16toASCII(str).get());
    1.37 +#endif
    1.38 +
    1.39 +  return NS_OK;
    1.40 +}
    1.41 +
    1.42 +nsIAtom *
    1.43 +nsSVGGenericContainerFrame::GetType() const
    1.44 +{
    1.45 +  return nsGkAtoms::svgGenericContainerFrame;
    1.46 +}
    1.47 +
    1.48 +//----------------------------------------------------------------------
    1.49 +// nsSVGContainerFrame methods:
    1.50 +
    1.51 +gfxMatrix
    1.52 +nsSVGGenericContainerFrame::GetCanvasTM(uint32_t aFor,
    1.53 +                                        nsIFrame* aTransformRoot)
    1.54 +{
    1.55 +  if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY) && !aTransformRoot) {
    1.56 +    if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
    1.57 +        (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
    1.58 +      return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
    1.59 +    }
    1.60 +  }
    1.61 +
    1.62 +  NS_ASSERTION(mParent, "null parent");
    1.63 +  
    1.64 +  return static_cast<nsSVGContainerFrame*>(mParent)->
    1.65 +      GetCanvasTM(aFor, aTransformRoot);
    1.66 +}

mercurial