Backed out changesets 34927afb65e2 and 2d0b056ced49 (bug 838559) for mochitest failures.

--HG--
rename : content/html/content/src/HTMLMenuElement.cpp => content/html/content/src/nsHTMLMenuElement.cpp
rename : content/html/content/src/HTMLMenuElement.h => content/html/content/src/nsHTMLMenuElement.h
This commit is contained in:
Ryan VanderMeulen 2013-02-06 16:22:59 -05:00
parent 19ef17ae95
commit 40bf57c1b6
10 changed files with 52 additions and 132 deletions

View File

@ -41,7 +41,6 @@ EXPORTS_mozilla/dom = \
HTMLImageElement.h \
HTMLLabelElement.h \
HTMLLIElement.h \
HTMLMenuElement.h \
HTMLParagraphElement.h \
HTMLPreElement.h \
HTMLScriptElement.h \
@ -92,7 +91,7 @@ CPPSRCS = \
nsHTMLLegendElement.cpp \
nsHTMLLinkElement.cpp \
nsHTMLMapElement.cpp \
HTMLMenuElement.cpp \
nsHTMLMenuElement.cpp \
nsHTMLMenuItemElement.cpp \
nsHTMLMetaElement.cpp \
nsHTMLMeterElement.cpp \

View File

@ -81,7 +81,7 @@
#include "nsITextControlElement.h"
#include "mozilla/dom/Element.h"
#include "nsHTMLFieldSetElement.h"
#include "HTMLMenuElement.h"
#include "nsHTMLMenuElement.h"
#include "nsAsyncDOMEvent.h"
#include "nsDOMMutationObserver.h"
#include "mozilla/Preferences.h"
@ -2056,7 +2056,7 @@ nsGenericHTMLElement::GetEnumAttr(nsIAtom* aAttr,
}
}
HTMLMenuElement*
nsHTMLMenuElement*
nsGenericHTMLElement::GetContextMenu() const
{
nsAutoString value;
@ -2064,7 +2064,7 @@ nsGenericHTMLElement::GetContextMenu() const
if (!value.IsEmpty()) {
nsIDocument* doc = GetCurrentDoc();
if (doc) {
return HTMLMenuElement::FromContentOrNull(doc->GetElementById(value));
return nsHTMLMenuElement::FromContentOrNull(doc->GetElementById(value));
}
}
return nullptr;

View File

@ -23,6 +23,7 @@ class nsIFrame;
class nsIStyleRule;
class nsChildContentList;
class nsDOMCSSDeclaration;
class nsHTMLMenuElement;
class nsIDOMCSSStyleDeclaration;
class nsIURI;
class nsIFormControlFrame;
@ -40,7 +41,6 @@ class nsDOMSettableTokenList;
namespace mozilla {
namespace dom{
class HTMLPropertiesCollection;
class HTMLMenuElement;
}
}
@ -220,7 +220,7 @@ public:
}
return false;
}
mozilla::dom::HTMLMenuElement* GetContextMenu() const;
nsHTMLMenuElement* GetContextMenu() const;
bool Spellcheck();
void SetSpellcheck(bool aSpellcheck, mozilla::ErrorResult& aError)
{

View File

@ -3,18 +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 "HTMLMenuElement.h"
#include "mozilla/dom/HTMLMenuElementBinding.h"
#include "nsHTMLMenuElement.h"
#include "nsAttrValueInlines.h"
#include "nsIDOMHTMLMenuItemElement.h"
#include "nsXULContextMenuBuilder.h"
#include "nsGUIEvent.h"
#include "nsEventDispatcher.h"
#include "nsHTMLMenuItemElement.h"
#include "nsAttrValueInlines.h"
#include "nsContentUtils.h"
#include "nsError.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Menu)
DOMCI_NODE_DATA(HTMLMenuElement, mozilla::dom::HTMLMenuElement)
namespace mozilla {
namespace dom {
using namespace mozilla::dom;
enum MenuType
{
@ -40,42 +39,44 @@ enum SeparatorType
ST_TRUE = 1
};
NS_IMPL_NS_NEW_HTML_ELEMENT(Menu)
HTMLMenuElement::HTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo)
nsHTMLMenuElement::nsHTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLElement(aNodeInfo), mType(MENU_TYPE_LIST)
{
SetIsDOMBinding();
}
HTMLMenuElement::~HTMLMenuElement()
nsHTMLMenuElement::~nsHTMLMenuElement()
{
}
NS_IMPL_ADDREF_INHERITED(HTMLMenuElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLMenuElement, Element)
NS_IMPL_ADDREF_INHERITED(nsHTMLMenuElement, Element)
NS_IMPL_RELEASE_INHERITED(nsHTMLMenuElement, Element)
// QueryInterface implementation for HTMLMenuElement
NS_INTERFACE_TABLE_HEAD(HTMLMenuElement)
NS_HTML_CONTENT_INTERFACE_TABLE2(HTMLMenuElement,
DOMCI_NODE_DATA(HTMLMenuElement, nsHTMLMenuElement)
// QueryInterface implementation for nsHTMLMenuElement
NS_INTERFACE_TABLE_HEAD(nsHTMLMenuElement)
NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLMenuElement,
nsIDOMHTMLMenuElement,
nsIHTMLMenu)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLMenuElement,
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLMenuElement,
nsGenericHTMLElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLMenuElement)
NS_IMPL_ELEMENT_CLONE(HTMLMenuElement)
NS_IMPL_ELEMENT_CLONE(nsHTMLMenuElement)
NS_IMPL_BOOL_ATTR(HTMLMenuElement, Compact, compact)
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLMenuElement, Type, type,
NS_IMPL_BOOL_ATTR(nsHTMLMenuElement, Compact, compact)
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLMenuElement, Type, type,
kMenuDefaultType->tag)
NS_IMPL_STRING_ATTR(HTMLMenuElement, Label, label)
NS_IMPL_STRING_ATTR(nsHTMLMenuElement, Label, label)
NS_IMETHODIMP
HTMLMenuElement::SendShowEvent()
nsHTMLMenuElement::SendShowEvent()
{
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
@ -102,7 +103,7 @@ HTMLMenuElement::SendShowEvent()
}
NS_IMETHODIMP
HTMLMenuElement::CreateBuilder(nsIMenuBuilder** _retval)
nsHTMLMenuElement::CreateBuilder(nsIMenuBuilder** _retval)
{
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
@ -117,7 +118,7 @@ HTMLMenuElement::CreateBuilder(nsIMenuBuilder** _retval)
NS_IMETHODIMP
HTMLMenuElement::Build(nsIMenuBuilder* aBuilder)
nsHTMLMenuElement::Build(nsIMenuBuilder* aBuilder)
{
NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_DOM_SECURITY_ERR);
@ -132,10 +133,10 @@ HTMLMenuElement::Build(nsIMenuBuilder* aBuilder)
bool
HTMLMenuElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
nsHTMLMenuElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type) {
bool success = aResult.ParseEnumValue(aValue, kMenuTypeTable,
@ -154,9 +155,9 @@ HTMLMenuElement::ParseAttribute(int32_t aNamespaceID,
}
void
HTMLMenuElement::BuildSubmenu(const nsAString& aLabel,
nsIContent* aContent,
nsIMenuBuilder* aBuilder)
nsHTMLMenuElement::BuildSubmenu(const nsAString& aLabel,
nsIContent* aContent,
nsIMenuBuilder* aBuilder)
{
aBuilder->OpenContainer(aLabel);
@ -172,7 +173,7 @@ HTMLMenuElement::BuildSubmenu(const nsAString& aLabel,
// static
bool
HTMLMenuElement::CanLoadIcon(nsIContent* aContent, const nsAString& aIcon)
nsHTMLMenuElement::CanLoadIcon(nsIContent* aContent, const nsAString& aIcon)
{
if (aIcon.IsEmpty()) {
return false;
@ -194,9 +195,9 @@ HTMLMenuElement::CanLoadIcon(nsIContent* aContent, const nsAString& aIcon)
}
void
HTMLMenuElement::TraverseContent(nsIContent* aContent,
nsIMenuBuilder* aBuilder,
int8_t& aSeparator)
nsHTMLMenuElement::TraverseContent(nsIContent* aContent,
nsIMenuBuilder* aBuilder,
int8_t& aSeparator)
{
nsCOMPtr<nsIContent> child;
for (child = aContent->GetFirstChild(); child;
@ -248,7 +249,7 @@ HTMLMenuElement::TraverseContent(nsIContent* aContent,
}
inline void
HTMLMenuElement::AddSeparator(nsIMenuBuilder* aBuilder, int8_t& aSeparator)
nsHTMLMenuElement::AddSeparator(nsIMenuBuilder* aBuilder, int8_t& aSeparator)
{
if (aSeparator) {
return;
@ -257,13 +258,3 @@ HTMLMenuElement::AddSeparator(nsIMenuBuilder* aBuilder, int8_t& aSeparator)
aBuilder->AddSeparator();
aSeparator = ST_TRUE;
}
JSObject*
HTMLMenuElement::WrapNode(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap)
{
return HTMLMenuElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
} // namespace dom
} // namespace mozilla

View File

@ -3,25 +3,19 @@
* 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"
namespace mozilla {
namespace dom {
class HTMLMenuElement : public nsGenericHTMLElement,
public nsIDOMHTMLMenuElement,
public nsIHTMLMenu
class nsHTMLMenuElement : public nsGenericHTMLElement,
public nsIDOMHTMLMenuElement,
public nsIHTMLMenu
{
public:
HTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~HTMLMenuElement();
nsHTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~nsHTMLMenuElement();
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLMenuElement, menu)
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(nsHTMLMenuElement, menu)
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
@ -54,35 +48,6 @@ public:
uint8_t GetType() const { return mType; }
// WebIDL
// The XPCOM GetType is OK for us
void SetType(const nsAString& aType, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::type, aType, aError);
}
// The XPCOM GetLabel is OK for us
void SetLabel(const nsAString& aLabel, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::label, aLabel, aError);
}
bool Compact() const
{
return GetBoolAttr(nsGkAtoms::compact);
}
void SetCompact(bool aCompact, ErrorResult& aError)
{
SetHTMLBoolAttr(nsGkAtoms::compact, aCompact, aError);
}
protected:
virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap) MOZ_OVERRIDE;
protected:
static bool CanLoadIcon(nsIContent* aContent, const nsAString& aIcon);
@ -98,8 +63,3 @@ protected:
uint8_t mType;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_HTMLMenuElement_h

View File

@ -419,10 +419,6 @@ DOMInterfaces = {
'hasInstanceInterface': 'nsIDOMHTMLLIElement',
},
'HTMLMenuElement': {
'hasInstanceInterface': 'nsIDOMHTMLMenuElement',
},
'HTMLOListElement': {
'headerFile' : 'mozilla/dom/HTMLSharedListElement.h',
'hasInstanceInterface': 'nsIDOMHTMLOListElement'
@ -1224,6 +1220,7 @@ def addExternalHTMLElement(element):
headerFile=nativeElement + '.h')
addExternalHTMLElement('HTMLFormElement')
addExternalHTMLElement('HTMLMenuElement')
addExternalHTMLElement('HTMLOptionElement')
addExternalHTMLElement('HTMLOptGroupElement')
addExternalHTMLElement('HTMLVideoElement')

View File

@ -13,6 +13,7 @@
*/
interface DOMStringMap;
interface HTMLMenuElement;
// Hack to make sure that we initialize the touch prefs properly
[PrefControlled]

View File

@ -1,27 +0,0 @@
/* -*- Mode: IDL; 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/.
*
* The origin of this IDL file is
* http://www.whatwg.org/specs/web-apps/current-work/#the-menu-element
* http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
*
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-menu-element
interface HTMLMenuElement : HTMLElement {
[SetterThrows]
attribute DOMString type;
[SetterThrows]
attribute DOMString label;
};
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLMenuElement {
[SetterThrows]
attribute boolean compact;
};

View File

@ -71,7 +71,6 @@ webidl_files = \
HTMLImageElement.webidl \
HTMLLabelElement.webidl \
HTMLLIElement.webidl \
HTMLMenuElement.webidl \
HTMLOListElement.webidl \
HTMLOptionsCollection.webidl \
HTMLParagraphElement.webidl \

View File

@ -297,7 +297,7 @@ irregularFilenames = {
customIncludes = [
'nsDOMQS.h',
'HTMLMenuElement.h',
'nsHTMLMenuElement.h',
'mozilla/dom/NodeBinding.h',
'mozilla/dom/ElementBinding.h',
'mozilla/dom/HTMLElementBinding.h',