mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
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:
parent
9a6eb35d02
commit
bb88c5ee0d
@ -99,7 +99,7 @@
|
||||
#include "xpcpublic.h"
|
||||
#include "nsCSSRuleProcessor.h"
|
||||
#include "nsCSSParser.h"
|
||||
#include "nsHTMLLegendElement.h"
|
||||
#include "HTMLLegendElement.h"
|
||||
#include "nsWrapperCacheInlines.h"
|
||||
#include "WrapperFactory.h"
|
||||
#include "DocumentType.h"
|
||||
|
@ -2,44 +2,38 @@
|
||||
/* 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 "nsHTMLLegendElement.h"
|
||||
|
||||
#include "mozilla/dom/HTMLLegendElement.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 "nsIFrame.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLLegendElement::~nsHTMLLegendElement()
|
||||
HTMLLegendElement::~HTMLLegendElement()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsHTMLLegendElement, Element)
|
||||
NS_IMPL_RELEASE_INHERITED(nsHTMLLegendElement, Element)
|
||||
NS_IMPL_ADDREF_INHERITED(HTMLLegendElement, Element)
|
||||
NS_IMPL_RELEASE_INHERITED(HTMLLegendElement, Element)
|
||||
|
||||
|
||||
DOMCI_NODE_DATA(HTMLLegendElement, nsHTMLLegendElement)
|
||||
|
||||
// QueryInterface implementation for nsHTMLLegendElement
|
||||
NS_INTERFACE_TABLE_HEAD(nsHTMLLegendElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLLegendElement, nsIDOMHTMLLegendElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLLegendElement,
|
||||
// QueryInterface implementation for HTMLLegendElement
|
||||
NS_INTERFACE_TABLE_HEAD(HTMLLegendElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLLegendElement, nsIDOMHTMLLegendElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLLegendElement,
|
||||
nsGenericHTMLElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLLegendElement)
|
||||
|
||||
@ -47,11 +41,11 @@ NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLLegendElement)
|
||||
// nsIDOMHTMLLegendElement
|
||||
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLLegendElement)
|
||||
NS_IMPL_ELEMENT_CLONE(HTMLLegendElement)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
HTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
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
|
||||
static const nsAttrValue::EnumTable kAlignTable[] = {
|
||||
@ -72,7 +66,7 @@ static const nsAttrValue::EnumTable kAlignTable[] = {
|
||||
};
|
||||
|
||||
nsIContent*
|
||||
nsHTMLLegendElement::GetFieldSet()
|
||||
HTMLLegendElement::GetFieldSet()
|
||||
{
|
||||
nsIContent* parent = GetParent();
|
||||
|
||||
@ -84,10 +78,10 @@ nsHTMLLegendElement::GetFieldSet()
|
||||
}
|
||||
|
||||
bool
|
||||
nsHTMLLegendElement::ParseAttribute(int32_t aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult)
|
||||
HTMLLegendElement::ParseAttribute(int32_t aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsGkAtoms::align && aNamespaceID == kNameSpaceID_None) {
|
||||
return aResult.ParseEnumValue(aValue, kAlignTable, false);
|
||||
@ -98,8 +92,8 @@ nsHTMLLegendElement::ParseAttribute(int32_t aNamespaceID,
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
nsHTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
int32_t aModType) const
|
||||
HTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
int32_t aModType) const
|
||||
{
|
||||
nsChangeHint retval =
|
||||
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
|
||||
@ -110,24 +104,24 @@ nsHTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLLegendElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||
nsIAtom* aPrefix, const nsAString& aValue,
|
||||
bool aNotify)
|
||||
HTMLLegendElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||
nsIAtom* aPrefix, const nsAString& aValue,
|
||||
bool aNotify)
|
||||
{
|
||||
return nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute,
|
||||
aPrefix, aValue, aNotify);
|
||||
}
|
||||
nsresult
|
||||
nsHTMLLegendElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||
bool aNotify)
|
||||
HTMLLegendElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||
bool aNotify)
|
||||
{
|
||||
return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLLegendElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
bool aCompileEventHandlers)
|
||||
HTMLLegendElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
bool aCompileEventHandlers)
|
||||
{
|
||||
return nsGenericHTMLElement::BindToTree(aDocument, aParent,
|
||||
aBindingParent,
|
||||
@ -135,13 +129,13 @@ nsHTMLLegendElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLLegendElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
HTMLLegendElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
{
|
||||
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLLegendElement::Focus(ErrorResult& aError)
|
||||
HTMLLegendElement::Focus(ErrorResult& aError)
|
||||
{
|
||||
nsIFrame* frame = GetPrimaryFrame();
|
||||
if (!frame) {
|
||||
@ -168,11 +162,13 @@ nsHTMLLegendElement::Focus(ErrorResult& aError)
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLLegendElement::PerformAccesskey(bool aKeyCausesActivation,
|
||||
bool aIsTrustedEvent)
|
||||
HTMLLegendElement::PerformAccesskey(bool aKeyCausesActivation,
|
||||
bool aIsTrustedEvent)
|
||||
{
|
||||
// just use the same behaviour as the focus method
|
||||
mozilla::ErrorResult rv;
|
||||
ErrorResult rv;
|
||||
Focus(rv);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
@ -2,20 +2,24 @@
|
||||
/* 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 nsHTMLLegendElement_h___
|
||||
#define nsHTMLLegendElement_h___
|
||||
|
||||
#ifndef mozilla_dom_HTMLLegendElement_h
|
||||
#define mozilla_dom_HTMLLegendElement_h
|
||||
|
||||
#include "nsIDOMHTMLLegendElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
class nsHTMLLegendElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLLegendElement
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLLegendElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLLegendElement
|
||||
{
|
||||
public:
|
||||
nsHTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
virtual ~nsHTMLLegendElement();
|
||||
HTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
virtual ~HTMLLegendElement();
|
||||
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(nsHTMLLegendElement, legend)
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLLegendElement, legend)
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
@ -32,7 +36,7 @@ public:
|
||||
// nsIDOMHTMLElement
|
||||
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,
|
||||
bool aIsTrustedEvent);
|
||||
@ -60,9 +64,9 @@ public:
|
||||
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
||||
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());
|
||||
|
||||
@ -80,4 +84,7 @@ protected:
|
||||
nsIContent* GetFieldSet();
|
||||
};
|
||||
|
||||
#endif /* nsHTMLLegendElement_h___ */
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* mozilla_dom_HTMLLegendElement_h */
|
@ -44,6 +44,7 @@ EXPORTS_mozilla/dom = \
|
||||
HTMLHRElement.h \
|
||||
HTMLImageElement.h \
|
||||
HTMLLabelElement.h \
|
||||
HTMLLegendElement.h \
|
||||
HTMLLIElement.h \
|
||||
HTMLLinkElement.h \
|
||||
HTMLMapElement.h \
|
||||
@ -102,6 +103,7 @@ CPPSRCS = \
|
||||
HTMLLIElement.cpp \
|
||||
HTMLLabelElement.cpp \
|
||||
nsHTMLLegendElement.cpp \
|
||||
HTMLLegendElement.cpp \
|
||||
HTMLLinkElement.cpp \
|
||||
HTMLMapElement.cpp \
|
||||
nsHTMLMenuElement.cpp \
|
||||
|
@ -376,7 +376,7 @@
|
||||
#include "nsIMessageManager.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsHTMLSelectElement.h"
|
||||
#include "nsHTMLLegendElement.h"
|
||||
#include "HTMLLegendElement.h"
|
||||
|
||||
#include "DOMSVGStringList.h"
|
||||
|
||||
@ -6798,8 +6798,8 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj,
|
||||
else {
|
||||
// Legend isn't an HTML form control but should have its fieldset form
|
||||
// as scope parent at least for backward compatibility.
|
||||
nsHTMLLegendElement *legend =
|
||||
nsHTMLLegendElement::FromContent(node->AsElement());
|
||||
HTMLLegendElement *legend =
|
||||
HTMLLegendElement::FromContent(node->AsElement());
|
||||
if (legend) {
|
||||
Element *form = legend->GetFormElement();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user