2012-12-25 23:20:35 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_HTMLTITLEElement_h_
|
|
|
|
#define mozilla_dom_HTMLTITLEElement_h_
|
|
|
|
|
2012-12-25 23:47:17 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-12-25 23:20:35 +00:00
|
|
|
#include "nsIDOMHTMLTitleElement.h"
|
|
|
|
#include "nsGenericHTMLElement.h"
|
|
|
|
#include "nsStubMutationObserver.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
2012-12-25 23:47:17 +00:00
|
|
|
class ErrorResult;
|
|
|
|
|
2012-12-25 23:20:35 +00:00
|
|
|
namespace dom {
|
|
|
|
|
2013-07-11 21:26:54 +00:00
|
|
|
class HTMLTitleElement MOZ_FINAL : public nsGenericHTMLElement,
|
|
|
|
public nsIDOMHTMLTitleElement,
|
|
|
|
public nsStubMutationObserver
|
2012-12-25 23:20:35 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
using Element::GetText;
|
|
|
|
using Element::SetText;
|
|
|
|
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit HTMLTitleElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
|
2012-12-25 23:20:35 +00:00
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// nsIDOMHTMLTitleElement
|
|
|
|
NS_DECL_NSIDOMHTMLTITLEELEMENT
|
|
|
|
|
2012-12-25 23:47:17 +00:00
|
|
|
//HTMLTitleElement
|
|
|
|
//The xpcom GetTextContent() never fails so we just use that.
|
|
|
|
void SetText(const nsAString& aText, ErrorResult& aError)
|
|
|
|
{
|
|
|
|
aError = SetText(aText);
|
|
|
|
}
|
|
|
|
|
2012-12-25 23:20:35 +00:00
|
|
|
// nsIMutationObserver
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
|
|
|
|
|
2014-06-20 02:01:40 +00:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2012-12-25 23:20:35 +00:00
|
|
|
|
|
|
|
virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
|
|
|
|
nsIContent *aBindingParent,
|
2013-05-29 20:43:41 +00:00
|
|
|
bool aCompileEventHandlers) MOZ_OVERRIDE;
|
2012-12-25 23:20:35 +00:00
|
|
|
|
|
|
|
virtual void UnbindFromTree(bool aDeep = true,
|
2013-05-29 20:43:41 +00:00
|
|
|
bool aNullParent = true) MOZ_OVERRIDE;
|
2012-12-25 23:20:35 +00:00
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
virtual void DoneAddingChildren(bool aHaveNotified) MOZ_OVERRIDE;
|
2012-12-25 23:20:35 +00:00
|
|
|
|
2012-12-25 23:47:17 +00:00
|
|
|
protected:
|
2014-07-08 21:23:16 +00:00
|
|
|
virtual ~HTMLTitleElement();
|
2012-12-25 23:47:17 +00:00
|
|
|
|
2014-04-08 22:27:17 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext* cx)
|
2012-12-25 23:47:17 +00:00
|
|
|
MOZ_OVERRIDE MOZ_FINAL;
|
|
|
|
|
2012-12-25 23:20:35 +00:00
|
|
|
private:
|
|
|
|
void SendTitleChangeEvent(bool aBound);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_HTMLTitleElement_h_
|