mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Bug 838559 - Rename nsHTMLMenuElement to HTMLMenuElement. r=Ms2ger
--HG-- rename : content/html/content/src/nsHTMLMenuElement.cpp => content/html/content/src/HTMLMenuElement.cpp rename : content/html/content/src/nsHTMLMenuElement.h => content/html/content/src/HTMLMenuElement.h
This commit is contained in:
parent
e271b976c7
commit
71614f79e4
@ -3,17 +3,17 @@
|
||||
* 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 "nsHTMLMenuElement.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsIDOMHTMLMenuItemElement.h"
|
||||
#include "HTMLMenuElement.h"
|
||||
#include "nsXULContextMenuBuilder.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "HTMLMenuItemElement.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsError.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Menu)
|
||||
DOMCI_NODE_DATA(HTMLMenuElement, mozilla::dom::HTMLMenuElement)
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
enum MenuType
|
||||
{
|
||||
@ -39,44 +39,41 @@ enum SeparatorType
|
||||
ST_TRUE = 1
|
||||
};
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Menu)
|
||||
|
||||
|
||||
nsHTMLMenuElement::nsHTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
HTMLMenuElement::HTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo), mType(MENU_TYPE_LIST)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLMenuElement::~nsHTMLMenuElement()
|
||||
HTMLMenuElement::~HTMLMenuElement()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsHTMLMenuElement, Element)
|
||||
NS_IMPL_RELEASE_INHERITED(nsHTMLMenuElement, Element)
|
||||
NS_IMPL_ADDREF_INHERITED(HTMLMenuElement, Element)
|
||||
NS_IMPL_RELEASE_INHERITED(HTMLMenuElement, Element)
|
||||
|
||||
|
||||
DOMCI_NODE_DATA(HTMLMenuElement, nsHTMLMenuElement)
|
||||
|
||||
// QueryInterface implementation for nsHTMLMenuElement
|
||||
NS_INTERFACE_TABLE_HEAD(nsHTMLMenuElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLMenuElement,
|
||||
// QueryInterface implementation for HTMLMenuElement
|
||||
NS_INTERFACE_TABLE_HEAD(HTMLMenuElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE2(HTMLMenuElement,
|
||||
nsIDOMHTMLMenuElement,
|
||||
nsIHTMLMenu)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLMenuElement,
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLMenuElement,
|
||||
nsGenericHTMLElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLMenuElement)
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLMenuElement)
|
||||
NS_IMPL_ELEMENT_CLONE(HTMLMenuElement)
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLMenuElement, Compact, compact)
|
||||
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLMenuElement, Type, type,
|
||||
NS_IMPL_BOOL_ATTR(HTMLMenuElement, Compact, compact)
|
||||
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLMenuElement, Type, type,
|
||||
kMenuDefaultType->tag)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMenuElement, Label, label)
|
||||
NS_IMPL_STRING_ATTR(HTMLMenuElement, Label, label)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenuElement::SendShowEvent()
|
||||
HTMLMenuElement::SendShowEvent()
|
||||
{
|
||||
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
|
||||
|
||||
@ -103,7 +100,7 @@ nsHTMLMenuElement::SendShowEvent()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenuElement::CreateBuilder(nsIMenuBuilder** _retval)
|
||||
HTMLMenuElement::CreateBuilder(nsIMenuBuilder** _retval)
|
||||
{
|
||||
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
|
||||
|
||||
@ -118,7 +115,7 @@ nsHTMLMenuElement::CreateBuilder(nsIMenuBuilder** _retval)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenuElement::Build(nsIMenuBuilder* aBuilder)
|
||||
HTMLMenuElement::Build(nsIMenuBuilder* aBuilder)
|
||||
{
|
||||
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
|
||||
|
||||
@ -133,10 +130,10 @@ nsHTMLMenuElement::Build(nsIMenuBuilder* aBuilder)
|
||||
|
||||
|
||||
bool
|
||||
nsHTMLMenuElement::ParseAttribute(int32_t aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult)
|
||||
HTMLMenuElement::ParseAttribute(int32_t aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult)
|
||||
{
|
||||
if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type) {
|
||||
bool success = aResult.ParseEnumValue(aValue, kMenuTypeTable,
|
||||
@ -155,9 +152,9 @@ nsHTMLMenuElement::ParseAttribute(int32_t aNamespaceID,
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLMenuElement::BuildSubmenu(const nsAString& aLabel,
|
||||
nsIContent* aContent,
|
||||
nsIMenuBuilder* aBuilder)
|
||||
HTMLMenuElement::BuildSubmenu(const nsAString& aLabel,
|
||||
nsIContent* aContent,
|
||||
nsIMenuBuilder* aBuilder)
|
||||
{
|
||||
aBuilder->OpenContainer(aLabel);
|
||||
|
||||
@ -173,7 +170,7 @@ nsHTMLMenuElement::BuildSubmenu(const nsAString& aLabel,
|
||||
|
||||
// static
|
||||
bool
|
||||
nsHTMLMenuElement::CanLoadIcon(nsIContent* aContent, const nsAString& aIcon)
|
||||
HTMLMenuElement::CanLoadIcon(nsIContent* aContent, const nsAString& aIcon)
|
||||
{
|
||||
if (aIcon.IsEmpty()) {
|
||||
return false;
|
||||
@ -195,9 +192,9 @@ nsHTMLMenuElement::CanLoadIcon(nsIContent* aContent, const nsAString& aIcon)
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLMenuElement::TraverseContent(nsIContent* aContent,
|
||||
nsIMenuBuilder* aBuilder,
|
||||
int8_t& aSeparator)
|
||||
HTMLMenuElement::TraverseContent(nsIContent* aContent,
|
||||
nsIMenuBuilder* aBuilder,
|
||||
int8_t& aSeparator)
|
||||
{
|
||||
nsCOMPtr<nsIContent> child;
|
||||
for (child = aContent->GetFirstChild(); child;
|
||||
@ -248,7 +245,7 @@ nsHTMLMenuElement::TraverseContent(nsIContent* aContent,
|
||||
}
|
||||
|
||||
inline void
|
||||
nsHTMLMenuElement::AddSeparator(nsIMenuBuilder* aBuilder, int8_t& aSeparator)
|
||||
HTMLMenuElement::AddSeparator(nsIMenuBuilder* aBuilder, int8_t& aSeparator)
|
||||
{
|
||||
if (aSeparator) {
|
||||
return;
|
||||
@ -257,3 +254,6 @@ nsHTMLMenuElement::AddSeparator(nsIMenuBuilder* aBuilder, int8_t& aSeparator)
|
||||
aBuilder->AddSeparator();
|
||||
aSeparator = ST_TRUE;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
@ -3,19 +3,25 @@
|
||||
* 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_HTMLMenuElement_h
|
||||
#define mozilla_dom_HTMLMenuElement_h
|
||||
|
||||
#include "nsIDOMHTMLMenuElement.h"
|
||||
#include "nsIHTMLMenu.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
class nsHTMLMenuElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLMenuElement,
|
||||
public nsIHTMLMenu
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class HTMLMenuElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLMenuElement,
|
||||
public nsIHTMLMenu
|
||||
{
|
||||
public:
|
||||
nsHTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
virtual ~nsHTMLMenuElement();
|
||||
HTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
virtual ~HTMLMenuElement();
|
||||
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(nsHTMLMenuElement, menu)
|
||||
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLMenuElement, menu)
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
@ -63,3 +69,8 @@ protected:
|
||||
|
||||
uint8_t mType;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_HTMLMenuElement_h
|
@ -49,6 +49,7 @@ EXPORTS_mozilla/dom = \
|
||||
HTMLLIElement.h \
|
||||
HTMLLinkElement.h \
|
||||
HTMLMapElement.h \
|
||||
HTMLMenuElement.h \
|
||||
HTMLMenuItemElement.h \
|
||||
HTMLMetaElement.h \
|
||||
HTMLMeterElement.h \
|
||||
@ -107,7 +108,7 @@ CPPSRCS = \
|
||||
HTMLLegendElement.cpp \
|
||||
HTMLLinkElement.cpp \
|
||||
HTMLMapElement.cpp \
|
||||
nsHTMLMenuElement.cpp \
|
||||
HTMLMenuElement.cpp \
|
||||
HTMLMenuItemElement.cpp \
|
||||
HTMLMetaElement.cpp \
|
||||
HTMLMeterElement.cpp \
|
||||
|
@ -80,7 +80,7 @@
|
||||
#include "nsITextControlElement.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "HTMLFieldSetElement.h"
|
||||
#include "nsHTMLMenuElement.h"
|
||||
#include "HTMLMenuElement.h"
|
||||
#include "nsAsyncDOMEvent.h"
|
||||
#include "nsDOMMutationObserver.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
@ -2055,7 +2055,7 @@ nsGenericHTMLElement::GetEnumAttr(nsIAtom* aAttr,
|
||||
}
|
||||
}
|
||||
|
||||
nsHTMLMenuElement*
|
||||
HTMLMenuElement*
|
||||
nsGenericHTMLElement::GetContextMenu() const
|
||||
{
|
||||
nsAutoString value;
|
||||
@ -2063,7 +2063,7 @@ nsGenericHTMLElement::GetContextMenu() const
|
||||
if (!value.IsEmpty()) {
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (doc) {
|
||||
return nsHTMLMenuElement::FromContentOrNull(doc->GetElementById(value));
|
||||
return HTMLMenuElement::FromContentOrNull(doc->GetElementById(value));
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -23,7 +23,6 @@ class nsIFrame;
|
||||
class nsIStyleRule;
|
||||
class nsChildContentList;
|
||||
class nsDOMCSSDeclaration;
|
||||
class nsHTMLMenuElement;
|
||||
class nsIDOMCSSStyleDeclaration;
|
||||
class nsIURI;
|
||||
class nsIFormControlFrame;
|
||||
@ -41,6 +40,7 @@ class nsDOMSettableTokenList;
|
||||
namespace mozilla {
|
||||
namespace dom{
|
||||
class HTMLPropertiesCollection;
|
||||
class HTMLMenuElement;
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ public:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
nsHTMLMenuElement* GetContextMenu() const;
|
||||
mozilla::dom::HTMLMenuElement* GetContextMenu() const;
|
||||
bool Spellcheck();
|
||||
void SetSpellcheck(bool aSpellcheck, mozilla::ErrorResult& aError)
|
||||
{
|
||||
|
@ -1177,7 +1177,7 @@ def addExternalHTMLElement(element):
|
||||
headerFile=nativeElement + '.h')
|
||||
|
||||
addExternalHTMLElement('HTMLFormElement')
|
||||
addExternalHTMLElement('HTMLMenuElement')
|
||||
addExternalIface('HTMLMenuElement', nativeType='mozilla::dom::HTMLMenuElement', headerFile='HTMLMenuElement.h')
|
||||
addExternalHTMLElement('HTMLOptionElement')
|
||||
addExternalHTMLElement('HTMLVideoElement')
|
||||
addExternalIface('Attr')
|
||||
|
@ -297,7 +297,7 @@ irregularFilenames = {
|
||||
|
||||
customIncludes = [
|
||||
'nsDOMQS.h',
|
||||
'nsHTMLMenuElement.h',
|
||||
'HTMLMenuElement.h',
|
||||
'mozilla/dom/NodeBinding.h',
|
||||
'mozilla/dom/ElementBinding.h',
|
||||
'mozilla/dom/HTMLElementBinding.h',
|
||||
|
Loading…
x
Reference in New Issue
Block a user