1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_HTMLTimeElement_h 8 #define mozilla_dom_HTMLTimeElement_h 9 10 #include "mozilla/Attributes.h" 11 #include "nsGenericHTMLElement.h" 12 #include "nsGkAtoms.h" 13 14 namespace mozilla { 15 namespace dom { 16 17 class HTMLTimeElement final : public nsGenericHTMLElement { 18 public: 19 explicit HTMLTimeElement( 20 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); 21 virtual ~HTMLTimeElement(); 22 23 // HTMLTimeElement WebIDL GetDateTime(DOMString & aDateTime)24 void GetDateTime(DOMString& aDateTime) { 25 GetHTMLAttr(nsGkAtoms::datetime, aDateTime); 26 } 27 SetDateTime(const nsAString & aDateTime,ErrorResult & aError)28 void SetDateTime(const nsAString& aDateTime, ErrorResult& aError) { 29 SetHTMLAttr(nsGkAtoms::datetime, aDateTime, aError); 30 } 31 32 virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; 33 34 protected: 35 virtual JSObject* WrapNode(JSContext* aCx, 36 JS::Handle<JSObject*> aGivenProto) override; 37 }; 38 39 } // namespace dom 40 } // namespace mozilla 41 42 #endif // mozilla_dom_HTMLTimeElement_h 43