layout/svg/nsSVGGenericContainerFrame.cpp

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 // Main header first:
     7 #include "nsSVGGenericContainerFrame.h"
     8 #include "nsSVGIntegrationUtils.h"
    10 //----------------------------------------------------------------------
    11 // nsSVGGenericContainerFrame Implementation
    13 nsIFrame*
    14 NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
    15 {
    16   return new (aPresShell) nsSVGGenericContainerFrame(aContext);
    17 }
    19 NS_IMPL_FRAMEARENA_HELPERS(nsSVGGenericContainerFrame)
    21 //----------------------------------------------------------------------
    22 // nsIFrame methods
    24 nsresult
    25 nsSVGGenericContainerFrame::AttributeChanged(int32_t         aNameSpaceID,
    26                                              nsIAtom*        aAttribute,
    27                                              int32_t         aModType)
    28 {
    29 #ifdef DEBUG
    30     nsAutoString str;
    31     aAttribute->ToString(str);
    32     printf("** nsSVGGenericContainerFrame::AttributeChanged(%s)\n",
    33            NS_LossyConvertUTF16toASCII(str).get());
    34 #endif
    36   return NS_OK;
    37 }
    39 nsIAtom *
    40 nsSVGGenericContainerFrame::GetType() const
    41 {
    42   return nsGkAtoms::svgGenericContainerFrame;
    43 }
    45 //----------------------------------------------------------------------
    46 // nsSVGContainerFrame methods:
    48 gfxMatrix
    49 nsSVGGenericContainerFrame::GetCanvasTM(uint32_t aFor,
    50                                         nsIFrame* aTransformRoot)
    51 {
    52   if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY) && !aTransformRoot) {
    53     if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
    54         (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
    55       return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
    56     }
    57   }
    59   NS_ASSERTION(mParent, "null parent");
    61   return static_cast<nsSVGContainerFrame*>(mParent)->
    62       GetCanvasTM(aFor, aTransformRoot);
    63 }

mercurial