Fix for bug 804950 (New DOM binding APIs for Element). r=bz.

--HG--
extra : rebase_source : a8691ead07dfa8ecca812396047627dc15474d83
This commit is contained in:
Peter Van der Beken 2012-10-16 13:51:00 +02:00
parent ddc3904565
commit 451ff8f738
132 changed files with 1441 additions and 1022 deletions

View File

@ -266,6 +266,8 @@ public:
}
}
bool GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult);
protected:
/**
* Method to get the _intrinsic_ content state of this element. This is the

View File

@ -32,6 +32,7 @@ class nsICSSDeclaration;
class nsIDocument;
class nsDOMStringMap;
class nsIDOMNamedNodeMap;
class nsIHTMLCollection;
class nsINodeInfo;
class nsIURI;
@ -220,6 +221,8 @@ public:
virtual const nsAttrValue* DoGetClasses() const;
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
nsIHTMLCollection* Children();
public:
/**
* If there are listeners for DOMNodeInserted event, fires the event on all
@ -369,8 +372,6 @@ protected:
* Array containing all attributes and children for this element
*/
nsAttrAndChildArray mAttrsAndChildren;
nsContentList* GetChildrenList();
};
} // namespace dom

View File

@ -51,6 +51,8 @@ class nsGenericElement;
namespace mozilla {
namespace dom {
class Element;
class EventHandlerNonNull;
class OnErrorEventHandlerNonNull;
template<typename T> class Optional;
} // namespace dom
} // namespace mozilla
@ -1077,13 +1079,10 @@ public:
SetTextContentInternal(aTextContent, aError);
}
/**
* Helper methods for implementing querySelector/querySelectorAll
*/
nsIContent* QuerySelector(const nsAString& aSelector,
nsresult *aResult);
nsresult QuerySelectorAll(const nsAString& aSelector,
nsIDOMNodeList **aReturn);
nsGenericElement* QuerySelector(const nsAString& aSelector,
mozilla::ErrorResult& aResult);
already_AddRefed<nsINodeList> QuerySelectorAll(const nsAString& aSelector,
mozilla::ErrorResult& aResult);
/**
* Associate an object aData to aKey on this node. If aData is null any
@ -1615,15 +1614,24 @@ public:
Note that we include DOCUMENT_ONLY_EVENT events here so that we
can forward all the document stuff to this implementation.
*/
#define EVENT(name_, id_, type_, struct_) \
NS_IMETHOD GetOn##name_(JSContext *cx, JS::Value *vp); \
#define EVENT_HELPER(name_, handlerClass_) \
mozilla::dom::handlerClass_* GetOn##name_(); \
void SetOn##name_(mozilla::dom::handlerClass_* listener, \
mozilla::ErrorResult& error); \
NS_IMETHOD GetOn##name_(JSContext *cx, JS::Value *vp); \
NS_IMETHOD SetOn##name_(JSContext *cx, const JS::Value &v);
#define EVENT(name_, id_, type_, struct_) \
EVENT_HELPER(name_, EventHandlerNonNull)
#define TOUCH_EVENT EVENT
#define DOCUMENT_ONLY_EVENT EVENT
#define ERROR_EVENT(name_, id_, type_, struct_) \
EVENT_HELPER(name_, OnErrorEventHandlerNonNull)
#include "nsEventNameList.h"
#undef ERROR_EVENT
#undef DOCUMENT_ONLY_EVENT
#undef TOUCH_EVENT
#undef EVENT
#undef EVENT_HELPER
protected:
static void Trace(nsINode *tmp, TraceCallback cb, void *closure);

View File

@ -452,8 +452,8 @@ nsNode3Tearoff::LookupNamespaceURI(const nsAString& aNamespacePrefix,
return NS_OK;
}
nsContentList*
FragmentOrElement::GetChildrenList()
nsIHTMLCollection*
FragmentOrElement::Children()
{
FragmentOrElement::nsDOMSlots *slots = DOMSlots();

View File

@ -260,6 +260,7 @@ public:
virtual ~nsContentList();
// nsWrapperCache
using nsWrapperCache::GetWrapper;
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap);

View File

@ -45,6 +45,7 @@
#include "nsIParser.h"
#include "nsIFragmentContentSink.h"
#include "nsIContentSink.h"
#include "nsContentList.h"
#include "nsIHTMLDocument.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLElement.h"
@ -6298,8 +6299,6 @@ nsContentUtils::AllocClassMatchingInfo(nsINode* aRootNode,
return info;
}
// static
#ifdef DEBUG
class DebugWrapperTraversalCallback : public nsCycleCollectionTraversalCallback
{

View File

@ -20,6 +20,7 @@
#include "nsDOMAttributeMap.h"
#include "nsCycleCollectionParticipant.h"
#include "nsStubMutationObserver.h"
#include "nsGenericElement.h"
// Attribute helper class used to wrap up an attribute with a dom
// object that implements nsIDOMAttr and nsIDOMNode

View File

@ -19,6 +19,8 @@
#include "nsAttrName.h"
#include "nsUnicharUtils.h"
using namespace mozilla;
//----------------------------------------------------------------------
nsDOMAttributeMap::nsDOMAttributeMap(Element* aContent)
@ -124,13 +126,10 @@ nsDOMAttributeMap::DropAttribute(int32_t aNamespaceID, nsIAtom* aLocalName)
}
}
nsresult
nsDOMAttributeMap::RemoveAttribute(nsINodeInfo* aNodeInfo, nsIDOMNode** aReturn)
already_AddRefed<nsDOMAttribute>
nsDOMAttributeMap::RemoveAttribute(nsINodeInfo* aNodeInfo)
{
NS_ASSERTION(aNodeInfo, "RemoveAttribute() called with aNodeInfo == nullptr!");
NS_ASSERTION(aReturn, "RemoveAttribute() called with aReturn == nullptr");
*aReturn = nullptr;
nsAttrKey attr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom());
@ -141,12 +140,7 @@ nsDOMAttributeMap::RemoveAttribute(nsINodeInfo* aNodeInfo, nsIDOMNode** aReturn)
// the attribute node.
mContent->GetAttr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom(), value);
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
nsCOMPtr<nsIDOMNode> newAttr =
new nsDOMAttribute(nullptr, ni.forget(), value, true);
if (!newAttr) {
return NS_ERROR_OUT_OF_MEMORY;
}
newAttr.swap(*aReturn);
node = new nsDOMAttribute(nullptr, ni.forget(), value, true);
}
else {
// Break link to map
@ -154,11 +148,9 @@ nsDOMAttributeMap::RemoveAttribute(nsINodeInfo* aNodeInfo, nsIDOMNode** aReturn)
// Remove from cache
mAttributeCache.Remove(attr);
node.forget(aReturn);
}
return NS_OK;
return node.forget();
}
nsDOMAttribute*
@ -181,10 +173,8 @@ nsDOMAttributeMap::GetAttribute(nsINodeInfo* aNodeInfo, bool aNsAware)
}
nsDOMAttribute*
nsDOMAttributeMap::GetNamedItem(const nsAString& aAttrName, nsresult *aResult)
nsDOMAttributeMap::GetNamedItem(const nsAString& aAttrName)
{
*aResult = NS_OK;
if (mContent) {
nsCOMPtr<nsINodeInfo> ni =
mContent->GetExistingAttrNameFromQName(aAttrName);
@ -202,43 +192,40 @@ nsDOMAttributeMap::GetNamedItem(const nsAString& aAttrName,
{
NS_ENSURE_ARG_POINTER(aAttribute);
nsresult rv;
NS_IF_ADDREF(*aAttribute = GetNamedItem(aAttrName, &rv));
NS_IF_ADDREF(*aAttribute = GetNamedItem(aAttrName));
return rv;
return NS_OK;
}
NS_IMETHODIMP
nsDOMAttributeMap::SetNamedItem(nsIDOMNode *aNode, nsIDOMNode **aReturn)
{
return SetNamedItemInternal(aNode, aReturn, false);
ErrorResult rv;
*aReturn = SetNamedItemInternal(aNode, false, rv).get();
return rv.ErrorCode();
}
NS_IMETHODIMP
nsDOMAttributeMap::SetNamedItemNS(nsIDOMNode *aNode, nsIDOMNode **aReturn)
{
return SetNamedItemInternal(aNode, aReturn, true);
ErrorResult rv;
*aReturn = SetNamedItemInternal(aNode, true, rv).get();
return rv.ErrorCode();
}
nsresult
already_AddRefed<nsDOMAttribute>
nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
nsIDOMNode **aReturn,
bool aWithNS)
bool aWithNS,
ErrorResult& aError)
{
NS_ENSURE_ARG_POINTER(aNode);
NS_ENSURE_ARG_POINTER(aReturn);
nsresult rv = NS_OK;
*aReturn = nullptr;
nsCOMPtr<nsIDOMNode> tmpReturn;
if (mContent) {
// XXX should check same-origin between mContent and aNode however
// nsContentUtils::CheckSameOrigin can't deal with attributenodes yet
nsCOMPtr<nsIAttribute> iAttribute(do_QueryInterface(aNode));
if (!iAttribute) {
return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
return nullptr;
}
nsDOMAttribute *attribute = static_cast<nsDOMAttribute*>(iAttribute.get());
@ -247,24 +234,31 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
nsDOMAttributeMap* owner = iAttribute->GetMap();
if (owner) {
if (owner != this) {
return NS_ERROR_DOM_INUSE_ATTRIBUTE_ERR;
aError.Throw(NS_ERROR_DOM_INUSE_ATTRIBUTE_ERR);
return nullptr;
}
// setting a preexisting attribute is a no-op, just return the same
// node.
NS_ADDREF(*aReturn = aNode);
return NS_OK;
NS_ADDREF(attribute);
return attribute;
}
nsresult rv;
if (!mContent->HasSameOwnerDoc(iAttribute)) {
nsCOMPtr<nsIDOMDocument> domDoc =
do_QueryInterface(mContent->OwnerDoc(), &rv);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv)) {
aError.Throw(rv);
return nullptr;
}
nsCOMPtr<nsIDOMNode> adoptedNode;
rv = domDoc->AdoptNode(aNode, getter_AddRefs(adoptedNode));
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv)) {
aError.Throw(rv);
return nullptr;
}
NS_ASSERTION(adoptedNode == aNode, "Uh, adopt node changed nodes?");
}
@ -273,14 +267,14 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
nsAutoString name;
nsCOMPtr<nsINodeInfo> ni;
nsRefPtr<nsDOMAttribute> attr;
// SetNamedItemNS()
if (aWithNS) {
// Return existing attribute, if present
ni = iAttribute->NodeInfo();
if (mContent->HasAttr(ni->NamespaceID(), ni->NameAtom())) {
rv = RemoveAttribute(ni, getter_AddRefs(tmpReturn));
NS_ENSURE_SUCCESS(rv, rv);
attr = RemoveAttribute(ni);
}
}
else { // SetNamedItem()
@ -289,8 +283,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
// get node-info of old attribute
ni = mContent->GetExistingAttrNameFromQName(name);
if (ni) {
rv = RemoveAttribute(ni, getter_AddRefs(tmpReturn));
NS_ENSURE_SUCCESS(rv, rv);
attr = RemoveAttribute(ni);
}
else {
if (mContent->IsInHTMLDocument() &&
@ -301,7 +294,10 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
rv = mContent->NodeInfo()->NodeInfoManager()->
GetNodeInfo(name, nullptr, kNameSpaceID_None,
nsIDOMNode::ATTRIBUTE_NODE, getter_AddRefs(ni));
NS_ENSURE_SUCCESS(rv, rv);
if (NS_FAILED(rv)) {
aError.Throw(rv);
return nullptr;
}
// value is already empty
}
}
@ -318,13 +314,14 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
rv = mContent->SetAttr(ni->NamespaceID(), ni->NameAtom(),
ni->GetPrefixAtom(), value, true);
if (NS_FAILED(rv)) {
aError.Throw(rv);
DropAttribute(ni->NamespaceID(), ni->NameAtom());
}
return attr.forget();
}
tmpReturn.swap(*aReturn); // transfers ref.
return rv;
return nullptr;
}
NS_IMETHODIMP
@ -406,20 +403,31 @@ nsDOMAttributeMap::GetNamedItemNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMNode** aReturn)
{
return GetNamedItemNSInternal(aNamespaceURI, aLocalName, aReturn);
ErrorResult rv;
NS_IF_ADDREF(*aReturn = GetNamedItemNS(aNamespaceURI, aLocalName, rv));
return rv.ErrorCode();
}
nsresult
nsDOMAttributeMap::GetNamedItemNSInternal(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMNode** aReturn,
bool aRemove)
nsDOMAttribute*
nsDOMAttributeMap::GetNamedItemNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
ErrorResult& aError)
{
NS_ENSURE_ARG_POINTER(aReturn);
*aReturn = nullptr;
nsCOMPtr<nsINodeInfo> ni = GetAttrNodeInfo(aNamespaceURI, aLocalName, aError);
if (!ni) {
return nullptr;
}
return GetAttribute(ni, true);
}
already_AddRefed<nsINodeInfo>
nsDOMAttributeMap::GetAttrNodeInfo(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
mozilla::ErrorResult& aError)
{
if (!mContent) {
return NS_OK;
return nullptr;
}
int32_t nameSpaceID = kNameSpaceID_None;
@ -429,7 +437,7 @@ nsDOMAttributeMap::GetNamedItemNSInternal(const nsAString& aNamespaceURI,
nsContentUtils::NameSpaceManager()->GetNameSpaceID(aNamespaceURI);
if (nameSpaceID == kNameSpaceID_Unknown) {
return NS_OK;
return nullptr;
}
}
@ -445,19 +453,15 @@ nsDOMAttributeMap::GetNamedItemNSInternal(const nsAString& aNamespaceURI,
ni = mContent->NodeInfo()->NodeInfoManager()->
GetNodeInfo(nameAtom, name->GetPrefix(), nameSpaceID,
nsIDOMNode::ATTRIBUTE_NODE);
NS_ENSURE_TRUE(ni, NS_ERROR_OUT_OF_MEMORY);
if (aRemove) {
return RemoveAttribute(ni, aReturn);
if (!ni) {
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
}
NS_ADDREF(*aReturn = GetAttribute(ni, true));
return NS_OK;
return ni.forget();
}
}
return NS_OK;
return nullptr;
}
NS_IMETHODIMP
@ -468,24 +472,21 @@ nsDOMAttributeMap::RemoveNamedItemNS(const nsAString& aNamespaceURI,
NS_ENSURE_ARG_POINTER(aReturn);
*aReturn = nullptr;
nsresult rv = GetNamedItemNSInternal(aNamespaceURI,
aLocalName,
aReturn,
true);
NS_ENSURE_SUCCESS(rv, rv);
ErrorResult error;
nsCOMPtr<nsINodeInfo> ni = GetAttrNodeInfo(aNamespaceURI, aLocalName, error);
if (error.Failed()) {
return error.ErrorCode();
}
if (!*aReturn) {
if (!ni) {
return NS_ERROR_DOM_NOT_FOUND_ERR;
}
nsCOMPtr<nsIAttribute> attr = do_QueryInterface(*aReturn);
NS_ASSERTION(attr, "attribute returned from nsDOMAttributeMap::GetNameItemNS "
"didn't implement nsIAttribute");
NS_ENSURE_TRUE(attr, NS_ERROR_UNEXPECTED);
nsINodeInfo *ni = attr->NodeInfo();
mContent->UnsetAttr(ni->NamespaceID(), ni->NameAtom(), true);
nsRefPtr<nsDOMAttribute> attr = RemoveAttribute(ni);
nsINodeInfo *attrNi = attr->NodeInfo();
mContent->UnsetAttr(attrNi->NamespaceID(), attrNi->NameAtom(), true);
attr.forget(aReturn);
return NS_OK;
}

View File

@ -15,6 +15,7 @@
#include "nsRefPtrHashtable.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIDOMNode.h"
#include "mozilla/ErrorResult.h"
class nsIAtom;
class nsDOMAttribute;
@ -138,7 +139,7 @@ public:
uint32_t Enumerate(AttrCache::EnumReadFunction aFunc, void *aUserArg) const;
nsDOMAttribute* GetItemAt(uint32_t aIndex, nsresult *rv);
nsDOMAttribute* GetNamedItem(const nsAString& aAttrName, nsresult *rv);
nsDOMAttribute* GetNamedItem(const nsAString& aAttrName);
static nsDOMAttributeMap* FromSupports(nsISupports* aSupports)
{
@ -159,6 +160,16 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS(nsDOMAttributeMap)
nsDOMAttribute* GetNamedItemNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
mozilla::ErrorResult& aError);
already_AddRefed<nsDOMAttribute> SetNamedItemNS(nsIDOMNode *aNode,
mozilla::ErrorResult& aError)
{
return SetNamedItemInternal(aNode, true, aError);
}
size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const;
private:
@ -173,26 +184,22 @@ private:
* SetNamedItem() (aWithNS = false) and SetNamedItemNS() (aWithNS =
* true) implementation.
*/
nsresult SetNamedItemInternal(nsIDOMNode *aNode,
nsIDOMNode **aReturn,
bool aWithNS);
already_AddRefed<nsDOMAttribute>
SetNamedItemInternal(nsIDOMNode *aNode,
bool aWithNS,
mozilla::ErrorResult& aError);
/**
* GetNamedItemNS() implementation taking |aRemove| for GetAttribute(),
* which is used by RemoveNamedItemNS().
*/
nsresult GetNamedItemNSInternal(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMNode** aReturn,
bool aRemove = false);
already_AddRefed<nsINodeInfo>
GetAttrNodeInfo(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
mozilla::ErrorResult& aError);
nsDOMAttribute* GetAttribute(nsINodeInfo* aNodeInfo, bool aNsAware);
/**
* Remove an attribute, returns the removed node.
*/
nsresult RemoveAttribute(nsINodeInfo* aNodeInfo,
nsIDOMNode** aReturn);
already_AddRefed<nsDOMAttribute> RemoveAttribute(nsINodeInfo* aNodeInfo);
};

View File

@ -8,6 +8,7 @@
#include "nsDOMSettableTokenList.h"
#include "mozilla/dom/DOMSettableTokenListBinding.h"
#include "nsGenericElement.h"
nsDOMSettableTokenList::nsDOMSettableTokenList(nsGenericElement *aElement, nsIAtom* aAttrAtom)

View File

@ -50,6 +50,15 @@ nsDOMTokenList::DropReference()
mElement = nullptr;
}
const nsAttrValue*
nsDOMTokenList::GetParsedAttr()
{
if (!mElement) {
return nullptr;
}
return mElement->GetAttrInfo(kNameSpaceID_None, mAttrAtom).mValue;
}
uint32_t
nsDOMTokenList::Length()
{

View File

@ -9,13 +9,17 @@
#ifndef nsDOMTokenList_h___
#define nsDOMTokenList_h___
#include "nsGenericElement.h"
#include "nsIDOMDOMTokenList.h"
#include "nsCOMPtr.h"
#include "nsDOMString.h"
#include "nsWrapperCache.h"
namespace mozilla {
class ErrorResult;
}
class nsAttrValue;
class nsGenericElement;
class nsIAtom;
// nsISupports must be on the primary inheritance chain
// because nsDOMSettableTokenList is traversed by nsGenericElement.
@ -34,18 +38,11 @@ public:
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap);
nsINode *GetParentObject()
nsGenericElement* GetParentObject()
{
return mElement;
}
const nsAttrValue* GetParsedAttr() {
if (!mElement) {
return nullptr;
}
return mElement->GetAttrInfo(kNameSpaceID_None, mAttrAtom).mValue;
}
uint32_t Length();
void Item(uint32_t aIndex, nsAString& aResult)
{
@ -68,6 +65,7 @@ protected:
nsresult CheckToken(const nsAString& aStr);
void AddInternal(const nsAttrValue* aAttr, const nsAString& aToken);
void RemoveInternal(const nsAttrValue* aAttr, const nsAString& aToken);
inline const nsAttrValue* GetParsedAttr();
nsGenericElement* mElement;
nsCOMPtr<nsIAtom> mAttrAtom;

View File

@ -69,6 +69,7 @@
#include "nsDataHashtable.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Attributes.h"
#include "nsGenericElement.h"
#define XML_DECLARATION_BITS_DECLARATION_EXISTS (1 << 0)
#define XML_DECLARATION_BITS_ENCODING_EXISTS (1 << 1)

File diff suppressed because it is too large Load Diff

View File

@ -36,9 +36,13 @@
#include "mozilla/Attributes.h"
#include "nsContentUtils.h"
#include "nsINodeList.h"
#include "mozilla/ErrorResult.h"
#include "nsIScrollableFrame.h"
#include "nsIDOMAttr.h"
#include "nsISMILAttr.h"
#include "nsClientRect.h"
#include "nsIDOMDOMTokenList.h"
class nsIDOMAttr;
class nsIDOMEventListener;
class nsIFrame;
class nsIDOMNamedNodeMap;
@ -51,11 +55,19 @@ class nsEventChainVisitor;
class nsEventListenerManager;
class nsIScrollableFrame;
class nsAttrValueOrString;
class ContentUnbinder;
class nsClientRect;
class nsClientRectList;
class nsIHTMLCollection;
class nsContentList;
class nsDOMTokenList;
class ContentUnbinder;
struct nsRect;
already_AddRefed<nsContentList>
NS_GetContentList(nsINode* aRootNode,
int32_t aMatchNameSpaceId,
const nsAString& aTagname);
/**
* A generic base class for DOM elements, implementing many nsIContent,
* nsIDOMNode and nsIDOMElement methods.
@ -198,8 +210,20 @@ private:
uint32_t aMapCount);
public:
// nsIDOMElement method implementation
NS_DECL_NSIDOMELEMENT
void GetTagName(nsAString& aTagName) const
{
aTagName = NodeName();
}
void GetId(nsAString& aId) const
{
GetAttr(kNameSpaceID_None, nsGkAtoms::id, aId);
}
void SetId(const nsAString& aId)
{
SetAttr(kNameSpaceID_None, nsGkAtoms::id, aId, true);
}
nsDOMTokenList* ClassList();
nsDOMAttributeMap* GetAttributes()
{
nsDOMSlots *slots = DOMSlots();
@ -209,6 +233,160 @@ public:
return slots->mAttributeMap;
}
virtual void GetAttribute(const nsAString& aName, nsString& aReturn);
void GetAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsAString& aReturn);
void SetAttribute(const nsAString& aName, const nsAString& aValue,
mozilla::ErrorResult& aError);
void SetAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
const nsAString& aValue,
mozilla::ErrorResult& aError);
virtual void RemoveAttribute(const nsAString& aName,
mozilla::ErrorResult& aError);
void RemoveAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
mozilla::ErrorResult& aError);
virtual bool HasAttribute(const nsAString& aName) const
{
return InternalGetExistingAttrNameFromQName(aName) != nullptr;
}
bool HasAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName) const;
already_AddRefed<nsIHTMLCollection>
GetElementsByTagName(const nsAString& aQualifiedName);
already_AddRefed<nsIHTMLCollection>
GetElementsByTagNameNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
mozilla::ErrorResult& aError);
already_AddRefed<nsIHTMLCollection>
GetElementsByClassName(const nsAString& aClassNames);
nsGenericElement* GetFirstElementChild() const;
nsGenericElement* GetLastElementChild() const;
nsGenericElement* GetPreviousElementSibling() const
{
nsIContent* previousSibling = GetPreviousSibling();
while (previousSibling) {
if (previousSibling->IsElement()) {
return static_cast<nsGenericElement*>(previousSibling);
}
previousSibling = previousSibling->GetPreviousSibling();
}
return nullptr;
}
nsGenericElement* GetNextElementSibling() const
{
nsIContent* nextSibling = GetNextSibling();
while (nextSibling) {
if (nextSibling->IsElement()) {
return static_cast<nsGenericElement*>(nextSibling);
}
nextSibling = nextSibling->GetNextSibling();
}
return nullptr;
}
uint32_t ChildElementCount()
{
return Children()->Length();
}
bool MozMatchesSelector(const nsAString& aSelector,
mozilla::ErrorResult& aError);
void SetCapture(bool aRetargetToElement)
{
// If there is already an active capture, ignore this request. This would
// occur if a splitter, frame resizer, etc had already captured and we don't
// want to override those.
if (!nsIPresShell::GetCapturingContent()) {
nsIPresShell::SetCapturingContent(this, CAPTURE_PREVENTDRAG |
(aRetargetToElement ? CAPTURE_RETARGETTOELEMENT : 0));
}
}
void ReleaseCapture()
{
if (nsIPresShell::GetCapturingContent() == this) {
nsIPresShell::SetCapturingContent(nullptr, 0);
}
}
void MozRequestFullScreen();
void MozRequestPointerLock()
{
OwnerDoc()->RequestPointerLock(this);
}
nsIDOMAttr* GetAttributeNode(const nsAString& aName);
already_AddRefed<nsIDOMAttr> SetAttributeNode(nsIDOMAttr* aNewAttr,
mozilla::ErrorResult& aError);
already_AddRefed<nsIDOMAttr> RemoveAttributeNode(nsIDOMAttr* aOldAttr,
mozilla::ErrorResult& aError);
nsIDOMAttr* GetAttributeNodeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
mozilla::ErrorResult& aError);
already_AddRefed<nsIDOMAttr> SetAttributeNodeNS(nsIDOMAttr* aNewAttr,
mozilla::ErrorResult& aError);
already_AddRefed<nsClientRectList> GetClientRects(mozilla::ErrorResult& aError);
already_AddRefed<nsClientRect> GetBoundingClientRect();
void ScrollIntoView(bool aTop);
int32_t ScrollTop()
{
nsIScrollableFrame* sf = GetScrollFrame();
return sf ? sf->GetScrollPositionCSSPixels().y : 0;
}
void SetScrollTop(int32_t aScrollTop)
{
nsIScrollableFrame* sf = GetScrollFrame();
if (sf) {
sf->ScrollToCSSPixels(nsIntPoint(sf->GetScrollPositionCSSPixels().x,
aScrollTop));
}
}
int32_t ScrollLeft()
{
nsIScrollableFrame* sf = GetScrollFrame();
return sf ? sf->GetScrollPositionCSSPixels().x : 0;
}
void SetScrollLeft(int32_t aScrollLeft)
{
nsIScrollableFrame* sf = GetScrollFrame();
if (sf) {
sf->ScrollToCSSPixels(nsIntPoint(aScrollLeft,
sf->GetScrollPositionCSSPixels().y));
}
}
int32_t ScrollWidth();
int32_t ScrollHeight();
int32_t ClientTop()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().y);
}
int32_t ClientLeft()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().x);
}
int32_t ClientWidth()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().width);
}
int32_t ClientHeight()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().height);
}
int32_t ScrollTopMax()
{
nsIScrollableFrame* sf = GetScrollFrame();
return sf ?
nsPresContext::AppUnitsToIntCSSPixels(sf->GetScrollRange().YMost()) :
0;
}
int32_t ScrollLeftMax()
{
nsIScrollableFrame* sf = GetScrollFrame();
return sf ?
nsPresContext::AppUnitsToIntCSSPixels(sf->GetScrollRange().XMost()) :
0;
}
//----------------------------------------
@ -306,35 +484,6 @@ public:
{
}
int32_t GetScrollTop();
int32_t GetScrollLeft();
int32_t GetScrollHeight();
int32_t GetScrollWidth();
int32_t GetScrollLeftMax();
int32_t GetScrollTopMax();
int32_t GetClientTop()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().y);
}
int32_t GetClientLeft()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().x);
}
int32_t GetClientHeight()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().height);
}
int32_t GetClientWidth()
{
return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().width);
}
nsIContent* GetFirstElementChild();
nsIContent* GetLastElementChild();
nsIContent* GetPreviousElementSibling();
nsIContent* GetNextElementSibling();
nsDOMTokenList* GetClassList(nsresult *aResult);
bool MozMatchesSelector(const nsAString& aSelector, nsresult* aResult);
/**
* Get the attr info for the given namespace ID and attribute name. The
* namespace ID must not be kNameSpaceID_Unknown and the name must not be
@ -367,6 +516,23 @@ public:
*/
static mozilla::CORSMode AttrValueToCORSMode(const nsAttrValue* aValue);
// These are just used to implement nsIDOMElement using
// NS_FORWARD_NSIDOMELEMENT_TO_GENERIC and for quickstubs.
void
GetElementsByTagName(const nsAString& aQualifiedName,
nsIDOMHTMLCollection** aResult);
nsresult
GetElementsByTagNameNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMHTMLCollection** aResult);
nsresult
GetElementsByClassName(const nsAString& aClassNames,
nsIDOMHTMLCollection** aResult);
void GetClassList(nsIDOMDOMTokenList** aClassList);
virtual JSObject* WrapObject(JSContext *aCx, JSObject *aScope,
bool *aTriedToWrap) MOZ_FINAL;
protected:
/*
* Named-bools for use with SetAttrAndNotify to make call sites easier to
@ -523,9 +689,9 @@ protected:
return this;
}
nsresult GetAttributeNodeNSInternal(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMAttr** aReturn);
nsIDOMAttr* GetAttributeNodeNSInternal(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
mozilla::ErrorResult& aError);
void RegisterFreezableElement() {
OwnerDoc()->RegisterFreezableElement(this);
@ -683,4 +849,299 @@ _elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
return SetAttr(kNameSpaceID_None, nsGkAtoms::_atom, nullptr, aValue, true); \
}
#define NS_FORWARD_NSIDOMELEMENT_TO_GENERIC \
NS_IMETHOD GetTagName(nsAString& aTagName) MOZ_FINAL \
{ \
nsGenericElement::GetTagName(aTagName); \
return NS_OK; \
} \
NS_IMETHOD GetClassList(nsIDOMDOMTokenList** aClassList) MOZ_FINAL \
{ \
nsGenericElement::GetClassList(aClassList); \
return NS_OK; \
} \
using nsGenericElement::GetAttribute; \
NS_IMETHOD GetAttribute(const nsAString& name, nsAString& _retval) MOZ_FINAL \
{ \
nsString attr; \
GetAttribute(name, attr); \
_retval = attr; \
return NS_OK; \
} \
NS_IMETHOD GetAttributeNS(const nsAString& namespaceURI, \
const nsAString& localName, \
nsAString& _retval) MOZ_FINAL \
{ \
nsGenericElement::GetAttributeNS(namespaceURI, localName, _retval); \
return NS_OK; \
} \
NS_IMETHOD SetAttribute(const nsAString& name, \
const nsAString& value) \
{ \
mozilla::ErrorResult rv; \
nsGenericElement::SetAttribute(name, value, rv); \
return rv.ErrorCode(); \
} \
NS_IMETHOD SetAttributeNS(const nsAString& namespaceURI, \
const nsAString& qualifiedName, \
const nsAString& value) MOZ_FINAL \
{ \
mozilla::ErrorResult rv; \
nsGenericElement::SetAttributeNS(namespaceURI, qualifiedName, value, rv); \
return rv.ErrorCode(); \
} \
using nsGenericElement::RemoveAttribute; \
NS_IMETHOD RemoveAttribute(const nsAString& name) MOZ_FINAL \
{ \
mozilla::ErrorResult rv; \
RemoveAttribute(name, rv); \
return rv.ErrorCode(); \
} \
NS_IMETHOD RemoveAttributeNS(const nsAString& namespaceURI, \
const nsAString& localName) MOZ_FINAL \
{ \
mozilla::ErrorResult rv; \
nsGenericElement::RemoveAttributeNS(namespaceURI, localName, rv); \
return rv.ErrorCode(); \
} \
using nsGenericElement::HasAttribute; \
NS_IMETHOD HasAttribute(const nsAString& name, \
bool* _retval) MOZ_FINAL \
{ \
*_retval = HasAttribute(name); \
return NS_OK; \
} \
NS_IMETHOD HasAttributeNS(const nsAString& namespaceURI, \
const nsAString& localName, \
bool* _retval) MOZ_FINAL \
{ \
*_retval = nsGenericElement::HasAttributeNS(namespaceURI, localName); \
return NS_OK; \
} \
NS_IMETHOD GetAttributeNode(const nsAString& name, \
nsIDOMAttr** _retval) MOZ_FINAL \
{ \
NS_IF_ADDREF(*_retval = nsGenericElement::GetAttributeNode(name)); \
return NS_OK; \
} \
NS_IMETHOD SetAttributeNode(nsIDOMAttr* newAttr, \
nsIDOMAttr** _retval) MOZ_FINAL \
{ \
if (!newAttr) { \
return NS_ERROR_INVALID_POINTER; \
} \
mozilla::ErrorResult rv; \
*_retval = nsGenericElement::SetAttributeNode(newAttr, rv).get(); \
return rv.ErrorCode(); \
} \
NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* oldAttr, \
nsIDOMAttr** _retval) MOZ_FINAL \
{ \
if (!oldAttr) { \
return NS_ERROR_INVALID_POINTER; \
} \
mozilla::ErrorResult rv; \
*_retval = nsGenericElement::RemoveAttributeNode(oldAttr, rv).get(); \
return rv.ErrorCode(); \
} \
NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI, \
const nsAString& localName, \
nsIDOMAttr** _retval) MOZ_FINAL \
{ \
mozilla::ErrorResult rv; \
NS_IF_ADDREF(*_retval = nsGenericElement::GetAttributeNodeNS(namespaceURI, \
localName, \
rv)); \
return rv.ErrorCode(); \
} \
NS_IMETHOD SetAttributeNodeNS(nsIDOMAttr* newAttr, \
nsIDOMAttr** _retval) MOZ_FINAL \
{ \
mozilla::ErrorResult rv; \
*_retval = nsGenericElement::SetAttributeNodeNS(newAttr, rv).get(); \
return rv.ErrorCode(); \
} \
NS_IMETHOD GetElementsByTagName(const nsAString& name, \
nsIDOMHTMLCollection** _retval) MOZ_FINAL \
{ \
nsGenericElement::GetElementsByTagName(name, _retval); \
return NS_OK; \
} \
NS_IMETHOD GetElementsByTagNameNS(const nsAString& namespaceURI, \
const nsAString& localName, \
nsIDOMHTMLCollection** _retval) MOZ_FINAL \
{ \
return nsGenericElement::GetElementsByTagNameNS(namespaceURI, localName, \
_retval); \
} \
NS_IMETHOD GetElementsByClassName(const nsAString& classes, \
nsIDOMHTMLCollection** _retval) MOZ_FINAL \
{ \
return nsGenericElement::GetElementsByClassName(classes, _retval); \
} \
NS_IMETHOD GetChildElements(nsIDOMNodeList** aChildElements) MOZ_FINAL \
{ \
nsIHTMLCollection* list = FragmentOrElement::Children(); \
return CallQueryInterface(list, aChildElements); \
} \
NS_IMETHOD GetFirstElementChild(nsIDOMElement** aFirstElementChild) MOZ_FINAL \
{ \
nsGenericElement* element = nsGenericElement::GetFirstElementChild(); \
if (!element) { \
*aFirstElementChild = nullptr; \
return NS_OK; \
} \
return CallQueryInterface(element, aFirstElementChild); \
} \
NS_IMETHOD GetLastElementChild(nsIDOMElement** aLastElementChild) MOZ_FINAL \
{ \
nsGenericElement* element = nsGenericElement::GetLastElementChild(); \
if (!element) { \
*aLastElementChild = nullptr; \
return NS_OK; \
} \
return CallQueryInterface(element, aLastElementChild); \
} \
NS_IMETHOD GetPreviousElementSibling(nsIDOMElement** aPreviousElementSibling) \
MOZ_FINAL \
{ \
nsGenericElement* element = nsGenericElement::GetPreviousElementSibling(); \
if (!element) { \
*aPreviousElementSibling = nullptr; \
return NS_OK; \
} \
return CallQueryInterface(element, aPreviousElementSibling); \
} \
NS_IMETHOD GetNextElementSibling(nsIDOMElement** aNextElementSibling) \
MOZ_FINAL \
{ \
nsGenericElement* element = nsGenericElement::GetNextElementSibling(); \
if (!element) { \
*aNextElementSibling = nullptr; \
return NS_OK; \
} \
return CallQueryInterface(element, aNextElementSibling); \
} \
NS_IMETHOD GetChildElementCount(uint32_t* aChildElementCount) MOZ_FINAL \
{ \
*aChildElementCount = nsGenericElement::ChildElementCount(); \
return NS_OK; \
} \
NS_IMETHOD GetOnmouseenter(JSContext* cx, JS::Value* aOnmouseenter) MOZ_FINAL \
{ \
return nsGenericElement::GetOnmouseenter(cx, aOnmouseenter); \
} \
NS_IMETHOD SetOnmouseenter(JSContext* cx, \
const JS::Value& aOnmouseenter) MOZ_FINAL \
{ \
return nsGenericElement::SetOnmouseenter(cx, aOnmouseenter); \
} \
NS_IMETHOD GetOnmouseleave(JSContext* cx, JS::Value* aOnmouseleave) MOZ_FINAL \
{ \
return nsGenericElement::GetOnmouseleave(cx, aOnmouseleave); \
} \
NS_IMETHOD SetOnmouseleave(JSContext* cx, \
const JS::Value& aOnmouseleave) MOZ_FINAL \
{ \
return nsGenericElement::SetOnmouseleave(cx, aOnmouseleave); \
} \
NS_IMETHOD GetClientRects(nsIDOMClientRectList** _retval) MOZ_FINAL \
{ \
mozilla::ErrorResult rv; \
*_retval = nsGenericElement::GetClientRects(rv).get(); \
return rv.ErrorCode(); \
} \
NS_IMETHOD GetBoundingClientRect(nsIDOMClientRect** _retval) MOZ_FINAL \
{ \
*_retval = nsGenericElement::GetBoundingClientRect().get(); \
return NS_OK; \
} \
NS_IMETHOD GetScrollTop(int32_t* aScrollTop) MOZ_FINAL \
{ \
*aScrollTop = nsGenericElement::ScrollTop(); \
return NS_OK; \
} \
NS_IMETHOD SetScrollTop(int32_t aScrollTop) MOZ_FINAL \
{ \
nsGenericElement::SetScrollTop(aScrollTop); \
return NS_OK; \
} \
NS_IMETHOD GetScrollLeft(int32_t* aScrollLeft) MOZ_FINAL \
{ \
*aScrollLeft = nsGenericElement::ScrollLeft(); \
return NS_OK; \
} \
NS_IMETHOD SetScrollLeft(int32_t aScrollLeft) MOZ_FINAL \
{ \
nsGenericElement::SetScrollLeft(aScrollLeft); \
return NS_OK; \
} \
NS_IMETHOD GetScrollWidth(int32_t* aScrollWidth) MOZ_FINAL \
{ \
*aScrollWidth = nsGenericElement::ScrollWidth(); \
return NS_OK; \
} \
NS_IMETHOD GetScrollHeight(int32_t* aScrollHeight) MOZ_FINAL \
{ \
*aScrollHeight = nsGenericElement::ScrollHeight(); \
return NS_OK; \
} \
NS_IMETHOD GetClientTop(int32_t* aClientTop) MOZ_FINAL \
{ \
*aClientTop = nsGenericElement::ClientTop(); \
return NS_OK; \
} \
NS_IMETHOD GetClientLeft(int32_t* aClientLeft) MOZ_FINAL \
{ \
*aClientLeft = nsGenericElement::ClientLeft(); \
return NS_OK; \
} \
NS_IMETHOD GetClientWidth(int32_t* aClientWidth) MOZ_FINAL \
{ \
*aClientWidth = nsGenericElement::ClientWidth(); \
return NS_OK; \
} \
NS_IMETHOD GetClientHeight(int32_t* aClientHeight) MOZ_FINAL \
{ \
*aClientHeight = nsGenericElement::ClientHeight(); \
return NS_OK; \
} \
NS_IMETHOD GetScrollLeftMax(int32_t* aScrollLeftMax) MOZ_FINAL \
{ \
*aScrollLeftMax = nsGenericElement::ScrollLeftMax(); \
return NS_OK; \
} \
NS_IMETHOD GetScrollTopMax(int32_t* aScrollTopMax) MOZ_FINAL \
{ \
*aScrollTopMax = nsGenericElement::ScrollTopMax(); \
return NS_OK; \
} \
NS_IMETHOD MozMatchesSelector(const nsAString& selector, \
bool* _retval) MOZ_FINAL \
{ \
mozilla::ErrorResult rv; \
*_retval = nsGenericElement::MozMatchesSelector(selector, rv); \
return rv.ErrorCode(); \
} \
NS_IMETHOD SetCapture(bool retargetToElement) MOZ_FINAL \
{ \
nsGenericElement::SetCapture(retargetToElement); \
return NS_OK; \
} \
NS_IMETHOD ReleaseCapture(void) MOZ_FINAL \
{ \
nsGenericElement::ReleaseCapture(); \
return NS_OK; \
} \
NS_IMETHOD MozRequestFullScreen(void) MOZ_FINAL \
{ \
nsGenericElement::MozRequestFullScreen(); \
return NS_OK; \
} \
NS_IMETHOD MozRequestPointerLock(void) MOZ_FINAL \
{ \
nsGenericElement::MozRequestPointerLock(); \
return NS_OK; \
}
#endif /* nsGenericElement_h___ */

View File

@ -2014,48 +2014,71 @@ nsINode::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
return n;
}
#define EVENT(name_, id_, type_, struct_) \
#define EVENT_HELPER(name_, handlerClass_) \
NS_IMETHODIMP nsINode::GetOn##name_(JSContext *cx, jsval *vp) { \
nsEventListenerManager *elm = GetListenerManager(false); \
if (elm) { \
EventHandlerNonNull* h = elm->GetEventHandler(nsGkAtoms::on##name_); \
if (h) { \
*vp = JS::ObjectValue(*h->Callable()); \
return NS_OK; \
} \
} \
*vp = JSVAL_NULL; \
handlerClass_* h = GetOn##name_(); \
vp->setObjectOrNull(h ? h->Callable() : nullptr); \
return NS_OK; \
} \
NS_IMETHODIMP nsINode::SetOn##name_(JSContext *cx, const jsval &v) { \
nsEventListenerManager *elm = GetListenerManager(true); \
if (!elm) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \
\
JSObject *obj = GetWrapper(); \
if (!obj) { \
/* Just silently do nothing */ \
return NS_OK; \
} \
nsRefPtr<EventHandlerNonNull> handler; \
nsRefPtr<handlerClass_> handler; \
JSObject *callable; \
if (v.isObject() && \
JS_ObjectIsCallable(cx, callable = &v.toObject())) { \
bool ok; \
handler = new EventHandlerNonNull(cx, obj, callable, &ok); \
handler = new handlerClass_(cx, obj, callable, &ok); \
if (!ok) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \
} \
return elm->SetEventHandler(nsGkAtoms::on##name_, handler); \
ErrorResult rv; \
SetOn##name_(handler, rv); \
return rv.ErrorCode(); \
}
#define EVENT(name_, id_, type_, struct_) \
EventHandlerNonNull* nsINode::GetOn##name_() { \
nsEventListenerManager *elm = GetListenerManager(false); \
return elm ? elm->GetEventHandler(nsGkAtoms::on##name_) : nullptr; \
} \
void nsINode::SetOn##name_(EventHandlerNonNull* handler, \
ErrorResult& error) { \
nsEventListenerManager *elm = GetListenerManager(true); \
if (elm) { \
error = elm->SetEventHandler(nsGkAtoms::on##name_, handler); \
} else { \
error.Throw(NS_ERROR_OUT_OF_MEMORY); \
} \
} \
EVENT_HELPER(name_, EventHandlerNonNull)
#define TOUCH_EVENT EVENT
#define DOCUMENT_ONLY_EVENT EVENT
#define ERROR_EVENT(name_, id_, type_, struct_) \
OnErrorEventHandlerNonNull* nsINode::GetOn##name_() { \
nsEventListenerManager *elm = GetListenerManager(false); \
return elm ? elm->GetOnErrorEventHandler() : nullptr; \
} \
void nsINode::SetOn##name_(OnErrorEventHandlerNonNull* handler, \
ErrorResult& error) { \
nsEventListenerManager *elm = GetListenerManager(true); \
if (elm) { \
error = elm->SetEventHandler(handler); \
} else { \
error.Throw(NS_ERROR_OUT_OF_MEMORY); \
} \
} \
EVENT_HELPER(name_, OnErrorEventHandlerNonNull)
#include "nsEventNameList.h"
#undef ERROR_EVENT
#undef DOCUMENT_ONLY_EVENT
#undef TOUCH_EVENT
#undef EVENT
#undef EVENT_HELPER
bool
nsINode::Contains(const nsINode* aOther) const
@ -2132,21 +2155,18 @@ NS_IMETHODIMP
nsNodeSelectorTearoff::QuerySelector(const nsAString& aSelector,
nsIDOMElement **aReturn)
{
nsresult rv;
nsIContent* result = mNode->QuerySelector(aSelector, &rv);
if (!result) {
*aReturn = nullptr;
return rv;
}
return CallQueryInterface(result, aReturn);
ErrorResult rv;
nsIContent* result = mNode->QuerySelector(aSelector, rv);
return result ? CallQueryInterface(result, aReturn) : rv.ErrorCode();
}
NS_IMETHODIMP
nsNodeSelectorTearoff::QuerySelectorAll(const nsAString& aSelector,
nsIDOMNodeList **aReturn)
{
return mNode->QuerySelectorAll(aSelector, aReturn);
ErrorResult rv;
*aReturn = mNode->QuerySelectorAll(aSelector, rv).get();
return rv.ErrorCode();
}
// NOTE: The aPresContext pointer is NOT addrefed.
@ -2190,9 +2210,8 @@ ParseSelectorList(nsINode* aNode,
// null) and which are descendants of aRoot and put them in aList. If
// onlyFirstMatch, then stop once the first one is found.
template<bool onlyFirstMatch, class T>
inline static nsresult FindMatchingElements(nsINode* aRoot,
const nsAString& aSelector,
T &aList)
inline static nsresult
FindMatchingElements(nsINode* aRoot, const nsAString& aSelector, T &aList)
{
nsAutoPtr<nsCSSSelectorList> selectorList;
nsresult rv = ParseSelectorList(aRoot, aSelector,
@ -2273,35 +2292,28 @@ struct ElementHolder {
ElementHolder() : mElement(nullptr) {}
void AppendElement(Element* aElement) {
NS_ABORT_IF_FALSE(!mElement, "Should only get one element");
mElement = aElement;
mElement = static_cast<nsGenericElement*>(aElement);
}
Element* mElement;
nsGenericElement* mElement;
};
nsIContent*
nsINode::QuerySelector(const nsAString& aSelector,
nsresult *aResult)
nsGenericElement*
nsINode::QuerySelector(const nsAString& aSelector, ErrorResult& aResult)
{
NS_PRECONDITION(aResult, "Null out param?");
ElementHolder holder;
*aResult = FindMatchingElements<true>(this, aSelector, holder);
aResult = FindMatchingElements<true>(this, aSelector, holder);
return holder.mElement;
}
/* static */
nsresult
nsINode::QuerySelectorAll(const nsAString& aSelector,
nsIDOMNodeList **aReturn)
already_AddRefed<nsINodeList>
nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
{
NS_PRECONDITION(aReturn, "Null out param?");
nsRefPtr<nsSimpleContentList> contentList = new nsSimpleContentList(this);
nsSimpleContentList* contentList = new nsSimpleContentList(this);
NS_ENSURE_TRUE(contentList, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(*aReturn = contentList);
aResult = FindMatchingElements<false>(this, aSelector, *contentList);
return FindMatchingElements<false>(this, aSelector, *contentList);
return contentList.forget();
}
JSObject*

View File

@ -28,7 +28,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsHTMLMediaElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsHTMLMediaElement::)

View File

@ -55,7 +55,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -25,7 +25,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsHTMLMediaElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsHTMLMediaElement::)

View File

@ -66,6 +66,15 @@ public:
}
virtual void GetSupportedNames(nsTArray<nsString>& aNames) = 0;
JSObject* GetWrapper()
{
nsWrapperCache* cache;
CallQueryInterface(this, &cache);
return cache->GetWrapper();
}
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLCollection, NS_IHTMLCOLLECTION_IID)

View File

@ -19,8 +19,9 @@
#include "nsINodeList.h"
#include "nsIHTMLCollection.h"
#include "nsHashKeys.h"
#include "nsGenericHTMLElement.h"
#include "nsRefPtrHashtable.h"
class nsGenericHTMLElement;
class nsXPCClassInfo;
class nsIDocument;
class nsINode;
@ -56,6 +57,7 @@ public:
HTMLPropertiesCollection(nsGenericHTMLElement* aRoot);
virtual ~HTMLPropertiesCollection();
using nsWrapperCache::GetWrapper;
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap);

View File

@ -315,36 +315,6 @@ nsGenericHTMLElement::CopyInnerTo(nsGenericElement* aDst)
return NS_OK;
}
NS_IMETHODIMP
nsGenericHTMLElement::SetAttribute(const nsAString& aName,
const nsAString& aValue)
{
const nsAttrName* name = InternalGetExistingAttrNameFromQName(aName);
if (!name) {
nsresult rv = nsContentUtils::CheckQName(aName, false);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIAtom> nameAtom;
if (IsInHTMLDocument()) {
nsAutoString lower;
rv = nsContentUtils::ASCIIToLower(aName, lower);
if (NS_SUCCEEDED(rv)) {
nameAtom = do_GetAtom(lower);
}
}
else {
nameAtom = do_GetAtom(aName);
}
NS_ENSURE_TRUE(nameAtom, NS_ERROR_OUT_OF_MEMORY);
return SetAttr(kNameSpaceID_None, nameAtom, aValue, true);
}
return SetAttr(name->NamespaceID(), name->LocalName(), name->GetPrefix(),
aValue, true);
}
already_AddRefed<nsDOMStringMap>
nsGenericHTMLElement::Dataset()
{
@ -1576,31 +1546,11 @@ nsGenericHTMLElement::InsertAdjacentHTML(const nsAString& aPosition,
nsresult
nsGenericHTMLElement::ScrollIntoView(bool aTop, uint8_t optional_argc)
{
nsIDocument *document = GetCurrentDoc();
if (!document) {
return NS_OK;
}
// Get the presentation shell
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
if (!presShell) {
return NS_OK;
}
if (!optional_argc) {
aTop = true;
}
int16_t vpercent = aTop ? nsIPresShell::SCROLL_TOP :
nsIPresShell::SCROLL_BOTTOM;
presShell->ScrollContentIntoView(this,
nsIPresShell::ScrollAxis(
vpercent,
nsIPresShell::SCROLL_ALWAYS),
nsIPresShell::ScrollAxis(),
nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
nsGenericElement::ScrollIntoView(aTop);
return NS_OK;
}

View File

@ -69,10 +69,6 @@ public:
// From nsGenericElement
nsresult CopyInnerTo(nsGenericElement* aDest);
// Implementation for nsIDOMElement
NS_METHOD SetAttribute(const nsAString& aName,
const nsAString& aValue);
// WebIDL HTMLElement
virtual void Click();
virtual int32_t TabIndexDefault()

View File

@ -38,7 +38,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -32,7 +32,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -30,7 +30,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -65,7 +65,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -66,7 +66,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)

View File

@ -25,7 +25,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -28,7 +28,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -25,7 +25,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -30,7 +30,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)

View File

@ -34,7 +34,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -2532,7 +2532,7 @@ nsFormControlList::NamedItem(JSContext* cx, const nsAString& name,
if (!item) {
return nullptr;
}
JSObject* wrapper = GetWrapper();
JSObject* wrapper = nsWrapperCache::GetWrapper();
JSAutoCompartment ac(cx, wrapper);
JS::Value v;
if (!mozilla::dom::WrapObject(cx, wrapper, item, &v)) {

View File

@ -43,7 +43,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -30,7 +30,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFrameElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFrameElement::)

View File

@ -56,7 +56,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -33,7 +33,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -30,7 +30,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -26,7 +26,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFrameElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFrameElement::)

View File

@ -27,7 +27,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -74,7 +74,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)

View File

@ -30,7 +30,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -28,7 +28,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLLabelElement
NS_DECL_NSIDOMHTMLLABELELEMENT

View File

@ -24,7 +24,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLLegendElement
NS_DECL_NSIDOMHTMLLEGENDELEMENT

View File

@ -49,7 +49,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -24,7 +24,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -24,7 +24,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -27,7 +27,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -25,7 +25,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -25,7 +25,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
/* nsIDOMElement */
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
/* nsIDOMHTMLElement */
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -23,7 +23,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -34,7 +34,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -46,7 +46,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)

View File

@ -23,7 +23,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -30,7 +30,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -32,7 +32,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)

View File

@ -31,7 +31,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -30,7 +30,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -24,7 +24,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -46,7 +46,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -2186,7 +2186,7 @@ nsHTMLOptionCollection::NamedItem(JSContext* cx, const nsAString& name,
if (!item) {
return nullptr;
}
JSObject* wrapper = GetWrapper();
JSObject* wrapper = nsWrapperCache::GetWrapper();
JSAutoCompartment ac(cx, wrapper);
JS::Value v;
if (!mozilla::dom::WrapObject(cx, wrapper, item, item, nullptr, &v)) {

View File

@ -246,7 +246,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)

View File

@ -44,7 +44,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -41,7 +41,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -28,7 +28,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -24,7 +24,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -41,7 +41,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -30,7 +30,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -36,7 +36,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -34,7 +34,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -260,7 +260,7 @@ TableRowsCollection::NamedItem(JSContext* cx, const nsAString& name,
return nullptr;
}
if (item) {
JSObject* wrapper = GetWrapper();
JSObject* wrapper = nsWrapperCache::GetWrapper();
JSAutoCompartment ac(cx, wrapper);
JS::Value v;
if (!mozilla::dom::WrapObject(cx, wrapper, item, &v)) {

View File

@ -25,7 +25,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -36,7 +36,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -35,7 +35,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -74,7 +74,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)

View File

@ -28,7 +28,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -20,7 +20,7 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)

View File

@ -35,7 +35,7 @@ public:
// Forward implementations of parent interfaces of nsMathMLElement to
// our base class
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsMathMLElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,

View File

@ -50,7 +50,8 @@ SVGFragmentIdentifier::RestoreOldPreserveAspectRatio(nsSVGSVGElement *root)
if (oldPARPtr) {
root->mPreserveAspectRatio.SetBaseValue(*oldPARPtr, root);
} else if (root->mPreserveAspectRatio.IsExplicitlySet()) {
root->RemoveAttribute(NS_LITERAL_STRING("preserveAspectRatio"));
mozilla::ErrorResult error;
root->RemoveAttribute(NS_LITERAL_STRING("preserveAspectRatio"), error);
}
}
@ -69,7 +70,8 @@ SVGFragmentIdentifier::RestoreOldViewBox(nsSVGSVGElement *root)
if (oldViewBoxPtr) {
root->mViewBox.SetBaseValue(*oldViewBoxPtr, root);
} else if (root->mViewBox.IsExplicitlySet()) {
root->RemoveAttribute(NS_LITERAL_STRING("viewBox"));
mozilla::ErrorResult error;
root->RemoveAttribute(NS_LITERAL_STRING("viewBox"), error);
}
}
@ -88,7 +90,8 @@ SVGFragmentIdentifier::RestoreOldZoomAndPan(nsSVGSVGElement *root)
if (oldZoomAndPan != nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_UNKNOWN) {
root->mEnumAttributes[nsSVGSVGElement::ZOOMANDPAN].SetBaseValue(oldZoomAndPan, root);
} else if (root->mEnumAttributes[nsSVGSVGElement::ZOOMANDPAN].IsExplicitlySet()) {
root->RemoveAttribute(NS_LITERAL_STRING("zoomAndPan"));
mozilla::ErrorResult error;
root->RemoveAttribute(NS_LITERAL_STRING("zoomAndPan"), error);
}
}

View File

@ -37,7 +37,7 @@ public:
// XXX: I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGAElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAElementBase::)
// nsINode interface methods

View File

@ -35,7 +35,7 @@ public:
// xxx If xpcom allowed virtual inheritance we wouldn't need to
// forward here :-(
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGAltGlyphElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAltGlyphElementBase::)
NS_FORWARD_NSIDOMSVGTEXTCONTENTELEMENT(nsSVGAltGlyphElementBase::)
NS_FORWARD_NSIDOMSVGTEXTPOSITIONINGELEMENT(nsSVGAltGlyphElementBase::)

View File

@ -25,7 +25,7 @@ public:
NS_DECL_NSIDOMSVGANIMATEELEMENT
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGAnimateElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAnimateElementBase::)
NS_FORWARD_NSIDOMSVGANIMATIONELEMENT(nsSVGAnimateElementBase::)

View File

@ -29,7 +29,7 @@ public:
NS_DECL_NSIDOMSVGANIMATEMOTIONELEMENT
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGAnimateMotionElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAnimateMotionElementBase::)
NS_FORWARD_NSIDOMSVGANIMATIONELEMENT(nsSVGAnimateMotionElementBase::)

View File

@ -28,7 +28,7 @@ public:
NS_DECL_NSIDOMSVGANIMATETRANSFORMELEMENT
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGAnimateTransformElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAnimateTransformElementBase::)
NS_FORWARD_NSIDOMSVGANIMATIONELEMENT(nsSVGAnimateTransformElementBase::)

View File

@ -30,7 +30,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGCircleElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGCircleElementBase::)
// nsSVGSVGElement methods:

View File

@ -34,7 +34,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGClipPathElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGClipPathElementBase::)
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;

View File

@ -30,7 +30,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGDefsElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGDefsElementBase::)
// nsIContent

View File

@ -25,7 +25,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGDescElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGDescElementBase::)
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;

View File

@ -30,7 +30,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGEllipseElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGEllipseElementBase::)
// nsSVGSVGElement methods:

View File

@ -41,7 +41,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFilterElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFilterElementBase::)
// nsIContent

View File

@ -357,7 +357,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEGaussianBlurElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEGaussianBlurElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -835,7 +835,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEBlendElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEBlendElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -1052,7 +1052,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEColorMatrixElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEColorMatrixElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -1372,7 +1372,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFECompositeElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFECompositeElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -1683,7 +1683,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEComponentTransferElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEComponentTransferElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIContent
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -2097,7 +2097,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -2144,7 +2144,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -2191,7 +2191,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -2238,7 +2238,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -2296,7 +2296,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEMergeElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEMergeElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIContent
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -2338,7 +2338,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEMergeNodeElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEMergeNodeElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -2533,7 +2533,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEOffsetElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEOffsetElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -2732,7 +2732,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEFloodElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEFloodElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIContent interface
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
@ -2882,7 +2882,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFETileElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFETileElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -3081,7 +3081,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFETurbulenceElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFETurbulenceElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -3630,7 +3630,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEMorphologyElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEMorphologyElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -3942,7 +3942,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEConvolveMatrixElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEConvolveMatrixElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -4436,7 +4436,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEDistantLightElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEDistantLightElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual bool AttributeAffectsRendering(
int32_t aNameSpaceID, nsIAtom* aAttribute) const;
@ -4541,7 +4541,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEPointLightElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEPointLightElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual bool AttributeAffectsRendering(
int32_t aNameSpaceID, nsIAtom* aAttribute) const;
@ -4653,7 +4653,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFESpotLightElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFESpotLightElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual bool AttributeAffectsRendering(
int32_t aNameSpaceID, nsIAtom* aAttribute) const;
@ -4820,7 +4820,6 @@ public:
const nsSVGFilterInstance& aInstance);
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFELightingElementBase::)
NS_FORWARD_NSIDOMELEMENT(nsSVGFELightingElementBase::)
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
@ -5200,7 +5199,7 @@ public:
NS_FORWARD_NSIDOMSVGFILTERPRIMITIVESTANDARDATTRIBUTES(nsSVGFEDiffuseLightingElementBase::)
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEDiffuseLightingElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEDiffuseLightingElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual bool AttributeAffectsRendering(
int32_t aNameSpaceID, nsIAtom* aAttribute) const;
@ -5331,7 +5330,7 @@ public:
NS_FORWARD_NSIDOMSVGFILTERPRIMITIVESTANDARDATTRIBUTES(nsSVGFESpecularLightingElementBase::)
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFESpecularLightingElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFESpecularLightingElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -5832,7 +5831,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEDisplacementMapElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEDisplacementMapElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;

View File

@ -252,7 +252,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEImageElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGFEImageElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIContent
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;

View File

@ -32,7 +32,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGForeignObjectElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGForeignObjectElementBase::)
// nsSVGElement specializations:

View File

@ -30,7 +30,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGGElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGGElementBase::)
// nsIContent

View File

@ -94,7 +94,7 @@ public:
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGLinearGradientElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGLinearGradientElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -138,7 +138,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGRadialGradientElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGRadialGradientElementBase::)
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;

View File

@ -40,7 +40,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGImageElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGImageElementBase::)
// nsIContent interface

View File

@ -30,7 +30,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGLineElementBase::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGLineElementBase::)
// nsIContent interface

View File

@ -92,7 +92,7 @@ public:
// xxx I wish we could use virtual inheritance
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGElement::)
// nsIContent interface

View File

@ -37,7 +37,7 @@ public:
NS_DECL_NSIDOMSVGMASKELEMENT
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT(nsSVGElement::)
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGElement::)
// nsIContent interface

Some files were not shown because too many files have changed in this diff Show More