SVGTSpanElement.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* -*- Mode: C++; tab-width: 8; 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/. */
  5. #include "mozilla/dom/SVGTSpanElement.h"
  6. #include "mozilla/dom/SVGTSpanElementBinding.h"
  7. NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(TSpan)
  8. namespace mozilla {
  9. namespace dom {
  10. JSObject*
  11. SVGTSpanElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
  12. {
  13. return SVGTSpanElementBinding::Wrap(aCx, this, aGivenProto);
  14. }
  15. //----------------------------------------------------------------------
  16. // Implementation
  17. SVGTSpanElement::SVGTSpanElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
  18. : SVGTSpanElementBase(aNodeInfo)
  19. {
  20. }
  21. nsSVGElement::EnumAttributesInfo
  22. SVGTSpanElement::GetEnumInfo()
  23. {
  24. return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
  25. ArrayLength(sEnumInfo));
  26. }
  27. nsSVGElement::LengthAttributesInfo
  28. SVGTSpanElement::GetLengthInfo()
  29. {
  30. return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
  31. ArrayLength(sLengthInfo));
  32. }
  33. //----------------------------------------------------------------------
  34. // nsIDOMNode methods
  35. NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGTSpanElement)
  36. //----------------------------------------------------------------------
  37. // nsIContent methods
  38. NS_IMETHODIMP_(bool)
  39. SVGTSpanElement::IsAttributeMapped(const nsIAtom* name) const
  40. {
  41. static const MappedAttributeEntry* const map[] = {
  42. sColorMap,
  43. sFillStrokeMap,
  44. sFontSpecificationMap,
  45. sGraphicsMap,
  46. sTextContentElementsMap
  47. };
  48. return FindAttributeDependence(name, map) ||
  49. SVGTSpanElementBase::IsAttributeMapped(name);
  50. }
  51. } // namespace dom
  52. } // namespace mozilla