Bug 838532 - Rename nsHTMLLegendElement to HTMLLegendElement. r=Ms2ger

--HG--
rename : content/html/content/src/nsHTMLLegendElement.cpp => content/html/content/src/HTMLLegendElement.cpp
rename : content/html/content/src/nsHTMLLegendElement.h => content/html/content/src/HTMLLegendElement.h
This commit is contained in:
Andrea Marchesini 2013-02-15 11:55:53 -05:00
parent 9a6eb35d02
commit bb88c5ee0d
5 changed files with 64 additions and 59 deletions

View File

@ -99,7 +99,7 @@
#include "xpcpublic.h" #include "xpcpublic.h"
#include "nsCSSRuleProcessor.h" #include "nsCSSRuleProcessor.h"
#include "nsCSSParser.h" #include "nsCSSParser.h"
#include "nsHTMLLegendElement.h" #include "HTMLLegendElement.h"
#include "nsWrapperCacheInlines.h" #include "nsWrapperCacheInlines.h"
#include "WrapperFactory.h" #include "WrapperFactory.h"
#include "DocumentType.h" #include "DocumentType.h"

View File

@ -2,44 +2,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* 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 * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsHTMLLegendElement.h"
#include "mozilla/dom/HTMLLegendElement.h"
#include "nsIDOMHTMLFormElement.h" #include "nsIDOMHTMLFormElement.h"
#include "nsIDOMEventTarget.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsIForm.h"
#include "nsIFormControl.h"
#include "nsIDocument.h"
#include "nsPIDOMWindow.h"
#include "nsFocusManager.h" #include "nsFocusManager.h"
#include "nsIFrame.h" #include "nsIFrame.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMPL_NS_NEW_HTML_ELEMENT(Legend) NS_IMPL_NS_NEW_HTML_ELEMENT(Legend)
DOMCI_NODE_DATA(HTMLLegendElement, mozilla::dom::HTMLLegendElement)
nsHTMLLegendElement::nsHTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo) namespace mozilla {
namespace dom {
HTMLLegendElement::HTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo) : nsGenericHTMLElement(aNodeInfo)
{ {
} }
nsHTMLLegendElement::~nsHTMLLegendElement() HTMLLegendElement::~HTMLLegendElement()
{ {
} }
NS_IMPL_ADDREF_INHERITED(nsHTMLLegendElement, Element) NS_IMPL_ADDREF_INHERITED(HTMLLegendElement, Element)
NS_IMPL_RELEASE_INHERITED(nsHTMLLegendElement, Element) NS_IMPL_RELEASE_INHERITED(HTMLLegendElement, Element)
DOMCI_NODE_DATA(HTMLLegendElement, nsHTMLLegendElement) // QueryInterface implementation for HTMLLegendElement
NS_INTERFACE_TABLE_HEAD(HTMLLegendElement)
// QueryInterface implementation for nsHTMLLegendElement NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLLegendElement, nsIDOMHTMLLegendElement)
NS_INTERFACE_TABLE_HEAD(nsHTMLLegendElement) NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLLegendElement,
NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLLegendElement, nsIDOMHTMLLegendElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLLegendElement,
nsGenericHTMLElement) nsGenericHTMLElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLLegendElement) NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLLegendElement)
@ -47,11 +41,11 @@ NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLLegendElement)
// nsIDOMHTMLLegendElement // nsIDOMHTMLLegendElement
NS_IMPL_ELEMENT_CLONE(nsHTMLLegendElement) NS_IMPL_ELEMENT_CLONE(HTMLLegendElement)
NS_IMETHODIMP NS_IMETHODIMP
nsHTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm) HTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
{ {
Element* form = GetFormElement(); Element* form = GetFormElement();
@ -59,7 +53,7 @@ nsHTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
} }
NS_IMPL_STRING_ATTR(nsHTMLLegendElement, Align, align) NS_IMPL_STRING_ATTR(HTMLLegendElement, Align, align)
// this contains center, because IE4 does // this contains center, because IE4 does
static const nsAttrValue::EnumTable kAlignTable[] = { static const nsAttrValue::EnumTable kAlignTable[] = {
@ -72,7 +66,7 @@ static const nsAttrValue::EnumTable kAlignTable[] = {
}; };
nsIContent* nsIContent*
nsHTMLLegendElement::GetFieldSet() HTMLLegendElement::GetFieldSet()
{ {
nsIContent* parent = GetParent(); nsIContent* parent = GetParent();
@ -84,7 +78,7 @@ nsHTMLLegendElement::GetFieldSet()
} }
bool bool
nsHTMLLegendElement::ParseAttribute(int32_t aNamespaceID, HTMLLegendElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute, nsIAtom* aAttribute,
const nsAString& aValue, const nsAString& aValue,
nsAttrValue& aResult) nsAttrValue& aResult)
@ -98,7 +92,7 @@ nsHTMLLegendElement::ParseAttribute(int32_t aNamespaceID,
} }
nsChangeHint nsChangeHint
nsHTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute, HTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const int32_t aModType) const
{ {
nsChangeHint retval = nsChangeHint retval =
@ -110,7 +104,7 @@ nsHTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
} }
nsresult nsresult
nsHTMLLegendElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute, HTMLLegendElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
nsIAtom* aPrefix, const nsAString& aValue, nsIAtom* aPrefix, const nsAString& aValue,
bool aNotify) bool aNotify)
{ {
@ -118,14 +112,14 @@ nsHTMLLegendElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
aPrefix, aValue, aNotify); aPrefix, aValue, aNotify);
} }
nsresult nsresult
nsHTMLLegendElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute, HTMLLegendElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
bool aNotify) bool aNotify)
{ {
return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify); return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
} }
nsresult nsresult
nsHTMLLegendElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, HTMLLegendElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent, nsIContent* aBindingParent,
bool aCompileEventHandlers) bool aCompileEventHandlers)
{ {
@ -135,13 +129,13 @@ nsHTMLLegendElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
} }
void void
nsHTMLLegendElement::UnbindFromTree(bool aDeep, bool aNullParent) HTMLLegendElement::UnbindFromTree(bool aDeep, bool aNullParent)
{ {
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent); nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
} }
void void
nsHTMLLegendElement::Focus(ErrorResult& aError) HTMLLegendElement::Focus(ErrorResult& aError)
{ {
nsIFrame* frame = GetPrimaryFrame(); nsIFrame* frame = GetPrimaryFrame();
if (!frame) { if (!frame) {
@ -168,11 +162,13 @@ nsHTMLLegendElement::Focus(ErrorResult& aError)
} }
void void
nsHTMLLegendElement::PerformAccesskey(bool aKeyCausesActivation, HTMLLegendElement::PerformAccesskey(bool aKeyCausesActivation,
bool aIsTrustedEvent) bool aIsTrustedEvent)
{ {
// just use the same behaviour as the focus method // just use the same behaviour as the focus method
mozilla::ErrorResult rv; ErrorResult rv;
Focus(rv); Focus(rv);
} }
} // namespace dom
} // namespace mozilla

View File

@ -2,20 +2,24 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* 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 * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsHTMLLegendElement_h___
#define nsHTMLLegendElement_h___ #ifndef mozilla_dom_HTMLLegendElement_h
#define mozilla_dom_HTMLLegendElement_h
#include "nsIDOMHTMLLegendElement.h" #include "nsIDOMHTMLLegendElement.h"
#include "nsGenericHTMLElement.h" #include "nsGenericHTMLElement.h"
class nsHTMLLegendElement : public nsGenericHTMLElement, namespace mozilla {
namespace dom {
class HTMLLegendElement : public nsGenericHTMLElement,
public nsIDOMHTMLLegendElement public nsIDOMHTMLLegendElement
{ {
public: public:
nsHTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo); HTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~nsHTMLLegendElement(); virtual ~HTMLLegendElement();
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(nsHTMLLegendElement, legend) NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLLegendElement, legend)
// nsISupports // nsISupports
NS_DECL_ISUPPORTS_INHERITED NS_DECL_ISUPPORTS_INHERITED
@ -32,7 +36,7 @@ public:
// nsIDOMHTMLElement // nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
virtual void Focus(mozilla::ErrorResult& aError) MOZ_OVERRIDE; virtual void Focus(ErrorResult& aError) MOZ_OVERRIDE;
virtual void PerformAccesskey(bool aKeyCausesActivation, virtual void PerformAccesskey(bool aKeyCausesActivation,
bool aIsTrustedEvent); bool aIsTrustedEvent);
@ -60,9 +64,9 @@ public:
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute, virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
bool aNotify); bool aNotify);
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; virtual nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
mozilla::dom::Element *GetFormElement() Element* GetFormElement()
{ {
nsCOMPtr<nsIFormControl> fieldsetControl = do_QueryInterface(GetFieldSet()); nsCOMPtr<nsIFormControl> fieldsetControl = do_QueryInterface(GetFieldSet());
@ -80,4 +84,7 @@ protected:
nsIContent* GetFieldSet(); nsIContent* GetFieldSet();
}; };
#endif /* nsHTMLLegendElement_h___ */ } // namespace dom
} // namespace mozilla
#endif /* mozilla_dom_HTMLLegendElement_h */

View File

@ -44,6 +44,7 @@ EXPORTS_mozilla/dom = \
HTMLHRElement.h \ HTMLHRElement.h \
HTMLImageElement.h \ HTMLImageElement.h \
HTMLLabelElement.h \ HTMLLabelElement.h \
HTMLLegendElement.h \
HTMLLIElement.h \ HTMLLIElement.h \
HTMLLinkElement.h \ HTMLLinkElement.h \
HTMLMapElement.h \ HTMLMapElement.h \
@ -102,6 +103,7 @@ CPPSRCS = \
HTMLLIElement.cpp \ HTMLLIElement.cpp \
HTMLLabelElement.cpp \ HTMLLabelElement.cpp \
nsHTMLLegendElement.cpp \ nsHTMLLegendElement.cpp \
HTMLLegendElement.cpp \
HTMLLinkElement.cpp \ HTMLLinkElement.cpp \
HTMLMapElement.cpp \ HTMLMapElement.cpp \
nsHTMLMenuElement.cpp \ nsHTMLMenuElement.cpp \

View File

@ -376,7 +376,7 @@
#include "nsIMessageManager.h" #include "nsIMessageManager.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "nsHTMLSelectElement.h" #include "nsHTMLSelectElement.h"
#include "nsHTMLLegendElement.h" #include "HTMLLegendElement.h"
#include "DOMSVGStringList.h" #include "DOMSVGStringList.h"
@ -6798,8 +6798,8 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj,
else { else {
// Legend isn't an HTML form control but should have its fieldset form // Legend isn't an HTML form control but should have its fieldset form
// as scope parent at least for backward compatibility. // as scope parent at least for backward compatibility.
nsHTMLLegendElement *legend = HTMLLegendElement *legend =
nsHTMLLegendElement::FromContent(node->AsElement()); HTMLLegendElement::FromContent(node->AsElement());
if (legend) { if (legend) {
Element *form = legend->GetFormElement(); Element *form = legend->GetFormElement();