Bumping gaia.json for 3 gaia revision(s) a=gaia-bump
[gecko.git] / dom / svg / SVGTextPositioningElement.cpp
blob3765c0fb7b7a7cb110a720c7020bc868d42435e6
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 #include "mozilla/ArrayUtils.h"
8 #include "mozilla/dom/SVGTextPositioningElement.h"
9 #include "SVGAnimatedLengthList.h"
10 #include "DOMSVGAnimatedLengthList.h"
11 #include "DOMSVGAnimatedNumberList.h"
12 #include "SVGContentUtils.h"
14 namespace mozilla {
15 namespace dom {
17 nsSVGElement::LengthListInfo SVGTextPositioningElement::sLengthListInfo[4] =
19 { &nsGkAtoms::x, SVGContentUtils::X, false },
20 { &nsGkAtoms::y, SVGContentUtils::Y, false },
21 { &nsGkAtoms::dx, SVGContentUtils::X, true },
22 { &nsGkAtoms::dy, SVGContentUtils::Y, true }
25 nsSVGElement::LengthListAttributesInfo
26 SVGTextPositioningElement::GetLengthListInfo()
28 return LengthListAttributesInfo(mLengthListAttributes, sLengthListInfo,
29 ArrayLength(sLengthListInfo));
33 nsSVGElement::NumberListInfo SVGTextPositioningElement::sNumberListInfo[1] =
35 { &nsGkAtoms::rotate }
38 nsSVGElement::NumberListAttributesInfo
39 SVGTextPositioningElement::GetNumberListInfo()
41 return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
42 ArrayLength(sNumberListInfo));
45 //----------------------------------------------------------------------
47 already_AddRefed<DOMSVGAnimatedLengthList>
48 SVGTextPositioningElement::X()
50 return DOMSVGAnimatedLengthList::GetDOMWrapper(&mLengthListAttributes[ATTR_X],
51 this, ATTR_X, SVGContentUtils::X);
54 already_AddRefed<DOMSVGAnimatedLengthList>
55 SVGTextPositioningElement::Y()
57 return DOMSVGAnimatedLengthList::GetDOMWrapper(&mLengthListAttributes[ATTR_Y],
58 this, ATTR_Y, SVGContentUtils::Y);
61 already_AddRefed<DOMSVGAnimatedLengthList>
62 SVGTextPositioningElement::Dx()
64 return DOMSVGAnimatedLengthList::GetDOMWrapper(&mLengthListAttributes[ATTR_DX],
65 this, ATTR_DX, SVGContentUtils::X);
68 already_AddRefed<DOMSVGAnimatedLengthList>
69 SVGTextPositioningElement::Dy()
71 return DOMSVGAnimatedLengthList::GetDOMWrapper(&mLengthListAttributes[ATTR_DY],
72 this, ATTR_DY, SVGContentUtils::Y);
75 already_AddRefed<DOMSVGAnimatedNumberList>
76 SVGTextPositioningElement::Rotate()
78 return DOMSVGAnimatedNumberList::GetDOMWrapper(&mNumberListAttributes[ROTATE],
79 this, ROTATE);
82 } // namespace dom
83 } // namespace mozilla