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