Bug 563659 part 3 - Make Element inherit from FragmentOrElement; r=bz

This commit is contained in:
Aryeh Gregor 2012-06-27 16:01:55 +03:00
parent 23180b27f1
commit ec805a875a
14 changed files with 115 additions and 22 deletions

View File

@ -7,7 +7,7 @@
#ifndef mozilla_dom_Element_h__
#define mozilla_dom_Element_h__
#include "nsIContent.h"
#include "mozilla/dom/FragmentOrElement.h"
#include "nsEventStates.h"
class nsEventStateManager;
@ -60,12 +60,12 @@ class Link;
{ 0xc6c049a1, 0x96e8, 0x4580, \
{ 0xa6, 0x93, 0xb9, 0x5f, 0x53, 0xbe, 0xe8, 0x1c } }
class Element : public nsIContent
class Element : public FragmentOrElement
{
public:
#ifdef MOZILLA_INTERNAL_API
Element(already_AddRefed<nsINodeInfo> aNodeInfo) :
nsIContent(aNodeInfo),
FragmentOrElement(aNodeInfo),
mState(NS_EVENT_STATE_MOZ_READONLY)
{}
#endif // MOZILLA_INTERNAL_API

View File

@ -14,7 +14,7 @@
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "mozilla/dom/Element.h"
#include "nsIContent.h"
#include "nsIDOMElement.h"
#include "nsIDOMDocumentFragment.h"
#include "nsILinkHandler.h"
@ -209,7 +209,7 @@ class nsInlineEventHandlersTearoff;
namespace mozilla {
namespace dom {
class FragmentOrElement : public mozilla::dom::Element
class FragmentOrElement : public nsIContent
{
public:
FragmentOrElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -240,6 +240,7 @@ public:
NS_IMETHOD SetTextContent(const nsAString& aTextContent);
// nsIContent interface methods
#if 0
virtual void UpdateEditableState(bool aNotify);
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
@ -247,9 +248,11 @@ public:
bool aCompileEventHandlers);
virtual void UnbindFromTree(bool aDeep = true,
bool aNullParent = true);
#endif
virtual already_AddRefed<nsINodeList> GetChildren(PRUint32 aFilter);
virtual nsIAtom *GetClassAttributeName() const;
virtual already_AddRefed<nsINodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const;
#if 0
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
const nsAString& aValue, bool aNotify)
{
@ -298,6 +301,7 @@ public:
bool aNotify);
virtual const nsAttrName* GetAttrNameAt(PRUint32 aIndex) const;
virtual PRUint32 GetAttrCount() const;
#endif
virtual const nsTextFragment *GetText();
virtual PRUint32 TextLength() const;
virtual nsresult SetText(const PRUnichar* aBuffer, PRUint32 aLength,
@ -318,6 +322,7 @@ public:
virtual void DestroyContent();
virtual void SaveSubtreeState();
#if 0
virtual nsISMILAttr* GetAnimatedAttr(PRInt32 /*aNamespaceID*/, nsIAtom* /*aName*/)
{
return nullptr;
@ -336,14 +341,17 @@ public:
virtual void DumpContent(FILE* out, PRInt32 aIndent, bool aDumpAll) const;
void List(FILE* out, PRInt32 aIndent, const nsCString& aPrefix) const;
void ListAttributes(FILE* out) const;
#endif
#endif
virtual const nsAttrValue* DoGetClasses() const;
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
#if 0
virtual mozilla::css::StyleRule* GetInlineStyleRule();
virtual nsresult SetInlineStyleRule(mozilla::css::StyleRule* aStyleRule,
const nsAString* aSerialized,
bool aNotify);
#endif
NS_IMETHOD_(bool)
IsAttributeMapped(const nsIAtom* aAttribute) const;
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
@ -382,12 +390,16 @@ public:
NS_IMETHOD GetNodeValue(nsAString& aNodeValue);
NS_IMETHOD SetNodeValue(const nsAString& aNodeValue);
NS_IMETHOD GetNodeType(PRUint16* aNodeType);
#if 0
NS_IMETHOD GetAttributes(nsIDOMNamedNodeMap** aAttributes);
#endif
NS_IMETHOD GetNamespaceURI(nsAString& aNamespaceURI);
NS_IMETHOD GetPrefix(nsAString& aPrefix);
NS_IMETHOD IsSupported(const nsAString& aFeature,
const nsAString& aVersion, bool* aReturn);
#if 0
NS_IMETHOD HasAttributes(bool* aHasAttributes);
#endif
NS_IMETHOD HasChildNodes(bool* aHasChildNodes);
nsresult InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
nsIDOMNode** aReturn)
@ -408,8 +420,10 @@ public:
return InsertBefore(aNewChild, nullptr, aReturn);
}
#if 0
// nsIDOMElement method implementation
NS_DECL_NSIDOMELEMENT
#endif
nsresult CloneNode(bool aDeep, PRUint8 aOptionalArgc, nsIDOMNode **aResult)
{
@ -546,6 +560,7 @@ public:
{
}
#if 0
PRInt32 GetScrollTop();
PRInt32 GetScrollLeft();
PRInt32 GetScrollHeight();
@ -584,6 +599,7 @@ public:
* that effectively live in mAttrsAndChildren.
*/
virtual nsAttrInfo GetAttrInfo(PRInt32 aNamespaceID, nsIAtom* aName) const;
#endif
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(FragmentOrElement)
@ -679,6 +695,7 @@ protected:
* @param aNotify should we notify document-observers?
* @param aCallAfterSetAttr should we call AfterSetAttr?
*/
#if 0
nsresult SetAttrAndNotify(PRInt32 aNamespaceID,
nsIAtom* aName,
nsIAtom* aPrefix,
@ -722,6 +739,7 @@ protected:
nsIAtom* aName,
nsAttrValue& aValue,
nsresult* aRetval);
#endif
/**
* Hook that is called by FragmentOrElement::SetAttr to allow subclasses to
@ -791,6 +809,7 @@ protected:
* @param aRect offset rectangle
* @param aOffsetParent offset parent
*/
#if 0
virtual void GetOffsetRect(nsRect& aRect, nsIContent** aOffsetParent);
/**
@ -810,6 +829,7 @@ protected:
nsresult GetAttributeNodeNSInternal(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMAttr** aReturn);
#endif
public:
// Because of a bug in MS C++ compiler nsDOMSlots must be declared public,
@ -906,6 +926,7 @@ protected:
OwnerDoc()->UnregisterFreezableElement(this);
}
#if 0
/**
* Add/remove this element to the documents id cache
*/
@ -930,6 +951,7 @@ protected:
}
}
}
#endif
/**
* Functions to carry out event default actions for links of all types
@ -980,10 +1002,13 @@ private:
* Get this element's client area rect in app units.
* @return the frame's client area
*/
#if 0
nsRect GetClientAreaRect();
nsIScrollableFrame* GetScrollFrame(nsIFrame **aStyledFrame = nullptr);
#endif
protected:
nsContentList* GetChildrenList();
};

View File

@ -135,6 +135,7 @@ PRInt32 nsIContent::sTabFocusModel = eTabFocus_any;
bool nsIContent::sTabFocusModelAppliesToXUL = false;
PRUint32 nsMutationGuard::sMutationCount = 0;
#if 0
nsEventStates
Element::IntrinsicState() const
{
@ -309,6 +310,7 @@ Element::ClearStyleStateLocks()
NotifyStyleStateChange(locks);
}
#endif
nsIContent*
nsIContent::FindFirstNonNativeAnonymous() const
@ -628,6 +630,7 @@ nsNode3Tearoff::LookupNamespaceURI(const nsAString& aNamespacePrefix,
return mNode->LookupNamespaceURI(aNamespacePrefix, aNamespaceURI);
}
#if 0
nsIContent*
FragmentOrElement::GetFirstElementChild()
{
@ -772,6 +775,7 @@ FragmentOrElement::GetNextElementSibling(nsIDOMElement** aResult)
return result ? CallQueryInterface(result, aResult) : NS_OK;
}
#endif
nsContentList*
FragmentOrElement::GetChildrenList()
@ -787,6 +791,7 @@ FragmentOrElement::GetChildrenList()
return slots->mChildrenList;
}
#if 0
nsDOMTokenList*
FragmentOrElement::GetClassList(nsresult *aResult)
{
@ -1183,6 +1188,7 @@ FragmentOrElement::GetClientRects(nsIDOMClientRectList** aResult)
*aResult = rectList.forget().get();
return NS_OK;
}
#endif
//----------------------------------------------------------------------
@ -1345,7 +1351,7 @@ FragmentOrElement::nsDOMSlots::Unlink(bool aIsXUL)
}
FragmentOrElement::FragmentOrElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: Element(aNodeInfo)
: nsIContent(aNodeInfo)
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::ELEMENT_NODE ||
(mNodeInfo->NodeType() ==
@ -1488,6 +1494,7 @@ FragmentOrElement::IsSupported(const nsAString& aFeature,
return InternalIsSupported(this, aFeature, aVersion, aReturn);
}
#if 0
NS_IMETHODIMP
FragmentOrElement::HasAttributes(bool* aReturn)
{
@ -1516,6 +1523,7 @@ FragmentOrElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
return NS_OK;
}
#endif
nsresult
FragmentOrElement::HasChildNodes(bool* aReturn)
@ -1525,6 +1533,7 @@ FragmentOrElement::HasChildNodes(bool* aReturn)
return NS_OK;
}
#if 0
NS_IMETHODIMP
FragmentOrElement::GetTagName(nsAString& aTagName)
{
@ -2225,6 +2234,7 @@ FragmentOrElement::UnbindFromTree(bool aDeep, bool aNullParent)
nsNodeUtils::ParentChainChanged(this);
}
#endif
already_AddRefed<nsINodeList>
FragmentOrElement::GetChildren(PRUint32 aFilter)
@ -2437,6 +2447,7 @@ FragmentOrElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
return NS_OK;
}
#if 0
nsICSSDeclaration*
FragmentOrElement::GetSMILOverrideStyle()
{
@ -2500,6 +2511,7 @@ FragmentOrElement::SetInlineStyleRule(css::StyleRule* aStyleRule,
NS_NOTYETIMPLEMENTED("FragmentOrElement::SetInlineStyleRule");
return NS_ERROR_NOT_IMPLEMENTED;
}
#endif
NS_IMETHODIMP_(bool)
FragmentOrElement::IsAttributeMapped(const nsIAtom* aAttribute) const
@ -3580,6 +3592,7 @@ FragmentOrElement::CopyInnerTo(FragmentOrElement* aDst)
return NS_OK;
}
#if 0
bool
FragmentOrElement::MaybeCheckSameAttrVal(PRInt32 aNamespaceID,
nsIAtom* aName,
@ -3834,6 +3847,7 @@ FragmentOrElement::SetMappedAttribute(nsIDocument* aDocument,
*aRetval = NS_OK;
return false;
}
#endif
nsEventListenerManager*
FragmentOrElement::GetEventListenerManagerForAttr(nsIAtom* aAttrName,
@ -3843,6 +3857,7 @@ FragmentOrElement::GetEventListenerManagerForAttr(nsIAtom* aAttrName,
return GetListenerManager(true);
}
#if 0
FragmentOrElement::nsAttrInfo
FragmentOrElement::GetAttrInfo(PRInt32 aNamespaceID, nsIAtom* aName) const
{
@ -4041,6 +4056,7 @@ FragmentOrElement::GetAttrCount() const
{
return mAttrsAndChildren.AttrCount();
}
#endif
const nsTextFragment*
FragmentOrElement::GetText()
@ -4090,6 +4106,7 @@ FragmentOrElement::AppendTextTo(nsAString& aResult)
NS_NOTREACHED("called FragmentOrElement::TextLength");
}
#if 0
#ifdef DEBUG
void
FragmentOrElement::ListAttributes(FILE* out) const
@ -4243,6 +4260,7 @@ FragmentOrElement::DumpContent(FILE* out, PRInt32 aIndent,
if(aIndent) fputs("\n", out);
}
#endif
#endif
PRUint32
FragmentOrElement::GetChildCount() const
@ -4646,6 +4664,7 @@ FragmentOrElement::doQuerySelectorAll(nsINode* aRoot,
}
#if 0
bool
FragmentOrElement::MozMatchesSelector(const nsAString& aSelector, nsresult* aResult)
{
@ -4677,11 +4696,12 @@ FragmentOrElement::MozMatchesSelector(const nsAString& aSelector, bool* aReturn)
return rv;
}
#endif
size_t
FragmentOrElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
{
return Element::SizeOfExcludingThis(aMallocSizeOf) +
return nsIContent::SizeOfExcludingThis(aMallocSizeOf) +
mAttrsAndChildren.SizeOfExcludingThis(aMallocSizeOf);
}
@ -4727,6 +4747,7 @@ FragmentOrElement::AttrValueToCORSMode(const nsAttrValue* aValue)
return CORSMode(aValue->GetEnumValue());
}
#if 0
NS_IMETHODIMP
FragmentOrElement::GetOnmouseenter(JSContext* cx, JS::Value* vp)
{
@ -4809,4 +4830,4 @@ nsresult FragmentOrElement::MozRequestFullScreen()
return NS_OK;
}
#endif

View File

@ -158,6 +158,7 @@ public:
}
}
#ifdef MOZILLA_INTERNAL_API
void GetPrefix(nsAString& aStr) const
{
if (IsAtom()) {
@ -167,6 +168,7 @@ public:
NodeInfo()->GetPrefix(aStr);
}
}
#endif
PRUint32 HashValue() const
{

View File

@ -12,7 +12,7 @@
#define nsAttrValue_h___
#include "nscore.h"
#include "nsString.h"
#include "nsStringGlue.h"
#include "nsStringBuffer.h"
#include "nsColor.h"
#include "nsCaseTreatment.h"

View File

@ -14,7 +14,7 @@
#include "nsISupports.h"
#include "nsTArray.h"
#include "nsString.h"
#include "nsStringGlue.h"
#include "nsIHTMLCollection.h"
#include "nsIDOMNodeList.h"
#include "nsINodeList.h"

View File

@ -11,7 +11,7 @@
#define nsDOMAttributeMap_h___
#include "nsIDOMNamedNodeMap.h"
#include "nsString.h"
#include "nsStringGlue.h"
#include "nsRefPtrHashtable.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIDOMNode.h"

View File

@ -17,7 +17,7 @@
using namespace mozilla;
using namespace mozilla::dom;
nsDOMTokenList::nsDOMTokenList(FragmentOrElement *aElement, nsIAtom* aAttrAtom)
nsDOMTokenList::nsDOMTokenList(nsGenericElement* aElement, nsIAtom* aAttrAtom)
: mElement(aElement),
mAttrAtom(aAttrAtom)
{

View File

@ -24,7 +24,7 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMTokenList)
NS_DECL_NSIDOMDOMTOKENLIST
nsDOMTokenList(mozilla::dom::FragmentOrElement* aElement, nsIAtom* aAttrAtom);
nsDOMTokenList(nsGenericElement* aElement, nsIAtom* aAttrAtom);
void DropReference();
@ -50,7 +50,7 @@ protected:
void AddInternal(const nsAttrValue* aAttr, const nsAString& aToken);
void RemoveInternal(const nsAttrValue* aAttr, const nsAString& aToken);
mozilla::dom::FragmentOrElement* mElement;
nsGenericElement* mElement;
nsCOMPtr<nsIAtom> mAttrAtom;
};

View File

@ -135,6 +135,7 @@ NS_DEFINE_IID(kThisPtrOffsetsSID, NS_THISPTROFFSETS_SID);
PRInt32 nsIContent::sTabFocusModel = eTabFocus_any;
bool nsIContent::sTabFocusModelAppliesToXUL = false;
PRUint32 nsMutationGuard::sMutationCount = 0;
#endif
nsEventStates
Element::IntrinsicState() const
@ -311,6 +312,7 @@ Element::ClearStyleStateLocks()
NotifyStyleStateChange(locks);
}
#if 0
nsIContent*
nsIContent::FindFirstNonNativeAnonymous() const
{
@ -628,6 +630,7 @@ nsNode3Tearoff::LookupNamespaceURI(const nsAString& aNamespacePrefix,
{
return mNode->LookupNamespaceURI(aNamespacePrefix, aNamespaceURI);
}
#endif
nsIContent*
nsGenericElement::GetFirstElementChild()
@ -774,6 +777,7 @@ nsGenericElement::GetNextElementSibling(nsIDOMElement** aResult)
return result ? CallQueryInterface(result, aResult) : NS_OK;
}
#if 0
nsContentList*
nsGenericElement::GetChildrenList()
{
@ -787,6 +791,7 @@ nsGenericElement::GetChildrenList()
return slots->mChildrenList;
}
#endif
nsDOMTokenList*
nsGenericElement::GetClassList(nsresult *aResult)
@ -1189,6 +1194,7 @@ nsGenericElement::GetClientRects(nsIDOMClientRectList** aResult)
//----------------------------------------------------------------------
#if 0
NS_IMPL_ISUPPORTS1(nsNodeWeakReference,
nsIWeakReference)
@ -1347,7 +1353,7 @@ nsGenericElement::nsDOMSlots::Unlink(bool aIsXUL)
#endif
nsGenericElement::nsGenericElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: FragmentOrElement(aNodeInfo)
: Element(aNodeInfo)
{
}
@ -1482,6 +1488,7 @@ nsGenericElement::IsSupported(const nsAString& aFeature,
{
return InternalIsSupported(this, aFeature, aVersion, aReturn);
}
#endif
NS_IMETHODIMP
nsGenericElement::HasAttributes(bool* aReturn)
@ -1512,6 +1519,7 @@ nsGenericElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
return NS_OK;
}
#if 0
nsresult
nsGenericElement::HasChildNodes(bool* aReturn)
{
@ -1519,6 +1527,7 @@ nsGenericElement::HasChildNodes(bool* aReturn)
return NS_OK;
}
#endif
NS_IMETHODIMP
nsGenericElement::GetTagName(nsAString& aTagName)
@ -2221,6 +2230,7 @@ nsGenericElement::UnbindFromTree(bool aDeep, bool aNullParent)
nsNodeUtils::ParentChainChanged(this);
}
#if 0
already_AddRefed<nsINodeList>
nsGenericElement::GetChildren(PRUint32 aFilter)
{
@ -2431,6 +2441,7 @@ nsGenericElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
{
return NS_OK;
}
#endif
nsICSSDeclaration*
nsGenericElement::GetSMILOverrideStyle()
@ -2496,6 +2507,7 @@ nsGenericElement::SetInlineStyleRule(css::StyleRule* aStyleRule,
return NS_ERROR_NOT_IMPLEMENTED;
}
#if 0
NS_IMETHODIMP_(bool)
nsGenericElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
@ -3512,6 +3524,7 @@ nsGenericElement::PostQueryInterface(REFNSIID aIID, void** aInstancePtr)
}
//----------------------------------------------------------------------
#if 0
nsresult
nsGenericElement::LeaveLink(nsPresContext* aPresContext)
{
@ -3548,6 +3561,7 @@ nsGenericElement::AddScriptEventListener(nsIAtom* aEventName,
defer, !nsContentUtils::IsChromeDoc(ownerDoc));
return NS_OK;
}
#endif
//----------------------------------------------------------------------
@ -3574,6 +3588,7 @@ nsGenericElement::CopyInnerTo(nsGenericElement* aDst)
return NS_OK;
}
#endif
bool
nsGenericElement::MaybeCheckSameAttrVal(PRInt32 aNamespaceID,
@ -3830,6 +3845,7 @@ nsGenericElement::SetMappedAttribute(nsIDocument* aDocument,
return false;
}
#if 0
nsEventListenerManager*
nsGenericElement::GetEventListenerManagerForAttr(nsIAtom* aAttrName,
bool* aDefer)
@ -3837,6 +3853,7 @@ nsGenericElement::GetEventListenerManagerForAttr(nsIAtom* aAttrName,
*aDefer = true;
return GetListenerManager(true);
}
#endif
nsGenericElement::nsAttrInfo
nsGenericElement::GetAttrInfo(PRInt32 aNamespaceID, nsIAtom* aName) const
@ -4037,6 +4054,7 @@ nsGenericElement::GetAttrCount() const
return mAttrsAndChildren.AttrCount();
}
#if 0
const nsTextFragment*
nsGenericElement::GetText()
{
@ -4084,6 +4102,7 @@ nsGenericElement::AppendTextTo(nsAString& aResult)
// to depend on this appending nothing.
NS_NOTREACHED("called nsGenericElement::TextLength");
}
#endif
#ifdef DEBUG
void
@ -4239,6 +4258,7 @@ nsGenericElement::DumpContent(FILE* out, PRInt32 aIndent,
}
#endif
#if 0
PRUint32
nsGenericElement::GetChildCount() const
{
@ -4482,6 +4502,7 @@ nsGenericElement::GetLinkTarget(nsAString& aTarget)
{
aTarget.Truncate();
}
#endif
// NOTE: The aPresContext pointer is NOT addrefed.
// *aSelectorList might be null even if NS_OK is returned; this
@ -4523,6 +4544,7 @@ ParseSelectorList(nsINode* aNode,
// Actually find elements matching aSelectorList (which must not be
// null) and which are descendants of aRoot and put them in aList. If
// onlyFirstMatch, then stop once the first one is found.
#if 0
template<bool onlyFirstMatch, class T>
inline static nsresult FindMatchingElements(nsINode* aRoot,
const nsAString& aSelector,
@ -4639,6 +4661,7 @@ nsGenericElement::doQuerySelectorAll(nsINode* aRoot,
return FindMatchingElements<false>(aRoot, aSelector, *contentList);
}
#endif
bool
@ -4673,6 +4696,7 @@ nsGenericElement::MozMatchesSelector(const nsAString& aSelector, bool* aReturn)
return rv;
}
#if 0
size_t
nsGenericElement::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf) const
{
@ -4721,6 +4745,7 @@ nsGenericElement::AttrValueToCORSMode(const nsAttrValue* aValue)
return CORSMode(aValue->GetEnumValue());
}
#endif
NS_IMETHODIMP
nsGenericElement::GetOnmouseenter(JSContext* cx, JS::Value* vp)
@ -4804,4 +4829,3 @@ nsresult nsGenericElement::MozRequestFullScreen()
return NS_OK;
}
#endif

View File

@ -209,7 +209,7 @@ class nsInlineEventHandlersTearoff;
* A generic base class for DOM elements, implementing many nsIContent,
* nsIDOMNode and nsIDOMElement methods.
*/
class nsGenericElement : public mozilla::dom::FragmentOrElement
class nsGenericElement : public mozilla::dom::Element
{
public:
nsGenericElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -241,6 +241,7 @@ public:
NS_IMETHOD SetTextContent(const nsAString& aTextContent);
// nsIContent interface methods
#endif
virtual void UpdateEditableState(bool aNotify);
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
@ -248,9 +249,11 @@ public:
bool aCompileEventHandlers);
virtual void UnbindFromTree(bool aDeep = true,
bool aNullParent = true);
#if 0
virtual already_AddRefed<nsINodeList> GetChildren(PRUint32 aFilter);
virtual nsIAtom *GetClassAttributeName() const;
virtual already_AddRefed<nsINodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const;
#endif
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
const nsAString& aValue, bool aNotify)
{
@ -299,6 +302,7 @@ public:
bool aNotify);
virtual const nsAttrName* GetAttrNameAt(PRUint32 aIndex) const;
virtual PRUint32 GetAttrCount() const;
#if 0
virtual const nsTextFragment *GetText();
virtual PRUint32 TextLength() const;
virtual nsresult SetText(const PRUnichar* aBuffer, PRUint32 aLength,
@ -318,6 +322,7 @@ public:
virtual void DestroyContent();
virtual void SaveSubtreeState();
#endif
virtual nsISMILAttr* GetAnimatedAttr(PRInt32 /*aNamespaceID*/, nsIAtom* /*aName*/)
{
@ -339,12 +344,15 @@ public:
void ListAttributes(FILE* out) const;
#endif
#if 0
virtual const nsAttrValue* DoGetClasses() const;
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
#endif
virtual mozilla::css::StyleRule* GetInlineStyleRule();
virtual nsresult SetInlineStyleRule(mozilla::css::StyleRule* aStyleRule,
const nsAString* aSerialized,
bool aNotify);
#if 0
NS_IMETHOD_(bool)
IsAttributeMapped(const nsIAtom* aAttribute) const;
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
@ -387,12 +395,16 @@ public:
NS_IMETHOD GetNodeValue(nsAString& aNodeValue);
NS_IMETHOD SetNodeValue(const nsAString& aNodeValue);
NS_IMETHOD GetNodeType(PRUint16* aNodeType);
#endif
NS_IMETHOD GetAttributes(nsIDOMNamedNodeMap** aAttributes);
#if 0
NS_IMETHOD GetNamespaceURI(nsAString& aNamespaceURI);
NS_IMETHOD GetPrefix(nsAString& aPrefix);
NS_IMETHOD IsSupported(const nsAString& aFeature,
const nsAString& aVersion, bool* aReturn);
#endif
NS_IMETHOD HasAttributes(bool* aHasAttributes);
#if 0
NS_IMETHOD HasChildNodes(bool* aHasChildNodes);
nsresult InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
nsIDOMNode** aReturn)
@ -412,10 +424,12 @@ public:
{
return InsertBefore(aNewChild, nullptr, aReturn);
}
#endif
// nsIDOMElement method implementation
NS_DECL_NSIDOMELEMENT
#if 0
nsresult CloneNode(bool aDeep, PRUint8 aOptionalArgc, nsIDOMNode **aResult)
{
if (!aOptionalArgc) {
@ -550,6 +564,7 @@ public:
virtual void RecompileScriptEventListeners()
{
}
#endif
PRInt32 GetScrollTop();
PRInt32 GetScrollLeft();
@ -590,6 +605,7 @@ public:
*/
virtual nsAttrInfo GetAttrInfo(PRInt32 aNamespaceID, nsIAtom* aName) const;
#if 0
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsGenericElement)
virtual void NodeInfoChanged(nsINodeInfo* aOldNodeInfo)
@ -663,6 +679,7 @@ protected:
static const bool kDontNotifyDocumentObservers = false;
static const bool kCallAfterSetAttr = true;
static const bool kDontCallAfterSetAttr = false;
#endif
/**
* Set attribute and (if needed) notify documentobservers and fire off
@ -746,6 +763,7 @@ protected:
*/
// Note that this is inlined so that when subclasses call it it gets
// inlined. Those calls don't go through a vtable.
#if 0
virtual nsresult BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
const nsAttrValueOrString* aValue,
bool aNotify)
@ -790,6 +808,7 @@ protected:
* Internal hook for converting an attribute name-string to an atomized name
*/
virtual const nsAttrName* InternalGetExistingAttrNameFromQName(const nsAString& aStr) const;
#endif
/**
* Retrieve the rectangle for the offsetX properties, which
@ -817,7 +836,6 @@ protected:
nsresult GetAttributeNodeNSInternal(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMAttr** aReturn);
#endif
public:
#if 0
@ -917,6 +935,7 @@ protected:
OwnerDoc()->UnregisterFreezableElement(this);
}
#endif
/**
* Add/remove this element to the documents id cache
*/
@ -941,6 +960,7 @@ protected:
}
}
}
#if 0
/**
* Functions to carry out event default actions for links of all types
@ -988,7 +1008,6 @@ protected:
#endif
private:
#if 0
/**
* Get this element's client area rect in app units.
* @return the frame's client area
@ -997,6 +1016,7 @@ private:
nsIScrollableFrame* GetScrollFrame(nsIFrame **aStyledFrame = nullptr);
#if 0
nsContentList* GetChildrenList();
#endif
};

View File

@ -68,7 +68,7 @@ protected:
virtual bool ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute,
const nsAString& aValue, nsAttrValue& aResult);
friend class mozilla::dom::FragmentOrElement;
friend class nsGenericElement;
/**
* Create the style struct from the style attr. Used when an element is

View File

@ -6,12 +6,13 @@
#ifndef NS_ISMILATTR_H_
#define NS_ISMILATTR_H_
#include "nsStringFwd.h"
#include "nscore.h"
class nsSMILValue;
class nsISMILType;
class nsISMILAnimationElement;
class nsIContent;
class nsAString;
////////////////////////////////////////////////////////////////////////
// nsISMILAttr: A variable targeted by SMIL for animation and can therefore have

View File

@ -12,7 +12,7 @@
* types don't need to be exported outside the SVG module.
*/
#include "nsString.h"
#include "nsStringGlue.h"
class nsSVGAngle;
class nsSVGIntegerPair;