HTMLTemplateElement.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #ifndef mozilla_dom_HTMLTemplateElement_h
  6. #define mozilla_dom_HTMLTemplateElement_h
  7. #include "mozilla/Attributes.h"
  8. #include "nsIDOMHTMLElement.h"
  9. #include "nsGenericHTMLElement.h"
  10. #include "mozilla/dom/DocumentFragment.h"
  11. namespace mozilla {
  12. namespace dom {
  13. class HTMLTemplateElement final : public nsGenericHTMLElement
  14. {
  15. public:
  16. explicit HTMLTemplateElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
  17. // nsISupports
  18. NS_DECL_ISUPPORTS_INHERITED
  19. NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLTemplateElement,
  20. nsGenericHTMLElement)
  21. virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
  22. DocumentFragment* Content()
  23. {
  24. return mContent;
  25. }
  26. protected:
  27. virtual ~HTMLTemplateElement();
  28. virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
  29. RefPtr<DocumentFragment> mContent;
  30. };
  31. } // namespace dom
  32. } // namespace mozilla
  33. #endif // mozilla_dom_HTMLTemplateElement_h