bug 824940 - rename nsHTMLTitleElement -> mozila::dom::HTMLTitleElement r=bz
authorTrevor Saunders <trev.saunders@gmail.com>
Tue, 25 Dec 2012 18:20:35 -0500
changeset 127093 470bffebe490650e320cd5f1031869099c588af5
parent 127092 33b8ce28ce5c54437e944f5f59c84c3af0d07c1b
child 127094 9451057c1e00f9062bd0d2c0139a650c296d370d
push id297
push userlsblakk@mozilla.com
push dateTue, 26 Mar 2013 17:28:00 +0000
treeherdermozilla-release@64d7b45c34e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs824940
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 824940 - rename nsHTMLTitleElement -> mozila::dom::HTMLTitleElement r=bz
content/html/content/src/HTMLTitleElement.cpp
content/html/content/src/HTMLTitleElement.h
content/html/content/src/Makefile.in
content/html/content/src/nsHTMLTitleElement.cpp
new file mode 100644
--- /dev/null
+++ b/content/html/content/src/HTMLTitleElement.cpp
@@ -0,0 +1,146 @@
+/* -*- 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/. */
+
+#include "mozilla/dom/HTMLTitleElement.h"
+
+#include "nsStyleConsts.h"
+#include "nsIDocument.h"
+#include "nsContentUtils.h"
+
+
+NS_IMPL_NS_NEW_HTML_ELEMENT(Title)
+
+namespace mozilla {
+namespace dom {
+
+HTMLTitleElement::HTMLTitleElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+  : nsGenericHTMLElement(aNodeInfo)
+{
+  AddMutationObserver(this);
+}
+
+HTMLTitleElement::~HTMLTitleElement()
+{
+}
+
+
+NS_IMPL_ADDREF_INHERITED(HTMLTitleElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLTitleElement, Element)
+
+} // namespace dom
+} // namespace mozilla
+
+DOMCI_NODE_DATA(HTMLTitleElement, mozilla::dom::HTMLTitleElement)
+
+namespace mozilla {
+namespace dom {
+
+// QueryInterface implementation for HTMLTitleElement
+NS_INTERFACE_TABLE_HEAD(HTMLTitleElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE2(HTMLTitleElement,
+                                   nsIDOMHTMLTitleElement,
+                                   nsIMutationObserver)
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTitleElement,
+                                               nsGenericHTMLElement)
+NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTitleElement)
+
+
+NS_IMPL_ELEMENT_CLONE(HTMLTitleElement)
+
+
+NS_IMETHODIMP 
+HTMLTitleElement::GetText(nsAString& aTitle)
+{
+  nsContentUtils::GetNodeTextContent(this, false, aTitle);
+  return NS_OK;
+}
+
+NS_IMETHODIMP 
+HTMLTitleElement::SetText(const nsAString& aTitle)
+{
+  return nsContentUtils::SetNodeTextContent(this, aTitle, true);
+}
+
+void
+HTMLTitleElement::CharacterDataChanged(nsIDocument *aDocument,
+                                       nsIContent *aContent,
+                                       CharacterDataChangeInfo *aInfo)
+{
+  SendTitleChangeEvent(false);
+}
+
+void
+HTMLTitleElement::ContentAppended(nsIDocument *aDocument,
+                                  nsIContent *aContainer,
+                                  nsIContent *aFirstNewContent,
+                                  int32_t aNewIndexInContainer)
+{
+  SendTitleChangeEvent(false);
+}
+
+void
+HTMLTitleElement::ContentInserted(nsIDocument *aDocument,
+                                  nsIContent *aContainer,
+                                  nsIContent *aChild,
+                                  int32_t aIndexInContainer)
+{
+  SendTitleChangeEvent(false);
+}
+
+void
+HTMLTitleElement::ContentRemoved(nsIDocument *aDocument,
+                                 nsIContent *aContainer,
+                                 nsIContent *aChild,
+                                 int32_t aIndexInContainer,
+                                 nsIContent *aPreviousSibling)
+{
+  SendTitleChangeEvent(false);
+}
+
+nsresult
+HTMLTitleElement::BindToTree(nsIDocument *aDocument,
+                             nsIContent *aParent,
+                             nsIContent *aBindingParent,
+                             bool aCompileEventHandlers)
+{
+  // Let this fall through.
+  nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
+                                                 aBindingParent,
+                                                 aCompileEventHandlers);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  SendTitleChangeEvent(true);
+
+  return NS_OK;
+}
+
+void
+HTMLTitleElement::UnbindFromTree(bool aDeep, bool aNullParent)
+{
+  SendTitleChangeEvent(false);
+
+  // Let this fall through.
+  nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
+}
+
+void
+HTMLTitleElement::DoneAddingChildren(bool aHaveNotified)
+{
+  if (!aHaveNotified) {
+    SendTitleChangeEvent(false);
+  }
+}
+
+void
+HTMLTitleElement::SendTitleChangeEvent(bool aBound)
+{
+  nsIDocument* doc = GetCurrentDoc();
+  if (doc) {
+    doc->NotifyPossibleTitleChange(aBound);
+  }
+}
+
+} // namespace dom
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/content/html/content/src/HTMLTitleElement.h
@@ -0,0 +1,69 @@
+/* -*- 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_
+
+#include "nsIDOMHTMLTitleElement.h"
+#include "nsGenericHTMLElement.h"
+#include "nsStubMutationObserver.h"
+
+namespace mozilla {
+namespace dom {
+
+class HTMLTitleElement : public nsGenericHTMLElement,
+                         public nsIDOMHTMLTitleElement,
+                         public nsStubMutationObserver
+{
+public:
+  using Element::GetText;
+  using Element::SetText;
+
+  HTMLTitleElement(already_AddRefed<nsINodeInfo> aNodeInfo);
+  virtual ~HTMLTitleElement();
+
+  // nsISupports
+  NS_DECL_ISUPPORTS_INHERITED
+
+  // nsIDOMNode
+  NS_FORWARD_NSIDOMNODE_TO_NSINODE
+
+  // nsIDOMElement
+  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
+
+  // nsIDOMHTMLElement
+  NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
+
+  // nsIDOMHTMLTitleElement
+  NS_DECL_NSIDOMHTMLTITLEELEMENT
+
+  // nsIMutationObserver
+  NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
+  NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
+  NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
+  NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
+
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
+
+  virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
+                              nsIContent *aBindingParent,
+                              bool aCompileEventHandlers);
+
+  virtual void UnbindFromTree(bool aDeep = true,
+                              bool aNullParent = true);
+
+  virtual void DoneAddingChildren(bool aHaveNotified);
+
+  virtual nsXPCClassInfo* GetClassInfo();
+
+  virtual nsIDOMNode* AsDOMNode() { return this; }
+private:
+  void SendTitleChangeEvent(bool aBound);
+};
+
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_HTMLTitleElement_h_
--- a/content/html/content/src/Makefile.in
+++ b/content/html/content/src/Makefile.in
@@ -30,16 +30,17 @@ EXPORTS_NAMESPACES = mozilla/dom
 EXPORTS_mozilla/dom = \
 		HTMLBodyElement.h \
 		HTMLDataListElement.h \
 		HTMLDivElement.h \
 		HTMLFontElement.h \
 		HTMLFrameSetElement.h \
 		HTMLHeadingElement.h \
 		HTMLLabelElement.h \
+		HTMLTitleElement.h \
 		HTMLUnknownElement.h
 
 CPPSRCS		= \
 		HTMLPropertiesCollection.cpp \
 		nsClientRect.cpp \
 		nsHTMLDNSPrefetch.cpp \
 		nsGenericHTMLElement.cpp \
 		nsGenericHTMLFrameElement.cpp \
@@ -90,17 +91,17 @@ CPPSRCS		= \
 		nsHTMLStyleElement.cpp \
 		nsHTMLTableElement.cpp \
 		nsHTMLTableCaptionElement.cpp \
 		nsHTMLTableCellElement.cpp \
 		nsHTMLTableColElement.cpp \
 		nsHTMLTableRowElement.cpp \
 		nsHTMLTableSectionElement.cpp \
 		nsHTMLTextAreaElement.cpp \
-		nsHTMLTitleElement.cpp \
+		HTMLTitleElement.cpp \
 		HTMLUnknownElement.cpp \
 		nsDOMValidityState.cpp \
 		nsIConstraintValidation.cpp \
 		nsRadioVisitor.cpp \
 		nsDOMStringMap.cpp \
 		$(NULL)
 
 ifdef MOZ_MEDIA
deleted file mode 100644
--- a/content/html/content/src/nsHTMLTitleElement.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- 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/. */
-#include "nsIDOMHTMLTitleElement.h"
-#include "nsIDOMEventTarget.h"
-#include "nsGenericHTMLElement.h"
-#include "nsStyleConsts.h"
-#include "nsIDocument.h"
-#include "nsContentUtils.h"
-#include "nsStubMutationObserver.h"
-
-using namespace mozilla::dom;
-
-class nsHTMLTitleElement : public nsGenericHTMLElement,
-                           public nsIDOMHTMLTitleElement,
-                           public nsStubMutationObserver
-{
-public:
-  using Element::GetText;
-  using Element::SetText;
-
-  nsHTMLTitleElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  virtual ~nsHTMLTitleElement();
-
-  // nsISupports
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMNode
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-
-  // nsIDOMElement
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLTitleElement
-  NS_DECL_NSIDOMHTMLTITLEELEMENT
-
-  // nsIMutationObserver
-  NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
-  NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
-  NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
-  NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
-
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
-                              nsIContent *aBindingParent,
-                              bool aCompileEventHandlers);
-
-  virtual void UnbindFromTree(bool aDeep = true,
-                              bool aNullParent = true);
-
-  virtual void DoneAddingChildren(bool aHaveNotified);
-
-  virtual nsXPCClassInfo* GetClassInfo();
-
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-private:
-  void SendTitleChangeEvent(bool aBound);
-};
-
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(Title)
-
-
-nsHTMLTitleElement::nsHTMLTitleElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
-{
-  AddMutationObserver(this);
-}
-
-nsHTMLTitleElement::~nsHTMLTitleElement()
-{
-}
-
-
-NS_IMPL_ADDREF_INHERITED(nsHTMLTitleElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLTitleElement, Element)
-
-
-DOMCI_NODE_DATA(HTMLTitleElement, nsHTMLTitleElement)
-
-// QueryInterface implementation for nsHTMLTitleElement
-NS_INTERFACE_TABLE_HEAD(nsHTMLTitleElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLTitleElement,
-                                   nsIDOMHTMLTitleElement,
-                                   nsIMutationObserver)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTitleElement,
-                                               nsGenericHTMLElement)
-NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTitleElement)
-
-
-NS_IMPL_ELEMENT_CLONE(nsHTMLTitleElement)
-
-
-NS_IMETHODIMP 
-nsHTMLTitleElement::GetText(nsAString& aTitle)
-{
-  nsContentUtils::GetNodeTextContent(this, false, aTitle);
-  return NS_OK;
-}
-
-NS_IMETHODIMP 
-nsHTMLTitleElement::SetText(const nsAString& aTitle)
-{
-  return nsContentUtils::SetNodeTextContent(this, aTitle, true);
-}
-
-void
-nsHTMLTitleElement::CharacterDataChanged(nsIDocument *aDocument,
-                                         nsIContent *aContent,
-                                         CharacterDataChangeInfo *aInfo)
-{
-  SendTitleChangeEvent(false);
-}
-
-void
-nsHTMLTitleElement::ContentAppended(nsIDocument *aDocument,
-                                    nsIContent *aContainer,
-                                    nsIContent *aFirstNewContent,
-                                    int32_t aNewIndexInContainer)
-{
-  SendTitleChangeEvent(false);
-}
-
-void
-nsHTMLTitleElement::ContentInserted(nsIDocument *aDocument,
-                                    nsIContent *aContainer,
-                                    nsIContent *aChild,
-                                    int32_t aIndexInContainer)
-{
-  SendTitleChangeEvent(false);
-}
-
-void
-nsHTMLTitleElement::ContentRemoved(nsIDocument *aDocument,
-                                   nsIContent *aContainer,
-                                   nsIContent *aChild,
-                                   int32_t aIndexInContainer,
-                                   nsIContent *aPreviousSibling)
-{
-  SendTitleChangeEvent(false);
-}
-
-nsresult
-nsHTMLTitleElement::BindToTree(nsIDocument *aDocument,
-                               nsIContent *aParent,
-                               nsIContent *aBindingParent,
-                               bool aCompileEventHandlers)
-{
-  // Let this fall through.
-  nsresult rv = nsGenericHTMLElement::BindToTree(aDocument, aParent,
-                                                 aBindingParent,
-                                                 aCompileEventHandlers);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  SendTitleChangeEvent(true);
-
-  return NS_OK;
-}
-
-void
-nsHTMLTitleElement::UnbindFromTree(bool aDeep, bool aNullParent)
-{
-  SendTitleChangeEvent(false);
-
-  // Let this fall through.
-  nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
-}
-
-void
-nsHTMLTitleElement::DoneAddingChildren(bool aHaveNotified)
-{
-  if (!aHaveNotified) {
-    SendTitleChangeEvent(false);
-  }
-}
-
-void
-nsHTMLTitleElement::SendTitleChangeEvent(bool aBound)
-{
-  nsIDocument* doc = GetCurrentDoc();
-  if (doc) {
-    doc->NotifyPossibleTitleChange(aBound);
-  }
-}