SVGGElement.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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/SVGGElement.h"
  6. #include "mozilla/dom/SVGGElementBinding.h"
  7. NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(G)
  8. namespace mozilla {
  9. namespace dom {
  10. JSObject*
  11. SVGGElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
  12. {
  13. return SVGGElementBinding::Wrap(aCx, this, aGivenProto);
  14. }
  15. //----------------------------------------------------------------------
  16. // Implementation
  17. SVGGElement::SVGGElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
  18. : SVGGraphicsElement(aNodeInfo)
  19. {
  20. }
  21. //----------------------------------------------------------------------
  22. // nsIDOMNode methods
  23. NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGGElement)
  24. //----------------------------------------------------------------------
  25. // nsIContent methods
  26. NS_IMETHODIMP_(bool)
  27. SVGGElement::IsAttributeMapped(const nsIAtom* name) const
  28. {
  29. static const MappedAttributeEntry* const map[] = {
  30. sFEFloodMap,
  31. sFiltersMap,
  32. sFontSpecificationMap,
  33. sGradientStopMap,
  34. sLightingEffectsMap,
  35. sMarkersMap,
  36. sTextContentElementsMap,
  37. sViewportsMap
  38. };
  39. return FindAttributeDependence(name, map) ||
  40. SVGGraphicsElement::IsAttributeMapped(name);
  41. }
  42. } // namespace dom
  43. } // namespace mozilla