Bug 839056 - Rename nsHTMLOptGroupElement to HTMLOptGroupElement. r=Ms2ger
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 08 Feb 2013 11:34:48 -0500
changeset 131216 3b7d82d4dbd235a851a72a6d1b29fbe28763f6ea
parent 131215 f2ece1151f003665ade62a255f05c50223ef0f28
child 131217 de145c9d52ae0c7a3f011f077f23d2491ffe08ad
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs839056
milestone21.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 839056 - Rename nsHTMLOptGroupElement to HTMLOptGroupElement. r=Ms2ger
content/html/content/src/HTMLOptGroupElement.cpp
content/html/content/src/HTMLOptGroupElement.h
content/html/content/src/Makefile.in
content/html/content/src/nsHTMLOptGroupElement.cpp
content/html/content/src/nsHTMLOptGroupElement.h
content/html/content/src/nsHTMLSelectElement.h
dom/bindings/Bindings.conf
js/xpconnect/src/nsDOMQS.h
rename from content/html/content/src/nsHTMLOptGroupElement.cpp
rename to content/html/content/src/HTMLOptGroupElement.cpp
--- a/content/html/content/src/nsHTMLOptGroupElement.cpp
+++ b/content/html/content/src/HTMLOptGroupElement.cpp
@@ -1,68 +1,71 @@
 /* -*- 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 "nsHTMLOptGroupElement.h"
+
+#include "mozilla/dom/HTMLOptGroupElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsIFrame.h"
 #include "nsIFormControlFrame.h"
 #include "nsEventStates.h"
 
 #include "nsEventDispatcher.h"
 #include "nsHTMLSelectElement.h"
 
-using namespace mozilla::dom;
+NS_IMPL_NS_NEW_HTML_ELEMENT(OptGroup)
+DOMCI_NODE_DATA(HTMLOptGroupElement, mozilla::dom::HTMLOptGroupElement)
+
+namespace mozilla {
+namespace dom {
 
 /**
  * The implementation of &lt;optgroup&gt;
  */
 
-NS_IMPL_NS_NEW_HTML_ELEMENT(OptGroup)
 
 
-nsHTMLOptGroupElement::nsHTMLOptGroupElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+HTMLOptGroupElement::HTMLOptGroupElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
   // We start off enabled
   AddStatesSilently(NS_EVENT_STATE_ENABLED);
 }
 
-nsHTMLOptGroupElement::~nsHTMLOptGroupElement()
+HTMLOptGroupElement::~HTMLOptGroupElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLOptGroupElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLOptGroupElement, Element)
+NS_IMPL_ADDREF_INHERITED(HTMLOptGroupElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLOptGroupElement, Element)
+
 
 
-DOMCI_NODE_DATA(HTMLOptGroupElement, nsHTMLOptGroupElement)
-
-// QueryInterface implementation for nsHTMLOptGroupElement
-NS_INTERFACE_TABLE_HEAD(nsHTMLOptGroupElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLOptGroupElement,
+// QueryInterface implementation for HTMLOptGroupElement
+NS_INTERFACE_TABLE_HEAD(HTMLOptGroupElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLOptGroupElement,
                                    nsIDOMHTMLOptGroupElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLOptGroupElement,
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLOptGroupElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLOptGroupElement)
 
 
-NS_IMPL_ELEMENT_CLONE(nsHTMLOptGroupElement)
+NS_IMPL_ELEMENT_CLONE(HTMLOptGroupElement)
 
 
-NS_IMPL_BOOL_ATTR(nsHTMLOptGroupElement, Disabled, disabled)
-NS_IMPL_STRING_ATTR(nsHTMLOptGroupElement, Label, label)
+NS_IMPL_BOOL_ATTR(HTMLOptGroupElement, Disabled, disabled)
+NS_IMPL_STRING_ATTR(HTMLOptGroupElement, Label, label)
 
 
 nsresult
-nsHTMLOptGroupElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
+HTMLOptGroupElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
 {
   aVisitor.mCanHandle = false;
   // Do not process any DOM events if the element is disabled
   // XXXsmaug This is not the right thing to do. But what is?
   if (HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) {
     return NS_OK;
   }
 
@@ -74,55 +77,55 @@ nsHTMLOptGroupElement::PreHandleEvent(ns
       return NS_OK;
     }
   }
 
   return nsGenericHTMLElement::PreHandleEvent(aVisitor);
 }
 
 nsIContent*
-nsHTMLOptGroupElement::GetSelect()
+HTMLOptGroupElement::GetSelect()
 {
   nsIContent* parent = this;
   while ((parent = parent->GetParent()) && parent->IsHTML()) {
     if (parent->Tag() == nsGkAtoms::select) {
       return parent;
     }
     if (parent->Tag() != nsGkAtoms::optgroup) {
       break;
     }
   }
   
   return nullptr;
 }
 
 nsresult
-nsHTMLOptGroupElement::InsertChildAt(nsIContent* aKid,
-                                     uint32_t aIndex,
-                                     bool aNotify)
+HTMLOptGroupElement::InsertChildAt(nsIContent* aKid,
+                                   uint32_t aIndex,
+                                   bool aNotify)
 {
   nsSafeOptionListMutation safeMutation(GetSelect(), this, aKid, aIndex, aNotify);
   nsresult rv = nsGenericHTMLElement::InsertChildAt(aKid, aIndex, aNotify);
   if (NS_FAILED(rv)) {
     safeMutation.MutationFailed();
   }
   return rv;
 }
 
 void
-nsHTMLOptGroupElement::RemoveChildAt(uint32_t aIndex, bool aNotify)
+HTMLOptGroupElement::RemoveChildAt(uint32_t aIndex, bool aNotify)
 {
   nsSafeOptionListMutation safeMutation(GetSelect(), this, nullptr, aIndex,
                                         aNotify);
   nsGenericHTMLElement::RemoveChildAt(aIndex, aNotify);
 }
 
 nsresult
-nsHTMLOptGroupElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-                                    const nsAttrValue* aValue, bool aNotify)
+HTMLOptGroupElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
+                                  const nsAttrValue* aValue, bool aNotify)
 {
   if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::disabled) {
     // All our children <option> have their :disabled state depending on our
     // disabled attribute. We should make sure their state is updated.
     for (nsIContent* child = nsINode::GetFirstChild(); child;
          child = child->GetNextSibling()) {
       if (child->IsHTML(nsGkAtoms::option)) {
         // No need to call |IsElement()| because it's an HTML element.
@@ -131,22 +134,25 @@ nsHTMLOptGroupElement::AfterSetAttr(int3
     }
   }
 
   return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
                                             aNotify);
 }
 
 nsEventStates
-nsHTMLOptGroupElement::IntrinsicState() const
+HTMLOptGroupElement::IntrinsicState() const
 {
   nsEventStates state = nsGenericHTMLElement::IntrinsicState();
 
   if (HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) {
     state |= NS_EVENT_STATE_DISABLED;
     state &= ~NS_EVENT_STATE_ENABLED;
   } else {
     state &= ~NS_EVENT_STATE_DISABLED;
     state |= NS_EVENT_STATE_ENABLED;
   }
 
   return state;
 }
+
+} // namespace dom
+} // namespace mozilla
rename from content/html/content/src/nsHTMLOptGroupElement.h
rename to content/html/content/src/HTMLOptGroupElement.h
--- a/content/html/content/src/nsHTMLOptGroupElement.h
+++ b/content/html/content/src/HTMLOptGroupElement.h
@@ -1,25 +1,28 @@
 /* -*- 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 nsGenericHTMLElement_h
-#define nsGenericHTMLElement_h
+#ifndef mozilla_dom_HTMLOptGroupElement_h
+#define mozilla_dom_HTMLOptGroupElement_h
 
 #include "nsIDOMHTMLOptGroupElement.h"
 #include "nsGenericHTMLElement.h"
 
-class nsHTMLOptGroupElement : public nsGenericHTMLElement,
-                              public nsIDOMHTMLOptGroupElement
+namespace mozilla {
+namespace dom {
+
+class HTMLOptGroupElement : public nsGenericHTMLElement,
+                            public nsIDOMHTMLOptGroupElement
 {
 public:
-  nsHTMLOptGroupElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  virtual ~nsHTMLOptGroupElement();
+  HTMLOptGroupElement(already_AddRefed<nsINodeInfo> aNodeInfo);
+  virtual ~HTMLOptGroupElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
@@ -36,17 +39,17 @@ public:
                                  bool aNotify);
   virtual void RemoveChildAt(uint32_t aIndex, bool aNotify);
 
   // nsIContent
   virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
 
   virtual nsEventStates IntrinsicState() const;
  
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                                 const nsAttrValue* aValue, bool aNotify);
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
@@ -57,9 +60,12 @@ protected:
 
   /**
    * Get the select content element that contains this option
    * @param aSelectElement the select element [OUT]
    */
   nsIContent* GetSelect();
 };
 
-#endif /* nsGenericHTMLElement_h */
+} // namespace dom
+} // namespace mozilla
+
+#endif /* mozilla_dom_HTMLOptGroupElement_h */
--- a/content/html/content/src/Makefile.in
+++ b/content/html/content/src/Makefile.in
@@ -44,16 +44,17 @@ EXPORTS_mozilla/dom = \
 		HTMLImageElement.h \
 		HTMLLabelElement.h \
 		HTMLLIElement.h \
 		HTMLLinkElement.h \
 		HTMLMapElement.h \
 		HTMLMetaElement.h \
 		HTMLMeterElement.h \
 		HTMLModElement.h \
+		HTMLOptGroupElement.h \
 		HTMLParagraphElement.h \
 		HTMLPreElement.h \
 		HTMLScriptElement.h \
 		HTMLSharedElement.h \
 		HTMLSharedListElement.h \
 		HTMLSpanElement.h \
 		HTMLStyleElement.h \
 		HTMLTableCaptionElement.h \
@@ -103,17 +104,17 @@ CPPSRCS		= \
 		nsHTMLMenuElement.cpp \
 		nsHTMLMenuItemElement.cpp \
 		HTMLMetaElement.cpp \
 		HTMLMeterElement.cpp \
 		HTMLModElement.cpp \
 		HTMLObjectElement.cpp \
 		nsHTMLSharedObjectElement.cpp \
 		nsHTMLOptionElement.cpp \
-		nsHTMLOptGroupElement.cpp \
+		HTMLOptGroupElement.cpp \
 		nsHTMLOutputElement.cpp \
 		HTMLParagraphElement.cpp \
 		HTMLPreElement.cpp \
 		nsHTMLProgressElement.cpp \
 		HTMLScriptElement.cpp \
 		nsHTMLSelectElement.cpp \
 		HTMLSharedElement.cpp \
 		HTMLSharedListElement.cpp \
--- a/content/html/content/src/nsHTMLSelectElement.h
+++ b/content/html/content/src/nsHTMLSelectElement.h
@@ -18,17 +18,17 @@
 #include "nsIConstraintValidation.h"
 
 // PresState
 #include "nsXPCOM.h"
 #include "nsPresState.h"
 #include "nsIComponentManager.h"
 #include "nsCheapSets.h"
 #include "nsError.h"
-#include "nsHTMLOptGroupElement.h"
+#include "HTMLOptGroupElement.h"
 #include "nsHTMLOptionElement.h"
 #include "nsHTMLFormElement.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/UnionTypes.h"
 
 class nsHTMLSelectElement;
 
 /**
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1282,17 +1282,17 @@ def addExternalIface(iface, nativeType=N
 def addExternalHTMLElement(element):
    nativeElement = 'ns' + element
    addExternalIface(element, nativeType=nativeElement,
                     headerFile=nativeElement + '.h')
 
 addExternalHTMLElement('HTMLFormElement')
 addExternalHTMLElement('HTMLMenuElement')
 addExternalHTMLElement('HTMLOptionElement')
-addExternalHTMLElement('HTMLOptGroupElement')
+addExternalIface('HTMLOptGroupElement', nativeType='mozilla::dom::HTMLOptGroupElement', headerFile='HTMLOptGroupElement.h')
 addExternalHTMLElement('HTMLVideoElement')
 addExternalIface('Attr')
 addExternalIface('CanvasGradient', headerFile='nsIDOMCanvasRenderingContext2D.h')
 addExternalIface('CanvasPattern', headerFile='nsIDOMCanvasRenderingContext2D.h')
 addExternalIface('ClientRect')
 addExternalIface("Counter")
 addExternalIface('CSSRule')
 addExternalIface('DOMRequest')
--- a/js/xpconnect/src/nsDOMQS.h
+++ b/js/xpconnect/src/nsDOMQS.h
@@ -6,17 +6,17 @@
 #define nsDOMQS_h__
 
 #include "nsDOMClassInfoID.h"
 #include "nsGenericHTMLElement.h"
 #include "mozilla/dom/HTMLCanvasElement.h"
 #include "nsHTMLFormElement.h"
 #include "mozilla/dom/HTMLImageElement.h"
 #include "nsHTMLOptionElement.h"
-#include "nsHTMLOptGroupElement.h"
+#include "HTMLOptGroupElement.h"
 #include "nsHTMLVideoElement.h"
 #include "nsHTMLDocument.h"
 #include "nsICSSDeclaration.h"
 #include "nsSVGElement.h"
 #include "mozilla/dom/EventTargetBinding.h"
 #include "mozilla/dom/NodeBinding.h"
 #include "mozilla/dom/ElementBinding.h"
 #include "mozilla/dom/HTMLElementBinding.h"
@@ -166,17 +166,17 @@ xpc_qsUnwrapArg<_clazz>(JSContext *cx, j
     nsresult rv = xpc_qsUnwrapArg<_clazz>(cx, v, ppArg, &argRef, vp);         \
     *ppArgRef = static_cast<_clazz*>(static_cast<nsIContent*>(argRef));       \
     return rv;                                                                \
 }
 
 DEFINE_UNWRAP_CAST_HTML(canvas, mozilla::dom::HTMLCanvasElement)
 DEFINE_UNWRAP_CAST_HTML(form, nsHTMLFormElement)
 DEFINE_UNWRAP_CAST_HTML(img, mozilla::dom::HTMLImageElement)
-DEFINE_UNWRAP_CAST_HTML(optgroup, nsHTMLOptGroupElement)
+DEFINE_UNWRAP_CAST_HTML(optgroup, mozilla::dom::HTMLOptGroupElement)
 DEFINE_UNWRAP_CAST_HTML(option, nsHTMLOptionElement)
 DEFINE_UNWRAP_CAST_HTML(video, nsHTMLVideoElement)
 
 inline nsISupports*
 ToSupports(nsContentList *p)
 {
     return static_cast<nsINodeList*>(p);
 }