Bug 232480: Make nsGenericHTMLElement inherit nsGenericContainerElement and kill the concept of leaf vs. container elements. Also remove unused argument to CopyInnerOf

r=peterv sr=jst
This commit is contained in:
sicking%bigfoot.com 2004-02-10 19:36:43 +00:00
Родитель 2b092d8bdd
Коммит 99077ffa6f
64 изменённых файлов: 813 добавлений и 1711 удалений

Просмотреть файл

@ -289,9 +289,8 @@ private:
//----------------------------------------------------------------------
/**
* Mostly implement the nsIDOMNode API by forwarding the methods to a
* generic content object (either nsGenericHTMLLeafElement or
* nsGenericHTMLContainerContent)
* Mostly implement the nsIDOMNode API by forwarding the methods to
* nsGenericDOMDataNode
*
* Note that classes using this macro will need to implement:
* NS_IMETHOD GetNodeType(PRUint16* aNodeType);

Просмотреть файл

@ -1230,6 +1230,58 @@ nsGenericElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
return NS_OK;
}
nsresult
nsGenericElement::GetChildNodes(nsIDOMNodeList** aChildNodes)
{
nsDOMSlots *slots = GetDOMSlots();
if (!slots->mChildNodes) {
slots->mChildNodes = new nsChildContentList(this);
if (!slots->mChildNodes) {
return NS_ERROR_OUT_OF_MEMORY;
}
}
NS_ADDREF(*aChildNodes = slots->mChildNodes);
return NS_OK;
}
nsresult
nsGenericElement::HasChildNodes(PRBool* aReturn)
{
*aReturn = mAttrsAndChildren.ChildCount() > 0;
return NS_OK;
}
nsresult
nsGenericElement::GetFirstChild(nsIDOMNode** aNode)
{
nsIContent *child = mAttrsAndChildren.GetSafeChildAt(0);
if (child) {
return CallQueryInterface(child, aNode);
}
*aNode = nsnull;
return NS_OK;
}
nsresult
nsGenericElement::GetLastChild(nsIDOMNode** aNode)
{
PRUint32 count = mAttrsAndChildren.ChildCount();
if (count > 0) {
return CallQueryInterface(mAttrsAndChildren.ChildAt(count - 1), aNode);
}
*aNode = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsGenericElement::GetTagName(nsAString& aTagName)
{
@ -2126,6 +2178,8 @@ nsGenericElement::GetExistingAttrNameFromQName(const nsAString& aStr) const
NS_IMETHODIMP
nsGenericElement::Compact()
{
mAttrsAndChildren.Compact();
return NS_OK;
}
@ -2433,16 +2487,15 @@ nsGenericElement::InsertChildAt(nsIContent* aKid,
{
NS_PRECONDITION(aKid, "null ptr");
mozAutoDocUpdate updateBatch(mDocument, UPDATE_CONTENT_MODEL, aNotify);
PRBool isAppend;
if (aNotify) {
isAppend = aIndex == GetChildCount();
}
if (!InternalInsertChildAt(aKid, aIndex)) {
return NS_OK;
}
nsresult rv = mAttrsAndChildren.InsertChildAt(aKid, aIndex);
NS_ENSURE_SUCCESS(rv, rv);
aKid->SetParent(this);
nsRange::OwnerChildInserted(this, aIndex);
@ -2480,10 +2533,8 @@ nsGenericElement::ReplaceChildAt(nsIContent* aKid,
mozAutoDocUpdate updateBatch(mDocument, UPDATE_CONTENT_MODEL, aNotify);
nsRange::OwnerChildReplaced(this, aIndex, oldKid);
if (!InternalReplaceChildAt(aKid, aIndex)) {
return NS_OK;
}
mAttrsAndChildren.ReplaceChildAt(aKid, aIndex);
aKid->SetParent(this);
if (mDocument) {
@ -2516,9 +2567,8 @@ nsGenericElement::AppendChildTo(nsIContent* aKid, PRBool aNotify,
NS_PRECONDITION(aKid && this != aKid, "null ptr");
mozAutoDocUpdate updateBatch(mDocument, UPDATE_CONTENT_MODEL, aNotify);
if (!InternalAppendChildTo(aKid)) {
return NS_OK;
}
nsresult rv = mAttrsAndChildren.AppendChild(aKid);
NS_ENSURE_SUCCESS(rv, rv);
aKid->SetParent(this);
// ranges don't need adjustment since new child is at end of list
@ -2559,10 +2609,8 @@ nsGenericElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify)
nsRange::OwnerChildRemoved(this, aIndex, oldKid);
if (!InternalRemoveChildAt(aIndex)) {
return NS_OK;
}
mAttrsAndChildren.RemoveChildAt(aIndex);
if (aNotify && mDocument) {
mDocument->ContentRemoved(this, oldKid, aIndex);
}
@ -3187,8 +3235,7 @@ nsGenericContainerElement::InternalGetExistingAttrNameFromQName(const nsAString&
}
nsresult
nsGenericContainerElement::CopyInnerTo(nsIContent* aSrcContent,
nsGenericContainerElement* aDst,
nsGenericContainerElement::CopyInnerTo(nsGenericContainerElement* aDst,
PRBool aDeep)
{
nsresult rv;
@ -3225,58 +3272,6 @@ nsGenericContainerElement::CopyInnerTo(nsIContent* aSrcContent,
return NS_OK;
}
nsresult
nsGenericContainerElement::GetChildNodes(nsIDOMNodeList** aChildNodes)
{
nsDOMSlots *slots = GetDOMSlots();
if (!slots->mChildNodes) {
slots->mChildNodes = new nsChildContentList(this);
if (!slots->mChildNodes) {
return NS_ERROR_OUT_OF_MEMORY;
}
}
NS_ADDREF(*aChildNodes = slots->mChildNodes);
return NS_OK;
}
nsresult
nsGenericContainerElement::HasChildNodes(PRBool* aReturn)
{
*aReturn = mAttrsAndChildren.ChildCount() > 0;
return NS_OK;
}
nsresult
nsGenericContainerElement::GetFirstChild(nsIDOMNode** aNode)
{
nsIContent *child = mAttrsAndChildren.GetSafeChildAt(0);
if (child) {
return CallQueryInterface(child, aNode);
}
*aNode = nsnull;
return NS_OK;
}
nsresult
nsGenericContainerElement::GetLastChild(nsIDOMNode** aNode)
{
PRUint32 count = mAttrsAndChildren.ChildCount();
if (count) {
return CallQueryInterface(mAttrsAndChildren.ChildAt(count - 1), aNode);
}
*aNode = nsnull;
return NS_OK;
}
static PRBool
NodeHasMutationListeners(nsISupports* aNode)
{
@ -3471,30 +3466,35 @@ nsGenericContainerElement::UnsetAttr(PRInt32 aNameSpaceID,
}
mozAutoDocUpdate updateBatch(mDocument, UPDATE_CONTENT_MODEL, aNotify);
if (aNotify && mDocument) {
mDocument->AttributeWillChange(this, aNameSpaceID, aName);
}
if (mDocument) {
if (aNotify) {
mDocument->AttributeWillChange(this, aNameSpaceID, aName);
}
if (HasMutationListeners(this, NS_EVENT_BITS_MUTATION_ATTRMODIFIED)) {
nsCOMPtr<nsIDOMEventTarget> node(do_QueryInterface(NS_STATIC_CAST(nsIContent *, this)));
nsMutationEvent mutation(NS_MUTATION_ATTRMODIFIED, node);
if (HasMutationListeners(this, NS_EVENT_BITS_MUTATION_ATTRMODIFIED)) {
nsCOMPtr<nsIDOMEventTarget> node(do_QueryInterface(NS_STATIC_CAST(nsIContent *, this)));
nsMutationEvent mutation(NS_MUTATION_ATTRMODIFIED, node);
nsAutoString attrName;
aName->ToString(attrName);
nsCOMPtr<nsIDOMAttr> attrNode;
GetAttributeNode(attrName, getter_AddRefs(attrNode));
mutation.mRelatedNode = attrNode;
mutation.mAttrName = aName;
nsAutoString attrName;
aName->ToString(attrName);
nsCOMPtr<nsIDOMAttr> attrNode;
GetAttributeNode(attrName, getter_AddRefs(attrNode));
mutation.mRelatedNode = attrNode;
mutation.mAttrName = aName;
nsAutoString value;
mAttrsAndChildren.AttrAt(index)->ToString(value);
if (!value.IsEmpty())
mutation.mPrevAttrValue = do_GetAtom(value);
mutation.mAttrChange = nsIDOMMutationEvent::REMOVAL;
nsAutoString value;
// It sucks that we have to call GetAttr here, but HTML can't always
// get the value from the nsAttrAndChildArray. Specifically enums and
// nsISupports can't be converted to strings.
GetAttr(aNameSpaceID, aName, value);
if (!value.IsEmpty())
mutation.mPrevAttrValue = do_GetAtom(value);
mutation.mAttrChange = nsIDOMMutationEvent::REMOVAL;
nsEventStatus status = nsEventStatus_eIgnore;
this->HandleDOMEvent(nsnull, &mutation, nsnull,
NS_EVENT_FLAG_INIT, &status);
nsEventStatus status = nsEventStatus_eIgnore;
HandleDOMEvent(nsnull, &mutation, nsnull,
NS_EVENT_FLAG_INIT, &status);
}
}
nsresult rv = mAttrsAndChildren.RemoveAttrAt(index);

Просмотреть файл

@ -156,7 +156,7 @@ public:
/**
* An object implementing nsIDOMNodeList for this content (childNodes)
* @see nsIDOMNodeList
* @see nsGenericHTMLLeafElement::GetChildNodes
* @see nsGenericHTMLElement::GetChildNodes
*/
nsRefPtr<nsChildContentList> mChildNodes;
@ -391,8 +391,6 @@ public:
virtual nsresult GetListenerManager(nsIEventListenerManager** aResult);
virtual already_AddRefed<nsIURI> GetBaseURI() const;
// Declare these here so we can consolidate the implementations.
// Subclasses that don't want to implement these should override.
virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument);
virtual nsresult ReplaceChildAt(nsIContent* aKid, PRUint32 aIndex,
@ -401,7 +399,6 @@ public:
PRBool aDeepSetDocument);
virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify);
// nsIStyledContent interface methods
NS_IMETHOD GetID(nsIAtom** aResult) const;
NS_IMETHOD GetClasses(nsVoidArray& aArray) const;
@ -463,6 +460,28 @@ public:
NS_IMETHOD IsSupported(const nsAString& aFeature,
const nsAString& aVersion, PRBool* aReturn);
NS_IMETHOD HasAttributes(PRBool* aHasAttributes);
NS_IMETHOD GetChildNodes(nsIDOMNodeList** aChildNodes);
NS_IMETHOD HasChildNodes(PRBool* aHasChildNodes);
NS_IMETHOD GetFirstChild(nsIDOMNode** aFirstChild);
NS_IMETHOD GetLastChild(nsIDOMNode** aLastChild);
NS_IMETHOD InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
nsIDOMNode** aReturn)
{
return doInsertBefore(this, aNewChild, aRefChild, aReturn);
}
NS_IMETHOD ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild,
nsIDOMNode** aReturn)
{
return doReplaceChild(this, aNewChild, aOldChild, aReturn);
}
NS_IMETHOD RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn)
{
return doRemoveChild(this, aOldChild, aReturn);
}
NS_IMETHOD AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn)
{
return doInsertBefore(this, aNewChild, nsnull, aReturn);
}
// nsIDOMElement method implementation
NS_IMETHOD GetTagName(nsAString& aTagName);
@ -600,29 +619,6 @@ public:
static PLDHashTable sRangeListsHash;
protected:
/**
* InsertChildAt/ReplaceChildAt/AppendChildTo/RemoveChildAt subclass
* hooks. These methods are called to perform the actual moving
* around of content nodes in child lists. The return value should
* be true if something changed, false otherwise.
*
* These methods should not change the refcount on the kids in question;
* that's handled by the
* InsertChildAt/ReplaceChildAt/AppendChildTo/RemoveChildAt functions.
*/
virtual PRBool InternalInsertChildAt(nsIContent* aKid, PRUint32 aIndex) {
return PR_FALSE;
}
virtual PRBool InternalReplaceChildAt(nsIContent* aKid, PRUint32 aIndex) {
return PR_FALSE;
}
virtual PRBool InternalAppendChildTo(nsIContent* aKid) {
return PR_FALSE;
}
virtual PRBool InternalRemoveChildAt(PRUint32 aIndex) {
return PR_FALSE;
}
/**
* Internal hook for converting an attribute name-string to an atomized name
*/
@ -740,6 +736,11 @@ protected:
* member.
*/
PtrBits mFlagsOrSlots;
/**
* Array containing all attributes and children for this element
*/
nsAttrAndChildArray mAttrsAndChildren;
};
/**
@ -754,50 +755,9 @@ public:
* @param aDest the destination object
* @param aDeep whether to copy children
*/
// XXX This can probably be static
NS_IMETHOD CopyInnerTo(nsIContent* aSrcContent,
nsGenericContainerElement* aDest,
NS_IMETHOD CopyInnerTo(nsGenericContainerElement* aDest,
PRBool aDeep);
// nsIDOMElement methods
NS_METHOD GetAttribute(const nsAString& aName,
nsAString& aReturn)
{
return nsGenericElement::GetAttribute(aName, aReturn);
}
NS_METHOD SetAttribute(const nsAString& aName,
const nsAString& aValue)
{
return nsGenericElement::SetAttribute(aName, aValue);
}
// Remainder of nsIDOMHTMLElement (and nsIDOMNode)
NS_IMETHOD GetChildNodes(nsIDOMNodeList** aChildNodes);
NS_IMETHOD HasChildNodes(PRBool* aHasChildNodes);
NS_IMETHOD GetFirstChild(nsIDOMNode** aFirstChild);
NS_IMETHOD GetLastChild(nsIDOMNode** aLastChild);
NS_IMETHOD InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
nsIDOMNode** aReturn)
{
return nsGenericElement::doInsertBefore(this, aNewChild, aRefChild,
aReturn);
}
NS_IMETHOD ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild,
nsIDOMNode** aReturn)
{
return nsGenericElement::doReplaceChild(this, aNewChild, aOldChild,
aReturn);
}
NS_IMETHOD RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn)
{
return nsGenericElement::doRemoveChild(this, aOldChild, aReturn);
}
NS_IMETHOD AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn)
{
return nsGenericElement::doInsertBefore(this, aNewChild, nsnull, aReturn);
}
// Remainder of nsIContent
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
const nsAString& aValue, PRBool aNotify)
@ -823,33 +783,11 @@ public:
virtual nsIContent *GetChildAt(PRUint32 aIndex) const;
virtual PRInt32 IndexOf(nsIContent* aPossibleChild) const;
// Child list modification hooks
virtual PRBool InternalInsertChildAt(nsIContent* aKid, PRUint32 aIndex) {
return NS_SUCCEEDED(mAttrsAndChildren.InsertChildAt(aKid, aIndex));
}
virtual PRBool InternalReplaceChildAt(nsIContent* aKid, PRUint32 aIndex) {
mAttrsAndChildren.ReplaceChildAt(aKid, aIndex);
return PR_TRUE;
}
virtual PRBool InternalAppendChildTo(nsIContent* aKid) {
return NS_SUCCEEDED(mAttrsAndChildren.AppendChild(aKid));
}
virtual PRBool InternalRemoveChildAt(PRUint32 aIndex) {
mAttrsAndChildren.RemoveChildAt(aIndex);
return PR_TRUE;
}
virtual const nsAttrName* InternalGetExistingAttrNameFromQName(const nsAString& aStr) const;
#ifdef DEBUG
void ListAttributes(FILE* out) const;
#endif
protected:
/**
* Array containing all attributes and children for this element
*/
nsAttrAndChildArray mAttrsAndChildren;
};

Просмотреть файл

@ -272,8 +272,7 @@ nsGenericHTMLElement::Shutdown()
}
nsresult
nsGenericHTMLElement::CopyInnerTo(nsIContent* aSrcContent,
nsGenericHTMLElement* aDst,
nsGenericHTMLElement::CopyInnerTo(nsGenericHTMLElement* aDst,
PRBool aDeep)
{
nsresult rv = NS_OK;
@ -332,7 +331,26 @@ nsGenericHTMLElement::CopyInnerTo(nsIContent* aSrcContent,
aDst->SetContentID(id);
return rv;
if (aDeep) {
PRInt32 i;
PRInt32 count = mAttrsAndChildren.ChildCount();
for (i = 0; i < count; ++i) {
nsCOMPtr<nsIDOMNode> node =
do_QueryInterface(mAttrsAndChildren.ChildAt(i));
NS_ASSERTION(node, "child doesn't implement nsIDOMNode");
nsCOMPtr<nsIDOMNode> newNode;
rv = node->CloneNode(aDeep, getter_AddRefs(newNode));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIContent> newContent(do_QueryInterface(newNode));
NS_ASSERTION(newContent, "clone doesn't implement nsIContent");
rv = aDst->AppendChildTo(newContent, PR_FALSE, PR_FALSE);
NS_ENSURE_SUCCESS(rv, rv);
}
}
return NS_OK;
}
nsresult
@ -1274,20 +1292,18 @@ nsGenericHTMLElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
}
}
nsresult
nsGenericHTMLElement::FindForm(nsIDOMHTMLFormElement **aForm)
already_AddRefed<nsIDOMHTMLFormElement>
nsGenericHTMLElement::FindForm()
{
// XXX: Namespaces!!!
nsIContent* content = this;
*aForm = nsnull;
while (content) {
// If the current ancestor is a form, return it as our form
if (content->IsContentOfType(nsIContent::eHTML) &&
content->GetNodeInfo()->Equals(nsHTMLAtoms::form)) {
return CallQueryInterface(content, aForm);
nsIDOMHTMLFormElement* form;
CallQueryInterface(content, &form);
return form;
}
nsIContent *tmp = content;
@ -1309,18 +1325,6 @@ nsGenericHTMLElement::FindForm(nsIDOMHTMLFormElement **aForm)
return NS_OK;
}
void
nsGenericHTMLElement::FindAndSetForm(nsIFormControl *aFormControl)
{
nsCOMPtr<nsIDOMHTMLFormElement> form;
FindForm(getter_AddRefs(form));
if (form) {
aFormControl->SetForm(form); // always succeeds
}
}
static PRBool
IsArea(nsIContent *aContent)
{
@ -1887,8 +1891,6 @@ nsresult
nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify)
{
nsresult result = NS_OK;
// Check for event handlers
if (aNameSpaceID == kNameSpaceID_None &&
IsEventName(aAttribute)) {
@ -1896,58 +1898,12 @@ nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
GetListenerManager(getter_AddRefs(manager));
if (manager) {
result = manager->RemoveScriptEventListener(aAttribute);
manager->RemoveScriptEventListener(aAttribute);
}
}
mozAutoDocUpdate updateBatch(mDocument, UPDATE_CONTENT_MODEL, aNotify);
if (mDocument) {
if (aNotify) {
mDocument->AttributeWillChange(this, aNameSpaceID, aAttribute);
}
if (nsGenericElement::HasMutationListeners(this, NS_EVENT_BITS_MUTATION_ATTRMODIFIED)) {
nsCOMPtr<nsIDOMEventTarget> node(do_QueryInterface(NS_STATIC_CAST(nsIContent *, this)));
nsMutationEvent mutation(NS_MUTATION_ATTRMODIFIED, node);
nsAutoString attrName;
aAttribute->ToString(attrName);
nsCOMPtr<nsIDOMAttr> attrNode;
GetAttributeNode(attrName, getter_AddRefs(attrNode));
mutation.mRelatedNode = attrNode;
mutation.mAttrName = aAttribute;
nsAutoString attr;
GetAttr(aNameSpaceID, aAttribute, attr);
if (!attr.IsEmpty())
mutation.mPrevAttrValue = do_GetAtom(attr);
mutation.mAttrChange = nsIDOMMutationEvent::REMOVAL;
nsEventStatus status = nsEventStatus_eIgnore;
HandleDOMEvent(nsnull, &mutation, nsnull,
NS_EVENT_FLAG_INIT, &status);
}
}
PRInt32 index = mAttrsAndChildren.IndexOfAttr(aAttribute);
if (index >= 0) {
mAttrsAndChildren.RemoveAttrAt(index);
}
if (mDocument) {
nsCOMPtr<nsIXBLBinding> binding;
mDocument->GetBindingManager()->GetBinding(this, getter_AddRefs(binding));
if (binding)
binding->AttributeChanged(aAttribute, aNameSpaceID, PR_TRUE, aNotify);
if (aNotify) {
mDocument->AttributeChanged(this, aNameSpaceID, aAttribute,
nsIDOMMutationEvent::REMOVAL);
}
}
return result;
return nsGenericContainerElement::UnsetAttr(aNameSpaceID, aAttribute,
aNotify);
}
nsresult
@ -2005,14 +1961,6 @@ nsGenericHTMLElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
PRBool
nsGenericHTMLElement::HasAttr(PRInt32 aNameSpaceID, nsIAtom* aName) const
{
NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown,
"must have a real namespace ID!");
return mAttrsAndChildren.IndexOfAttr(aName, aNameSpaceID) >= 0;
}
nsresult
nsGenericHTMLElement::GetHTMLAttribute(nsIAtom* aAttribute,
nsHTMLValue& aValue) const
@ -2047,34 +1995,6 @@ nsGenericHTMLElement::GetHTMLAttribute(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
nsresult
nsGenericHTMLElement::GetAttrNameAt(PRUint32 aIndex,
PRInt32* aNameSpaceID,
nsIAtom** aName,
nsIAtom** aPrefix) const
{
const nsAttrName* name = mAttrsAndChildren.GetSafeAttrNameAt(aIndex);
if (name) {
*aNameSpaceID = name->NamespaceID();
NS_ADDREF(*aName = name->LocalName());
NS_IF_ADDREF(*aPrefix = name->GetPrefix());
return NS_OK;
}
*aNameSpaceID = kNameSpaceID_None;
*aName = nsnull;
*aPrefix = nsnull;
return NS_ERROR_ILLEGAL_VALUE;
}
PRUint32
nsGenericHTMLElement::GetAttrCount() const
{
return mAttrsAndChildren.AttrCount();
}
nsresult
nsGenericHTMLElement::GetID(nsIAtom** aResult) const
{
@ -3365,162 +3285,8 @@ nsGenericHTMLElement::MapScrollingAttributeInto(const nsMappedAttributes* aAttri
//----------------------------------------------------------------------
nsresult
nsGenericHTMLLeafElement::CopyInnerTo(nsIContent* aSrcContent,
nsGenericHTMLLeafElement* aDst,
PRBool aDeep)
{
nsresult result = nsGenericHTMLElement::CopyInnerTo(aSrcContent,
aDst,
aDeep);
return result;
}
NS_IMETHODIMP
nsGenericHTMLLeafElement::GetChildNodes(nsIDOMNodeList** aChildNodes)
{
nsDOMSlots* slots = GetDOMSlots();
if (!slots->mChildNodes) {
slots->mChildNodes = new nsChildContentList(nsnull);
if (!slots->mChildNodes) {
return NS_ERROR_OUT_OF_MEMORY;
}
}
NS_ADDREF(*aChildNodes = slots->mChildNodes);
return NS_OK;
}
//----------------------------------------------------------------------
nsresult
nsGenericHTMLContainerElement::CopyInnerTo(nsIContent* aSrcContent,
nsGenericHTMLContainerElement* aDst,
PRBool aDeep)
{
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aSrcContent, aDst, aDeep);
if (NS_FAILED(rv)) {
return rv;
}
if (aDeep) {
PRInt32 indx;
PRInt32 count = mAttrsAndChildren.ChildCount();
for (indx = 0; indx < count; indx++) {
nsCOMPtr<nsIDOMNode> node =
do_QueryInterface(mAttrsAndChildren.ChildAt(indx));
if (node) {
nsCOMPtr<nsIDOMNode> newNode;
rv = node->CloneNode(aDeep, getter_AddRefs(newNode));
if (node) {
nsCOMPtr<nsIContent> newContent(do_QueryInterface(newNode));
if (newContent) {
rv = aDst->AppendChildTo(newContent, PR_FALSE, PR_FALSE);
}
}
}
if (NS_FAILED(rv)) {
return rv;
}
}
}
return NS_OK;
}
nsresult
nsGenericHTMLContainerElement::GetChildNodes(nsIDOMNodeList** aChildNodes)
{
nsDOMSlots *slots = GetDOMSlots();
if (!slots->mChildNodes) {
slots->mChildNodes = new nsChildContentList(this);
if (!slots->mChildNodes) {
return NS_ERROR_OUT_OF_MEMORY;
}
}
NS_ADDREF(*aChildNodes = slots->mChildNodes);
return NS_OK;
}
NS_IMETHODIMP
nsGenericHTMLContainerElement::HasChildNodes(PRBool* aReturn)
{
*aReturn = mAttrsAndChildren.ChildCount() > 0;
return NS_OK;
}
NS_IMETHODIMP
nsGenericHTMLContainerElement::GetFirstChild(nsIDOMNode** aNode)
{
nsIContent *child = mAttrsAndChildren.GetSafeChildAt(0);
if (child) {
return CallQueryInterface(child, aNode);
}
*aNode = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsGenericHTMLContainerElement::GetLastChild(nsIDOMNode** aNode)
{
PRUint32 count = mAttrsAndChildren.ChildCount();
if (count) {
return CallQueryInterface(mAttrsAndChildren.ChildAt(count - 1), aNode);
}
*aNode = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsGenericHTMLContainerElement::Compact()
{
mAttrsAndChildren.Compact();
return NS_OK;
}
PRBool
nsGenericHTMLContainerElement::CanContainChildren() const
{
return PR_TRUE;
}
PRUint32
nsGenericHTMLContainerElement::GetChildCount() const
{
return mAttrsAndChildren.ChildCount();
}
nsIContent *
nsGenericHTMLContainerElement::GetChildAt(PRUint32 aIndex) const
{
return mAttrsAndChildren.GetSafeChildAt(aIndex);
}
PRInt32
nsGenericHTMLContainerElement::IndexOf(nsIContent* aPossibleChild) const
{
return mAttrsAndChildren.IndexOfChild(aPossibleChild);
}
nsresult
nsGenericHTMLContainerElement::ReplaceContentsWithText(const nsAString& aText,
PRBool aNotify)
nsGenericHTMLElement::ReplaceContentsWithText(const nsAString& aText,
PRBool aNotify)
{
PRUint32 count = GetChildCount();
nsresult rv = NS_OK;
@ -3554,7 +3320,7 @@ nsGenericHTMLContainerElement::ReplaceContentsWithText(const nsAString& aText,
}
nsresult
nsGenericHTMLContainerElement::GetContentsAsText(nsAString& aText)
nsGenericHTMLElement::GetContentsAsText(nsAString& aText)
{
aText.Truncate();
PRInt32 children = GetChildCount();
@ -3580,31 +3346,31 @@ nsGenericHTMLContainerElement::GetContentsAsText(nsAString& aText)
//----------------------------------------------------------------------
nsGenericHTMLContainerFormElement::nsGenericHTMLContainerFormElement()
nsGenericHTMLFormElement::nsGenericHTMLFormElement()
{
mForm = nsnull;
}
nsGenericHTMLContainerFormElement::~nsGenericHTMLContainerFormElement()
nsGenericHTMLFormElement::~nsGenericHTMLFormElement()
{
// Clean up. Set the form to nsnull so it knows we went away.
SetForm(nsnull);
}
NS_INTERFACE_MAP_BEGIN(nsGenericHTMLContainerFormElement)
NS_INTERFACE_MAP_BEGIN(nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIFormControl)
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
PRBool
nsGenericHTMLContainerFormElement::IsContentOfType(PRUint32 aFlags) const
nsGenericHTMLFormElement::IsContentOfType(PRUint32 aFlags) const
{
return !(aFlags & ~(eELEMENT | eHTML | eHTML_FORM_CONTROL));
}
NS_IMETHODIMP
nsGenericHTMLContainerFormElement::SetForm(nsIDOMHTMLFormElement* aForm,
PRBool aRemoveFromForm)
nsGenericHTMLFormElement::SetForm(nsIDOMHTMLFormElement* aForm,
PRBool aRemoveFromForm)
{
nsAutoString nameVal, idVal;
@ -3649,7 +3415,7 @@ nsGenericHTMLContainerFormElement::SetForm(nsIDOMHTMLFormElement* aForm,
}
NS_IMETHODIMP
nsGenericHTMLContainerFormElement::GetForm(nsIDOMHTMLFormElement** aForm)
nsGenericHTMLFormElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
NS_ENSURE_ARG_POINTER(aForm);
*aForm = nsnull;
@ -3662,7 +3428,7 @@ nsGenericHTMLContainerFormElement::GetForm(nsIDOMHTMLFormElement** aForm)
}
void
nsGenericHTMLContainerFormElement::SetParent(nsIContent* aParent)
nsGenericHTMLFormElement::SetParent(nsIContent* aParent)
{
if (!aParent && mForm) {
SetForm(nsnull);
@ -3673,16 +3439,15 @@ nsGenericHTMLContainerFormElement::SetParent(nsIContent* aParent)
// search. In this case, someone (possibly the content sink) has
// already set the form for us.
FindAndSetForm(this);
FindAndSetForm();
}
nsGenericElement::SetParent(aParent);
}
void
nsGenericHTMLContainerFormElement::SetDocument(nsIDocument* aDocument,
PRBool aDeep,
PRBool aCompileEventHandlers)
nsGenericHTMLFormElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
PRBool aCompileEventHandlers)
{
// Save state before doing anything if the document is being removed
if (!aDocument) {
@ -3690,7 +3455,7 @@ nsGenericHTMLContainerFormElement::SetDocument(nsIDocument* aDocument,
}
if (aDocument && GetParent() && !mForm) {
FindAndSetForm(this);
FindAndSetForm();
} else if (!aDocument && mForm) {
// We got removed from document. We have a parent form. Check
// that the form is still in the document, and if so remove
@ -3707,12 +3472,9 @@ nsGenericHTMLContainerFormElement::SetDocument(nsIDocument* aDocument,
nsresult
nsGenericHTMLElement::SetFormControlAttribute(nsIForm* aForm,
PRInt32 aNameSpaceID,
nsIAtom* aName,
nsIAtom* aPrefix,
const nsAString& aValue,
PRBool aNotify)
nsGenericHTMLFormElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
if (aNameSpaceID != kNameSpaceID_None) {
return nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
@ -3726,214 +3488,66 @@ nsGenericHTMLElement::SetFormControlAttribute(nsIForm* aForm,
QueryInterface(NS_GET_IID(nsIFormControl), getter_AddRefs(thisControl));
// Add & remove the control to and/or from the hash table
if (aForm && (aName == nsHTMLAtoms::name || aName == nsHTMLAtoms::id)) {
if (mForm && (aName == nsHTMLAtoms::name || aName == nsHTMLAtoms::id)) {
GetAttr(kNameSpaceID_None, aName, tmp);
if (!tmp.IsEmpty()) {
aForm->RemoveElementFromTable(thisControl, tmp);
mForm->RemoveElementFromTable(thisControl, tmp);
}
}
if (aForm && aName == nsHTMLAtoms::type) {
if (mForm && aName == nsHTMLAtoms::type) {
GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, tmp);
if (!tmp.IsEmpty()) {
aForm->RemoveElementFromTable(thisControl, tmp);
mForm->RemoveElementFromTable(thisControl, tmp);
}
GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, tmp);
if (!tmp.IsEmpty()) {
aForm->RemoveElementFromTable(thisControl, tmp);
mForm->RemoveElementFromTable(thisControl, tmp);
}
aForm->RemoveElement(thisControl);
mForm->RemoveElement(thisControl);
}
rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue, aNotify);
if (aForm && (aName == nsHTMLAtoms::name || aName == nsHTMLAtoms::id)) {
if (mForm && (aName == nsHTMLAtoms::name || aName == nsHTMLAtoms::id)) {
GetAttr(kNameSpaceID_None, aName, tmp);
if (!tmp.IsEmpty()) {
aForm->AddElementToTable(thisControl, tmp);
mForm->AddElementToTable(thisControl, tmp);
}
}
if (aForm && aName == nsHTMLAtoms::type) {
if (mForm && aName == nsHTMLAtoms::type) {
GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, tmp);
if (!tmp.IsEmpty()) {
aForm->AddElementToTable(thisControl, tmp);
mForm->AddElementToTable(thisControl, tmp);
}
GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, tmp);
if (!tmp.IsEmpty()) {
aForm->AddElementToTable(thisControl, tmp);
mForm->AddElementToTable(thisControl, tmp);
}
aForm->AddElement(thisControl);
mForm->AddElement(thisControl);
}
return rv;
}
nsresult
nsGenericHTMLContainerFormElement::SetAttr(PRInt32 aNameSpaceID,
nsIAtom* aName,
nsIAtom* aPrefix,
const nsAString& aVal,
PRBool aNotify)
{
return SetFormControlAttribute(mForm, aNameSpaceID, aName, aPrefix, aVal,
aNotify);
}
//----------------------------------------------------------------------
nsGenericHTMLLeafFormElement::nsGenericHTMLLeafFormElement()
{
mForm = nsnull;
}
nsGenericHTMLLeafFormElement::~nsGenericHTMLLeafFormElement()
{
// Clean up. Set the form to nsnull so it knows we went away.
SetForm(nsnull);
}
NS_INTERFACE_MAP_BEGIN(nsGenericHTMLLeafFormElement)
NS_INTERFACE_MAP_ENTRY(nsIFormControl)
NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
PRBool
nsGenericHTMLLeafFormElement::IsContentOfType(PRUint32 aFlags) const
{
return !(aFlags & ~(eELEMENT | eHTML | eHTML_FORM_CONTROL));
}
NS_IMETHODIMP
nsGenericHTMLLeafFormElement::SetForm(nsIDOMHTMLFormElement* aForm,
PRBool aRemoveFromForm)
{
nsAutoString nameVal, idVal;
if (aForm || (mForm && aRemoveFromForm)) {
GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, nameVal);
GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, idVal);
}
if (mForm && aRemoveFromForm) {
mForm->RemoveElement(this);
if (!nameVal.IsEmpty()) {
mForm->RemoveElementFromTable(this, nameVal);
}
if (!idVal.IsEmpty()) {
mForm->RemoveElementFromTable(this, idVal);
}
}
if (aForm) {
// keep a *weak* ref to the form here
CallQueryInterface(aForm, &mForm);
mForm->Release();
} else {
mForm = nsnull;
}
if (mForm) {
mForm->AddElement(this);
if (!nameVal.IsEmpty()) {
mForm->AddElementToTable(this, nameVal);
}
if (!idVal.IsEmpty()) {
mForm->AddElementToTable(this, idVal);
}
}
return NS_OK;
}
NS_IMETHODIMP
nsGenericHTMLLeafFormElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
NS_ENSURE_ARG_POINTER(aForm);
*aForm = nsnull;
if (mForm) {
CallQueryInterface(mForm, aForm);
}
return NS_OK;
}
void
nsGenericHTMLLeafFormElement::SetParent(nsIContent* aParent)
nsGenericHTMLFormElement::FindAndSetForm()
{
PRBool old_parent = NS_PTR_TO_INT32(GetParent());
nsGenericElement::SetParent(aParent);
if (!aParent && mForm) {
SetForm(nsnull);
nsCOMPtr<nsIDOMHTMLFormElement> form = FindForm();
if (form) {
SetForm(form); // always succeeds
}
// If we have a new parent and either we had an old parent or we
// don't have a form, search for a containing form. If we didn't
// have an old parent, but we do have a form, we shouldn't do the
// search. In this case, someone (possibly the content sink) has
// already set the form for us.
else if (mDocument && aParent && (old_parent || !mForm)) {
FindAndSetForm(this);
}
}
void
nsGenericHTMLLeafFormElement::SetDocument(nsIDocument* aDocument,
PRBool aDeep,
PRBool aCompileEventHandlers)
{
// Save state before doing anything if the document is being removed
if (!aDocument) {
SaveState();
}
if (aDocument && GetParent() && !mForm) {
FindAndSetForm(this);
} else if (!aDocument && mForm) {
// We got removed from document. We have a parent form. Check
// that the form is still in the document, and if so remove
// ourselves from the form. This keeps ghosts from appearing in
// the form's |elements| array
nsCOMPtr<nsIContent> formContent(do_QueryInterface(mForm));
if (formContent && formContent->GetDocument()) {
SetForm(nsnull);
}
}
nsGenericHTMLElement::SetDocument(aDocument, aDeep, aCompileEventHandlers);
}
void
nsGenericHTMLLeafFormElement::DoneCreatingElement()
{
RestoreFormControlState(this, this);
}
nsresult
nsGenericHTMLLeafFormElement::SetAttr(PRInt32 aNameSpaceID,
nsIAtom* aName,
nsIAtom* aPrefix,
const nsAString& aValue,
PRBool aNotify)
{
return SetFormControlAttribute(mForm, aNameSpaceID, aName, aPrefix, aValue,
aNotify);
}
void

Просмотреть файл

@ -73,7 +73,7 @@ struct nsSize;
/**
* A common superclass for HTML elements
*/
class nsGenericHTMLElement : public nsGenericElement
class nsGenericHTMLElement : public nsGenericContainerElement
{
public:
#ifdef GATHER_ELEMENT_USEAGE_STATISTICS
@ -98,19 +98,13 @@ public:
void **aInstancePtr);
// From nsGenericElement
nsresult CopyInnerTo(nsIContent* aSrcContent, nsGenericHTMLElement* aDest,
PRBool aDeep);
nsresult CopyInnerTo(nsGenericHTMLElement* aDest, PRBool aDeep);
// Implementation for nsIDOMNode
NS_METHOD GetNodeName(nsAString& aNodeName);
NS_METHOD GetLocalName(nsAString& aLocalName);
// Implementation for nsIDOMElement
NS_METHOD GetAttribute(const nsAString& aName,
nsAString& aReturn)
{
return nsGenericElement::GetAttribute(aName, aReturn);
}
NS_METHOD SetAttribute(const nsAString& aName,
const nsAString& aValue);
NS_METHOD GetTagName(nsAString& aTagName);
@ -184,12 +178,8 @@ public:
PRBool aNotify);
virtual nsresult GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsAString& aResult) const;
virtual PRBool HasAttr(PRInt32 aNameSpaceID, nsIAtom* aName) const;
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
PRBool aNotify);
virtual nsresult GetAttrNameAt(PRUint32 aIndex, PRInt32* aNameSpaceID,
nsIAtom** aName, nsIAtom** aPrefix) const;
virtual PRUint32 GetAttrCount() const;
#ifdef DEBUG
virtual void List(FILE* out, PRInt32 aIndent) const;
virtual void DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const;
@ -675,15 +665,7 @@ public:
* Find an ancestor of this content node which is a form (could be null)
* @param aForm the form ancestore [OUT]
*/
nsresult FindForm(nsIDOMHTMLFormElement **aForm);
/**
* Find the form for this element and set aFormControl's form to it
* (aFormControl is passed in to avoid QI)
*
* @param aFormControl the form control to set the form for
*/
void FindAndSetForm(nsIFormControl *aFormControl);
already_AddRefed<nsIDOMHTMLFormElement> FindForm();
/**
* See if the document being tested has nav-quirks mode enabled.
@ -691,21 +673,6 @@ public:
*/
static PRBool InNavQuirksMode(nsIDocument* aDoc);
/**
* Helper for the form subclasses of nsGenericHTMLElement to take care
* of fixing up form.elements when name, id and type change
*
* @param aForm the form the control is in
* @param aNameSpaceID the namespace of the attr
* @param aName the name of the attr
* @param aValue the value of the attr
* @param aNotify whether to notify the document of the attribute change
*/
nsresult SetFormControlAttribute(nsIForm* aForm, PRInt32 aNameSpaceID,
nsIAtom* aName, nsIAtom* aPrefix,
const nsAString& aValue,
PRBool aNotify);
/**
* Set attribute and (if needed) notify documentobservers and fire off
* mutation events.
@ -730,11 +697,6 @@ public:
PRBool aFireMutation,
PRBool aNotify);
/**
* Array containing all attributes and children for this element
*/
nsAttrAndChildArray mAttrsAndChildren;
// Helper functions for <a> and <area>
static nsresult SetProtocolInHrefString(const nsAString &aHref,
const nsAString &aProtocol,
@ -808,143 +770,7 @@ protected:
PRBool IsEventName(nsIAtom* aName);
virtual const nsAttrName* InternalGetExistingAttrNameFromQName(const nsAString& aStr) const;
};
//----------------------------------------------------------------------
/**
* A helper class to subclass for leaf elements.
*/
class nsGenericHTMLLeafElement : public nsGenericHTMLElement {
public:
nsresult CopyInnerTo(nsIContent* aSrcContent,
nsGenericHTMLLeafElement* aDest, PRBool aDeep);
// Remainder of nsIDOMHTMLElement (and nsIDOMNode)
NS_METHOD GetChildNodes(nsIDOMNodeList** aChildNodes);
NS_METHOD HasChildNodes(PRBool* aHasChildNodes) {
*aHasChildNodes = PR_FALSE;
return NS_OK;
}
NS_METHOD GetFirstChild(nsIDOMNode** aFirstChild) {
*aFirstChild = nsnull;
return NS_OK;
}
NS_METHOD GetLastChild(nsIDOMNode** aLastChild) {
*aLastChild = nsnull;
return NS_OK;
}
NS_METHOD InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
nsIDOMNode** aReturn) {
return NS_ERROR_FAILURE;
}
NS_METHOD ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild,
nsIDOMNode** aReturn) {
return NS_ERROR_FAILURE;
}
NS_METHOD RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn) {
return NS_ERROR_FAILURE;
}
NS_METHOD AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn) {
return NS_ERROR_FAILURE;
}
// Remainder of nsIHTMLContent (and nsIContent)
NS_IMETHOD Compact() {
return NS_OK;
}
virtual PRBool CanContainChildren() const {
return PR_FALSE;
}
virtual PRUint32 GetChildCount() const {
return 0;
}
virtual nsIContent *GetChildAt(PRUint32 aIndex) const {
return nsnull;
}
virtual PRInt32 IndexOf(nsIContent* aPossibleChild) const {
return -1;
}
virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument) {
return NS_OK;
}
virtual nsresult ReplaceChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument) {
return NS_OK;
}
virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify,
PRBool aDeepSetDocument) {
return NS_OK;
}
virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify) {
return NS_OK;
}
};
//----------------------------------------------------------------------
/**
* A helper class to subclass for elements that can contain children
*/
class nsGenericHTMLContainerElement : public nsGenericHTMLElement
{
public:
nsresult CopyInnerTo(nsIContent* aSrcContent,
nsGenericHTMLContainerElement* aDest, PRBool aDeep);
// Remainder of nsIDOMHTMLElement (and nsIDOMNode)
NS_METHOD GetChildNodes(nsIDOMNodeList** aChildNodes);
NS_METHOD HasChildNodes(PRBool* aHasChildNodes);
NS_METHOD GetFirstChild(nsIDOMNode** aFirstChild);
NS_METHOD GetLastChild(nsIDOMNode** aLastChild);
NS_METHOD InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
nsIDOMNode** aReturn)
{
return nsGenericElement::doInsertBefore(this, aNewChild, aRefChild,
aReturn);
}
NS_METHOD ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild,
nsIDOMNode** aReturn)
{
return nsGenericElement::doReplaceChild(this, aNewChild, aOldChild,
aReturn);
}
NS_METHOD RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn)
{
return nsGenericElement::doRemoveChild(this, aOldChild, aReturn);
}
NS_METHOD AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn)
{
return nsGenericElement::doInsertBefore(this, aNewChild, nsnull, aReturn);
}
// Remainder of nsIHTMLContent (and nsIContent)
NS_IMETHOD Compact();
virtual PRBool CanContainChildren() const;
virtual PRUint32 GetChildCount() const;
virtual nsIContent *GetChildAt(PRUint32 aIndex) const;
virtual PRInt32 IndexOf(nsIContent* aPossibleChild) const;
// Child list modification hooks
virtual PRBool InternalInsertChildAt(nsIContent* aKid, PRUint32 aIndex) {
return NS_SUCCEEDED(mAttrsAndChildren.InsertChildAt(aKid, aIndex));
}
virtual PRBool InternalReplaceChildAt(nsIContent* aKid, PRUint32 aIndex) {
mAttrsAndChildren.ReplaceChildAt(aKid, aIndex);
return PR_TRUE;
}
virtual PRBool InternalAppendChildTo(nsIContent* aKid) {
return NS_SUCCEEDED(mAttrsAndChildren.AppendChild(aKid));
}
virtual PRBool InternalRemoveChildAt(PRUint32 aIndex) {
mAttrsAndChildren.RemoveChildAt(aIndex);
return PR_TRUE;
}
protected:
/**
* ReplaceContentsWithText will take the aText string and make sure
* that the only child of |this| is a textnode which corresponds to
@ -966,17 +792,18 @@ protected:
nsresult GetContentsAsText(nsAString& aText);
};
//----------------------------------------------------------------------
/**
* A helper class for form elements that can contain children
*/
class nsGenericHTMLContainerFormElement : public nsGenericHTMLContainerElement,
public nsIFormControl
class nsGenericHTMLFormElement : public nsGenericHTMLElement,
public nsIFormControl
{
public:
nsGenericHTMLContainerFormElement();
virtual ~nsGenericHTMLContainerFormElement();
nsGenericHTMLFormElement();
virtual ~nsGenericHTMLFormElement();
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
@ -1003,67 +830,19 @@ public:
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify);
NS_IMETHOD SetAttribute(const nsAString& aName,
const nsAString& aValue)
{
return nsGenericHTMLElement::SetAttribute(aName, aValue);
}
protected:
/**
* Find the form for this element and set aFormControl's form to it
* (aFormControl is passed in to avoid QI)
*
* @param aFormControl the form control to set the form for
*/
void FindAndSetForm();
/** The form that contains this control */
nsIForm* mForm;
};
//----------------------------------------------------------------------
/**
* A helper class for form elements that can contain children
*/
class nsGenericHTMLLeafFormElement : public nsGenericHTMLLeafElement,
public nsIFormControl
{
public:
nsGenericHTMLLeafFormElement();
~nsGenericHTMLLeafFormElement();
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
virtual PRBool IsContentOfType(PRUint32 aFlags) const;
// nsIFormControl
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm,
PRBool aRemoveFromForm = PR_TRUE);
NS_IMETHOD SaveState() { return NS_OK; }
NS_IMETHOD RestoreState(nsIPresState* aState) { return NS_OK; }
// nsIContent
virtual void SetParent(nsIContent *aParent);
virtual void SetDocument(nsIDocument* aDocument, PRBool aDeep,
PRBool aCompileEventHandlers);
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
const nsAString& aValue, PRBool aNotify)
{
return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
}
virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify);
virtual void DoneCreatingElement();
NS_IMETHOD SetAttribute(const nsAString& aName,
const nsAString& aValue)
{
return nsGenericHTMLElement::SetAttribute(aName, aValue);
}
protected:
/** The form that contains this control */
nsIForm* mForm;
};
//----------------------------------------------------------------------
/**

Просмотреть файл

@ -74,7 +74,7 @@ nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult);
// XXX either suppress is handled in the event code below OR we need a
// custom frame
class nsHTMLAnchorElement : public nsGenericHTMLContainerElement,
class nsHTMLAnchorElement : public nsGenericHTMLElement,
public nsIDOMHTMLAnchorElement,
public nsIDOMNSHTMLAnchorElement,
public nsILink
@ -87,13 +87,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLAnchorElement
NS_DECL_NSIDOMHTMLANCHORELEMENT
@ -176,8 +176,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLAnchorElement, nsGenericElement)
// QueryInterface implementation for nsHTMLAnchorElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLAnchorElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLAnchorElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLAnchorElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLAnchorElement)
NS_INTERFACE_MAP_ENTRY(nsILink)
@ -204,7 +203,7 @@ nsHTMLAnchorElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = it;
@ -238,8 +237,7 @@ nsHTMLAnchorElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
RegUnRegAccessKey(PR_FALSE);
}
nsGenericHTMLContainerElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLElement::SetDocument(aDocument, aDeep, aCompileEventHandlers);
// Register the access key for the new document.
if (documentChanging && mDocument) {
@ -379,7 +377,7 @@ nsHTMLAnchorElement::GetProtocol(nsAString& aProtocol)
// XXX this should really use GetHrefURI and not do so much string stuff
return GetProtocolFromHrefString(href, aProtocol,
nsGenericHTMLContainerElement::GetOwnerDocument());
nsGenericHTMLElement::GetOwnerDocument());
}
NS_IMETHODIMP

Просмотреть файл

@ -54,7 +54,7 @@
#endif
class nsHTMLAppletElement : public nsGenericHTMLContainerElement,
class nsHTMLAppletElement : public nsGenericHTMLElement,
public nsIDOMHTMLAppletElement
{
public:
@ -65,13 +65,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLAppletElement
NS_DECL_NSIDOMHTMLAPPLETELEMENT
@ -129,8 +129,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLAppletElement, nsGenericElement)
// QueryInterface implementation for nsHTMLAppletElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLAppletElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLAppletElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLAppletElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLAppletElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -155,7 +154,7 @@ nsHTMLAppletElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -208,8 +207,7 @@ nsHTMLAppletElement::AttributeToString(nsIAtom* aAttribute,
aValue, aResult)) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -52,7 +52,7 @@
#include "nsReadableUtils.h"
#include "nsIDocument.h"
class nsHTMLAreaElement : public nsGenericHTMLLeafElement,
class nsHTMLAreaElement : public nsGenericHTMLElement,
public nsIDOMHTMLAreaElement,
public nsIDOMNSHTMLAreaElement,
public nsILink
@ -65,13 +65,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLAreaElement
NS_DECL_NSIDOMHTMLAREAELEMENT
@ -153,8 +153,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLAreaElement, nsGenericElement)
// QueryInterface implementation for nsHTMLAreaElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLAreaElement,
nsGenericHTMLLeafElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLAreaElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLAreaElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLAreaElement)
NS_INTERFACE_MAP_ENTRY(nsILink)
@ -181,7 +180,7 @@ nsHTMLAreaElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = it;
@ -338,7 +337,7 @@ nsHTMLAreaElement::GetProtocol(nsAString& aProtocol)
// XXX this should really use GetHrefURI and not do so much string stuff
return GetProtocolFromHrefString(href, aProtocol,
nsGenericHTMLLeafElement::GetOwnerDocument());
nsGenericHTMLElement::GetOwnerDocument());
}
NS_IMETHODIMP

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsMappedAttributes.h"
#include "nsRuleNode.h"
class nsHTMLBRElement : public nsGenericHTMLLeafElement,
class nsHTMLBRElement : public nsGenericHTMLElement,
public nsIDOMHTMLBRElement
{
public:
@ -56,13 +56,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLBRElement
NS_DECL_NSIDOMHTMLBRELEMENT
@ -117,8 +117,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLBRElement, nsGenericElement)
// QueryInterface implementation for nsHTMLBRElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLBRElement,
nsGenericHTMLLeafElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLBRElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLBRElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLBRElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -143,7 +142,7 @@ nsHTMLBRElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -187,8 +186,7 @@ nsHTMLBRElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
return nsGenericHTMLLeafElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsIPresContext.h"
class nsHTMLBaseFontElement : public nsGenericHTMLLeafElement,
class nsHTMLBaseFontElement : public nsGenericHTMLElement,
public nsIDOMHTMLBaseFontElement
{
public:
@ -55,13 +55,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLBaseElement
NS_DECL_NSIDOMHTMLBASEFONTELEMENT
@ -109,7 +109,7 @@ NS_IMPL_RELEASE(nsHTMLBaseFontElement)
// QueryInterface implementation for nsHTMLBaseFontElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLBaseFontElement,
nsGenericHTMLLeafElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLBaseFontElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLBaseFontElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -134,7 +134,7 @@ nsHTMLBaseFontElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -90,7 +90,7 @@ public:
//----------------------------------------------------------------------
class nsHTMLBodyElement : public nsGenericHTMLContainerElement,
class nsHTMLBodyElement : public nsGenericHTMLElement,
public nsIDOMHTMLBodyElement
{
public:
@ -101,13 +101,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLBodyElement
NS_DECL_NSIDOMHTMLBODYELEMENT
@ -318,7 +318,7 @@ NS_NewHTMLBodyElement(nsIHTMLContent** aInstancePtrResult,
nsHTMLBodyElement::nsHTMLBodyElement()
: nsGenericHTMLContainerElement(),
: nsGenericHTMLElement(),
mContentStyleRule(nsnull)
{
}
@ -337,8 +337,7 @@ NS_IMPL_ADDREF_INHERITED(nsHTMLBodyElement, nsGenericElement)
NS_IMPL_RELEASE_INHERITED(nsHTMLBodyElement, nsGenericElement)
// QueryInterface implementation for nsHTMLBodyElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLBodyElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLBodyElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLBodyElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLBodyElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -363,7 +362,7 @@ nsHTMLBodyElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -475,7 +474,7 @@ nsHTMLBodyElement::StringToAttribute(nsIAtom* aAttribute,
(aAttribute == nsHTMLAtoms::alink) ||
(aAttribute == nsHTMLAtoms::vlink)) {
if (aResult.ParseColor(aValue,
nsGenericHTMLContainerElement::GetOwnerDocument())) {
nsGenericHTMLElement::GetOwnerDocument())) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -504,8 +503,7 @@ nsHTMLBodyElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
// destroy old style rule since the sheet will probably change
NS_RELEASE(mContentStyleRule);
}
nsGenericHTMLContainerElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLElement::SetDocument(aDocument, aDeep, aCompileEventHandlers);
}
static
@ -569,7 +567,7 @@ nsHTMLBodyElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRu
NS_IMETHODIMP
nsHTMLBodyElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
{
nsGenericHTMLContainerElement::WalkContentStyleRules(aRuleWalker);
nsGenericHTMLElement::WalkContentStyleRules(aRuleWalker);
if (!mContentStyleRule && mDocument) {
mContentStyleRule = new BodyRule(this, mDocument->GetAttributeStyleSheet());

Просмотреть файл

@ -60,7 +60,7 @@
#include "nsUnicharUtils.h"
class nsHTMLButtonElement : public nsGenericHTMLContainerFormElement,
class nsHTMLButtonElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLButtonElement,
public nsIDOMNSHTMLButtonElement
{
@ -72,13 +72,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerFormElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLFormElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerFormElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLButtonElement
NS_DECL_NSIDOMHTMLBUTTONELEMENT
@ -98,10 +98,6 @@ public:
nsIContent* aSubmitElement);
// nsIContent overrides...
NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
nsAString& aResult) const;
NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
const nsAString& aValue, PRBool aNotify);
virtual void SetFocus(nsIPresContext* aPresContext);
virtual void RemoveFocus(nsIPresContext* aPresContext);
NS_IMETHOD StringToAttribute(nsIAtom* aAttribute,
@ -173,49 +169,12 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLButtonElement, nsGenericElement)
// QueryInterface implementation for nsHTMLButtonElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLButtonElement,
nsGenericHTMLContainerFormElement)
nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLButtonElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLButtonElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLButtonElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
NS_IMETHODIMP
nsHTMLButtonElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
nsAString& aResult) const
{
if (aName == nsHTMLAtoms::disabled) {
nsresult rv = nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, aResult);
if (rv == NS_CONTENT_ATTR_NOT_THERE) {
aResult.Assign(NS_LITERAL_STRING("false"));
} else {
aResult.Assign(NS_LITERAL_STRING("true"));
}
return rv;
}
return nsGenericHTMLContainerFormElement::GetAttr(aNameSpaceID, aName,
aResult);
}
NS_IMETHODIMP
nsHTMLButtonElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
const nsAString& aValue,
PRBool aNotify)
{
nsAutoString value(aValue);
if (aName == nsHTMLAtoms::disabled &&
value.Equals(NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator())) {
return UnsetAttr(aNameSpaceID, aName, aNotify);
}
return nsGenericHTMLContainerFormElement::SetAttr(aNameSpaceID, aName,
aValue, aNotify);
}
// nsIDOMHTMLButtonElement
nsresult
@ -237,7 +196,7 @@ nsHTMLButtonElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -252,7 +211,7 @@ nsHTMLButtonElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsHTMLButtonElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLContainerFormElement::GetForm(aForm);
return nsGenericHTMLFormElement::GetForm(aForm);
}
NS_IMETHODIMP
@ -329,10 +288,7 @@ nsHTMLButtonElement::SetFocus(nsIPresContext* aPresContext)
return;
// first see if we are disabled or not. If disabled then do nothing.
nsAutoString disabled;
if (NS_CONTENT_ATTR_HAS_VALUE == GetAttribute(kNameSpaceID_None,
nsHTMLAtoms::disabled,
disabled)) {
if (HasAttr(kNameSpaceID_None, nsHTMLAtoms::disabled)) {
return;
}
@ -420,8 +376,8 @@ nsHTMLButtonElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerFormElement::AttributeToString(aAttribute,
aValue, aResult);
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
aResult);
}
nsresult
@ -471,10 +427,9 @@ nsHTMLButtonElement::HandleDOMEvent(nsIPresContext* aPresContext,
// Try script event handlers first
nsresult ret;
ret = nsGenericHTMLContainerFormElement::HandleDOMEvent(aPresContext,
aEvent, aDOMEvent,
aFlags,
aEventStatus);
ret = nsGenericHTMLFormElement::HandleDOMEvent(aPresContext, aEvent,
aDOMEvent, aFlags,
aEventStatus);
// mForm is null if the event handler removed us from the document (bug 194582).
if (bInSubmitClick && mForm) {

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsIPresContext.h"
class nsHTMLDListElement : public nsGenericHTMLContainerElement,
class nsHTMLDListElement : public nsGenericHTMLElement,
public nsIDOMHTMLDListElement
{
public:
@ -55,13 +55,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLDListElement
NS_IMETHOD GetCompact(PRBool* aCompact);
@ -109,8 +109,7 @@ NS_IMPL_RELEASE(nsHTMLDListElement)
// QueryInterface implementation for nsHTMLDListElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLDListElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLDListElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLDListElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLDListElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -135,7 +134,7 @@ nsHTMLDListElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsIPresContext.h"
class nsHTMLDelElement : public nsGenericHTMLContainerElement,
class nsHTMLDelElement : public nsGenericHTMLElement,
public nsIDOMHTMLModElement
{
public:
@ -55,13 +55,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLModElement
NS_DECL_NSIDOMHTMLMODELEMENT
@ -108,8 +108,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLDelElement, nsGenericElement)
// QueryInterface implementation for nsHTMLDelElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLDelElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLDelElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLModElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLDelElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -134,7 +133,7 @@ nsHTMLDelElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -50,7 +50,7 @@
extern nsHTMLValue::EnumTable kListTypeTable[];
class nsHTMLDirectoryElement : public nsGenericHTMLContainerElement,
class nsHTMLDirectoryElement : public nsGenericHTMLElement,
public nsIDOMHTMLDirectoryElement
{
public:
@ -61,13 +61,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLDirectoryElement
NS_DECL_NSIDOMHTMLDIRECTORYELEMENT
@ -123,7 +123,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLDirectoryElement, nsGenericElement)
// QueryInterface implementation for nsHTMLDirectoryElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLDirectoryElement,
nsGenericHTMLContainerElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLDirectoryElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLDirectoryElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -148,7 +148,7 @@ nsHTMLDirectoryElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -192,8 +192,7 @@ nsHTMLDirectoryElement::AttributeToString(nsIAtom* aAttribute,
aValue.EnumValueToString(kListTypeTable, aResult);
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -48,7 +48,7 @@
// XXX support missing nav attributes? gutter, cols, width
class nsHTMLDivElement : public nsGenericHTMLContainerElement,
class nsHTMLDivElement : public nsGenericHTMLElement,
public nsIDOMHTMLDivElement
{
public:
@ -59,13 +59,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLDivElement
NS_DECL_NSIDOMHTMLDIVELEMENT
@ -122,8 +122,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLDivElement, nsGenericElement)
// QueryInterface implementation for nsHTMLDivElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLDivElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLDivElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLDivElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLDivElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -148,7 +147,7 @@ nsHTMLDivElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -201,8 +200,7 @@ nsHTMLDivElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -47,7 +47,7 @@
#include "nsIFormControl.h"
class nsHTMLFieldSetElement : public nsGenericHTMLContainerFormElement,
class nsHTMLFieldSetElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLFieldSetElement
{
public:
@ -58,13 +58,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerFormElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLFormElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerFormElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerFormElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLFieldSetElement
NS_DECL_NSIDOMHTMLFIELDSETELEMENT
@ -121,7 +121,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLFieldSetElement, nsGenericElement)
// QueryInterface implementation for nsHTMLFieldSetElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLFieldSetElement,
nsGenericHTMLContainerFormElement)
nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLFieldSetElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLFieldSetElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -148,7 +148,7 @@ nsHTMLFieldSetElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -162,7 +162,7 @@ nsHTMLFieldSetElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsHTMLFieldSetElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLContainerFormElement::GetForm(aForm);
return nsGenericHTMLFormElement::GetForm(aForm);
}
// nsIFormControl

Просмотреть файл

@ -49,7 +49,7 @@
#include "nsRuleNode.h"
#include "nsIDocument.h"
class nsHTMLFontElement : public nsGenericHTMLContainerElement,
class nsHTMLFontElement : public nsGenericHTMLElement,
public nsIDOMHTMLFontElement
{
public:
@ -60,13 +60,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLFontElement
NS_DECL_NSIDOMHTMLFONTELEMENT
@ -121,8 +121,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLFontElement, nsGenericElement)
// QueryInterface implementation for nsHTMLFontElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLFontElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLFontElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLFontElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLFontElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -147,7 +146,7 @@ nsHTMLFontElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -183,8 +182,7 @@ nsHTMLFontElement::StringToAttribute(nsIAtom* aAttribute,
}
}
else if (aAttribute == nsHTMLAtoms::color) {
if (aResult.ParseColor(aValue,
nsGenericHTMLContainerElement::GetOwnerDocument())) {
if (aResult.ParseColor(aValue, nsGenericHTMLElement::GetOwnerDocument())) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -219,8 +217,7 @@ nsHTMLFontElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_NOT_THERE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -89,7 +89,7 @@ class nsFormControlList;
// nsHTMLFormElement
class nsHTMLFormElement : public nsGenericHTMLContainerElement,
class nsHTMLFormElement : public nsGenericHTMLElement,
public nsSupportsWeakReference,
public nsIDOMHTMLFormElement,
public nsIDOMNSHTMLFormElement,
@ -116,13 +116,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLFormElement
NS_DECL_NSIDOMHTMLFORMELEMENT
@ -437,7 +437,7 @@ NS_NewHTMLFormElement(nsIHTMLContent** aInstancePtrResult,
nsresult
nsHTMLFormElement::Init(nsINodeInfo *aNodeInfo)
{
nsresult rv = nsGenericHTMLContainerElement::Init(aNodeInfo);
nsresult rv = nsGenericHTMLElement::Init(aNodeInfo);
NS_ENSURE_SUCCESS(rv, rv);
mControls = new nsFormControlList(this);
@ -480,8 +480,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLFormElement, nsGenericElement)
// QueryInterface implementation for nsHTMLFormElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLFormElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLFormElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLFormElement)
@ -511,7 +510,7 @@ nsHTMLFormElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
nsresult rv = it->Init(mNodeInfo);
NS_ENSURE_SUCCESS(rv, rv);
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -544,8 +543,8 @@ nsHTMLFormElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
}
ForgetCurrentSubmission();
}
return nsGenericHTMLContainerElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
return nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
aNotify);
}
NS_IMPL_STRING_ATTR(nsHTMLFormElement, AcceptCharset, acceptcharset)
@ -660,8 +659,7 @@ nsHTMLFormElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute,
aValue, aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
void
@ -669,8 +667,7 @@ nsHTMLFormElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
PRBool aCompileEventHandlers)
{
nsCOMPtr<nsIHTMLDocument> oldDocument = do_QueryInterface(mDocument);
nsGenericHTMLContainerElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLElement::SetDocument(aDocument, aDeep, aCompileEventHandlers);
nsCOMPtr<nsIHTMLDocument> newDocument = do_QueryInterface(mDocument);
if (oldDocument != newDocument) {
@ -722,11 +719,9 @@ nsHTMLFormElement::HandleDOMEvent(nsIPresContext* aPresContext,
}
nsresult rv = nsGenericHTMLContainerElement::HandleDOMEvent(aPresContext,
aEvent,
aDOMEvent,
aFlags,
aEventStatus);
nsresult rv = nsGenericHTMLElement::HandleDOMEvent(aPresContext, aEvent,
aDOMEvent, aFlags,
aEventStatus);
if (aEvent->message == NS_FORM_SUBMIT) {
// let the form know not to defer subsequent submissions
mDeferSubmission = PR_FALSE;

Просмотреть файл

@ -52,7 +52,7 @@
#include "nsDOMError.h"
class nsHTMLFrameElement : public nsGenericHTMLLeafElement,
class nsHTMLFrameElement : public nsGenericHTMLElement,
public nsIDOMHTMLFrameElement,
public nsIDOMNSHTMLFrameElement,
public nsIChromeEventHandler
@ -65,13 +65,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLFrameElement
NS_DECL_NSIDOMHTMLFRAMEELEMENT
@ -133,8 +133,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLFrameElement, nsGenericElement)
// QueryInterface implementation for nsHTMLFrameElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLFrameElement,
nsGenericHTMLLeafElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLFrameElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLFrameElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLFrameElement)
NS_INTERFACE_MAP_ENTRY(nsIChromeEventHandler)
@ -161,7 +160,7 @@ nsHTMLFrameElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -231,8 +230,7 @@ nsHTMLFrameElement::StringToAttribute(nsIAtom* aAttribute,
nsHTMLValue& aResult)
{
if (aAttribute == nsHTMLAtoms::bordercolor) {
if (aResult.ParseColor(aValue,
nsGenericHTMLLeafElement::GetOwnerDocument())) {
if (aResult.ParseColor(aValue, nsGenericHTMLElement::GetOwnerDocument())) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -278,8 +276,7 @@ nsHTMLFrameElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLLeafElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -46,7 +46,7 @@
#include "nsIHTMLDocument.h"
#include "nsIDocument.h"
class nsHTMLFrameSetElement : public nsGenericHTMLContainerElement,
class nsHTMLFrameSetElement : public nsGenericHTMLElement,
public nsIDOMHTMLFrameSetElement,
public nsIFrameSetElement
{
@ -58,13 +58,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLFrameSetElement
NS_DECL_NSIDOMHTMLFRAMESETELEMENT
@ -175,7 +175,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLFrameSetElement, nsGenericElement)
// QueryInterface implementation for nsHTMLFrameSetElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLFrameSetElement,
nsGenericHTMLContainerElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLFrameSetElement)
NS_INTERFACE_MAP_ENTRY(nsIFrameSetElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLFrameSetElement)
@ -201,7 +201,7 @@ nsHTMLFrameSetElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -224,11 +224,10 @@ nsHTMLFrameSetElement::SetAttr(PRInt32 aNameSpaceID,
/* The main goal here is to see whether the _number_ of rows or
* columns has changed. If it has, we need to reframe; otherwise
* we want to reflow. So we set mCurrentRowColHint here, then call
* nsGenericHTMLContainerElement::SetAttr, which will end up
* calling GetAttributeChangeHint and notifying layout with that
* hint. Once nsGenericHTMLContainerElement::SetAttr returns, we
* want to go back to our normal hint, which is
* NS_STYLE_HINT_REFLOW.
* nsGenericHTMLElement::SetAttr, which will end up calling
* GetAttributeChangeHint and notifying layout with that hint.
* Once nsGenericHTMLElement::SetAttr returns, we want to go back to our
* normal hint, which is NS_STYLE_HINT_REFLOW.
*/
if (aAttribute == nsHTMLAtoms::rows && aNameSpaceID == kNameSpaceID_None) {
PRInt32 oldRows = mNumRows;
@ -255,8 +254,8 @@ nsHTMLFrameSetElement::SetAttr(PRInt32 aNameSpaceID,
}
}
rv = nsGenericHTMLContainerElement::SetAttr(aNameSpaceID, aAttribute,
aPrefix, aValue, aNotify);
rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute, aPrefix,
aValue, aNotify);
mCurrentRowColHint = NS_STYLE_HINT_REFLOW;
return rv;
@ -342,7 +341,7 @@ nsHTMLFrameSetElement::StringToAttribute(nsIAtom* aAttribute,
{
if (aAttribute == nsHTMLAtoms::bordercolor) {
if (aResult.ParseColor(aValue,
nsGenericHTMLContainerElement::GetOwnerDocument())) {
nsGenericHTMLElement::GetOwnerDocument())) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -368,8 +367,7 @@ nsHTMLFrameSetElement::AttributeToString(nsIAtom* aAttribute,
nsGenericHTMLElement::FrameborderValueToString(aValue, aResult);
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
NS_IMETHODIMP
@ -378,8 +376,7 @@ nsHTMLFrameSetElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
nsChangeHint& aHint) const
{
nsresult rv =
nsGenericHTMLContainerElement::GetAttributeChangeHint(aAttribute,
aModType, aHint);
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType, aHint);
if (aAttribute == nsHTMLAtoms::rows ||
aAttribute == nsHTMLAtoms::cols) {
NS_UpdateHint(aHint, mCurrentRowColHint);
@ -501,7 +498,7 @@ nsHTMLFrameSetElement::ParseRowColSpec(nsString& aSpec,
// Treat 0* as 1* in quirks mode (bug 40383)
nsCompatibility mode = eCompatibility_FullStandards;
nsCOMPtr<nsIHTMLDocument> htmlDocument =
do_QueryInterface(nsGenericHTMLContainerElement::GetOwnerDocument());
do_QueryInterface(nsGenericHTMLElement::GetOwnerDocument());
if (htmlDocument) {
mode = htmlDocument->GetCompatibilityMode();
}

Просмотреть файл

@ -46,7 +46,7 @@
#include "nsMappedAttributes.h"
#include "nsRuleNode.h"
class nsHTMLHRElement : public nsGenericHTMLLeafElement,
class nsHTMLHRElement : public nsGenericHTMLElement,
public nsIDOMHTMLHRElement,
public nsIDOMNSHTMLHRElement
{
@ -58,13 +58,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLHRElement
NS_DECL_NSIDOMHTMLHRELEMENT
@ -123,8 +123,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLHRElement, nsGenericElement)
// QueryInterface implementation for nsHTMLHRElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLHRElement,
nsGenericHTMLLeafElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLHRElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLHRElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLHRElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLHRElement)
@ -150,7 +149,7 @@ nsHTMLHRElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -199,7 +198,7 @@ nsHTMLHRElement::StringToAttribute(nsIAtom* aAttribute,
}
else if (aAttribute == nsHTMLAtoms::color) {
if (aResult.ParseColor(aValue,
nsGenericHTMLLeafElement::GetOwnerDocument())) {
nsGenericHTMLElement::GetOwnerDocument())) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -219,8 +218,7 @@ nsHTMLHRElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLLeafElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsIPresContext.h"
class nsHTMLHeadElement : public nsGenericHTMLContainerElement,
class nsHTMLHeadElement : public nsGenericHTMLElement,
public nsIDOMHTMLHeadElement
{
public:
@ -55,13 +55,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLHeadElement
NS_DECL_NSIDOMHTMLHEADELEMENT
@ -108,8 +108,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLHeadElement, nsGenericElement)
// QueryInterface implementation for nsHTMLHeadElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLHeadElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLHeadElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLHeadElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLHeadElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -134,7 +133,7 @@ nsHTMLHeadElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsMappedAttributes.h"
#include "nsRuleNode.h"
class nsHTMLHeadingElement : public nsGenericHTMLContainerElement,
class nsHTMLHeadingElement : public nsGenericHTMLElement,
public nsIDOMHTMLHeadingElement
{
public:
@ -56,13 +56,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLHeadingElement
NS_DECL_NSIDOMHTMLHEADINGELEMENT
@ -118,8 +118,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLHeadingElement, nsGenericElement)
// QueryInterface implementation for nsHTMLHeadingElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLHeadingElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLHeadingElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLHeadingElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLHeadingElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -144,7 +143,7 @@ nsHTMLHeadingElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -183,8 +182,7 @@ nsHTMLHeadingElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsIDocument.h"
class nsHTMLHtmlElement : public nsGenericHTMLContainerElement,
class nsHTMLHtmlElement : public nsGenericHTMLElement,
public nsIDOMHTMLHtmlElement
{
public:
@ -56,13 +56,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLHtmlElement
NS_DECL_NSIDOMHTMLHTMLELEMENT
@ -111,8 +111,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLHtmlElement, nsGenericElement)
// QueryInterface implementation for nsHTMLHtmlElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLHtmlElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLHtmlElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLHtmlElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLHtmlElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -137,7 +136,7 @@ nsHTMLHtmlElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -55,7 +55,7 @@
#include "nsIDocShell.h"
#include "nsIInterfaceRequestorUtils.h"
class nsHTMLIFrameElement : public nsGenericHTMLContainerElement,
class nsHTMLIFrameElement : public nsGenericHTMLElement,
public nsIDOMHTMLIFrameElement,
public nsIDOMNSHTMLFrameElement,
public nsIChromeEventHandler,
@ -69,13 +69,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLIFrameElement
NS_DECL_NSIDOMHTMLIFRAMEELEMENT
@ -110,9 +110,8 @@ public:
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
nsresult rv = nsGenericHTMLContainerElement::SetAttr(aNameSpaceID, aName,
aPrefix, aValue,
aNotify);
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
if (NS_SUCCEEDED(rv) && aNameSpaceID == kNameSpaceID_None &&
aName == nsHTMLAtoms::src) {
@ -177,8 +176,7 @@ NS_IMPL_ADDREF(nsHTMLIFrameElement)
NS_IMPL_RELEASE(nsHTMLIFrameElement)
// QueryInterface implementation for nsHTMLIFrameElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLIFrameElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLIFrameElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLIFrameElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLFrameElement)
NS_INTERFACE_MAP_ENTRY(nsIChromeEventHandler)
@ -205,7 +203,7 @@ nsHTMLIFrameElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -326,7 +324,7 @@ nsHTMLIFrameElement::LoadSrc()
void
nsHTMLIFrameElement::SetParent(nsIContent *aParent)
{
nsGenericHTMLContainerElement::SetParent(aParent);
nsGenericHTMLElement::SetParent(aParent);
// When parent is being set to null on the element's destruction, do not
// call LoadSrc().
@ -343,8 +341,8 @@ nsHTMLIFrameElement::SetDocument(nsIDocument *aDocument, PRBool aDeep,
{
const nsIDocument *old_doc = mDocument;
nsGenericHTMLContainerElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
if (!aDocument && mFrameLoader) {
// This iframe is being taken out of the document, destroy the
@ -428,8 +426,7 @@ nsHTMLIFrameElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -83,7 +83,7 @@
// XXX nav attrs: suppress
class nsHTMLImageElement : public nsGenericHTMLLeafElement,
class nsHTMLImageElement : public nsGenericHTMLElement,
public nsImageLoadingContent,
public nsIDOMHTMLImageElement,
public nsIDOMNSHTMLImageElement,
@ -97,13 +97,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLImageElement
NS_DECL_NSIDOMHTMLIMAGEELEMENT
@ -218,8 +218,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLImageElement, nsGenericElement)
// QueryInterface implementation for nsHTMLImageElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLImageElement,
nsGenericHTMLLeafElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLImageElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLImageElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLImageElement)
NS_INTERFACE_MAP_ENTRY(nsIJSNativeInitializer)
@ -248,7 +247,7 @@ nsHTMLImageElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -454,9 +453,8 @@ nsHTMLImageElement::SetHeight(PRInt32 aHeight)
nsAutoString val;
val.AppendInt(aHeight);
return nsGenericHTMLLeafElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::height,
val, PR_TRUE);
return nsGenericHTMLElement::SetAttr(kNameSpaceID_None, nsHTMLAtoms::height,
val, PR_TRUE);
}
NS_IMETHODIMP
@ -473,9 +471,8 @@ nsHTMLImageElement::SetWidth(PRInt32 aWidth)
nsAutoString val;
val.AppendInt(aWidth);
return nsGenericHTMLLeafElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::width,
val, PR_TRUE);
return nsGenericHTMLElement::SetAttr(kNameSpaceID_None, nsHTMLAtoms::width,
val, PR_TRUE);
}
NS_IMETHODIMP
@ -519,8 +516,7 @@ nsHTMLImageElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLLeafElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void
@ -540,8 +536,7 @@ nsHTMLImageElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
nsChangeHint& aHint) const
{
nsresult rv =
nsGenericHTMLLeafElement::GetAttributeChangeHint(aAttribute,
aModType, aHint);
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType, aHint);
if (aAttribute == nsHTMLAtoms::usemap ||
aAttribute == nsHTMLAtoms::ismap) {
NS_UpdateHint(aHint, NS_STYLE_HINT_FRAMECHANGE);
@ -589,9 +584,8 @@ nsHTMLImageElement::HandleDOMEvent(nsIPresContext* aPresContext,
}
}
return nsGenericHTMLLeafElement::HandleDOMEvent(aPresContext, aEvent,
aDOMEvent, aFlags,
aEventStatus);
return nsGenericHTMLElement::HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
aFlags, aEventStatus);
}
nsresult
@ -609,8 +603,8 @@ nsHTMLImageElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
ImageURIChanged(aValue);
}
return nsGenericHTMLLeafElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
return nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
aNotify);
}
void
@ -619,8 +613,7 @@ nsHTMLImageElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
{
PRBool documentChanging = aDocument && (aDocument != mDocument);
nsGenericHTMLLeafElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLElement::SetDocument(aDocument, aDeep, aCompileEventHandlers);
if (documentChanging && GetParent()) {
// Our base URI may have changed; claim that our URI changed, and the
// nsImageLoadingContent will decide whether a new image load is warranted.
@ -635,7 +628,7 @@ nsHTMLImageElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
void
nsHTMLImageElement::SetParent(nsIContent* aParent)
{
nsGenericHTMLLeafElement::SetParent(aParent);
nsGenericHTMLElement::SetParent(aParent);
if (aParent && mDocument) {
// Our base URI may have changed; claim that our URI changed, and the
// nsImageLoadingContent will decide whether a new image load is warranted.
@ -716,8 +709,8 @@ nsHTMLImageElement::SetSrc(const nsAString& aSrc)
}
}
return nsGenericHTMLLeafElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::src, aSrc, PR_TRUE);
return nsGenericHTMLElement::SetAttr(kNameSpaceID_None, nsHTMLAtoms::src,
aSrc, PR_TRUE);
}
NS_IMETHODIMP

Просмотреть файл

@ -131,7 +131,7 @@ static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
? ((bitfield) |= (0x01 << (field))) \
: ((bitfield) &= ~(0x01 << (field))))
class nsHTMLInputElement : public nsGenericHTMLLeafFormElement,
class nsHTMLInputElement : public nsGenericHTMLFormElement,
public nsImageLoadingContent,
public nsIDOMHTMLInputElement,
public nsIDOMNSHTMLInputElement,
@ -147,13 +147,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafFormElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLFormElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafFormElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafFormElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLInputElement
NS_DECL_NSIDOMHTMLINPUTELEMENT
@ -206,9 +206,8 @@ public:
{
BeforeSetAttr(aNameSpaceID, aName, &aValue, aNotify);
nsresult rv = nsGenericHTMLLeafFormElement::SetAttr(aNameSpaceID, aName,
aPrefix, aValue,
aNotify);
nsresult rv = nsGenericHTMLFormElement::SetAttr(aNameSpaceID, aName,
aPrefix, aValue, aNotify);
AfterSetAttr(aNameSpaceID, aName, &aValue, aNotify);
return rv;
@ -219,8 +218,7 @@ public:
{
BeforeSetAttr(aNameSpaceID, aAttribute, nsnull, aNotify);
nsresult rv = nsGenericHTMLLeafElement::UnsetAttr(aNameSpaceID,
aAttribute,
nsresult rv = nsGenericHTMLFormElement::UnsetAttr(aNameSpaceID, aAttribute,
aNotify);
AfterSetAttr(aNameSpaceID, aAttribute, nsnull, aNotify);
@ -354,7 +352,7 @@ NS_NewHTMLInputElement(nsIHTMLContent** aInstancePtrResult,
return NS_ERROR_OUT_OF_MEMORY;
}
nsresult rv = NS_STATIC_CAST(nsGenericHTMLElement *, it)->Init(aNodeInfo);
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
delete it;
@ -393,7 +391,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLInputElement, nsGenericElement)
// QueryInterface implementation for nsHTMLInputElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLInputElement,
nsGenericHTMLLeafFormElement)
nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLInputElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLInputElement)
NS_INTERFACE_MAP_ENTRY(nsITextControlElement)
@ -421,12 +419,12 @@ nsHTMLInputElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
nsresult rv = NS_STATIC_CAST(nsGenericHTMLElement *, it)->Init(mNodeInfo);
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
switch (mType) {
case NS_FORM_INPUT_TEXT:
@ -587,7 +585,7 @@ nsHTMLInputElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
NS_IMETHODIMP
nsHTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLLeafFormElement::GetForm(aForm);
return nsGenericHTMLFormElement::GetForm(aForm);
}
NS_IMETHODIMP
@ -863,9 +861,9 @@ nsHTMLInputElement::SetValueInternal(const nsAString& aValue,
}
// Treat value == defaultValue for other input elements.
return nsGenericHTMLLeafFormElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::value,
aValue, PR_TRUE);
return nsGenericHTMLFormElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::value, aValue,
PR_TRUE);
}
NS_IMETHODIMP
@ -1499,11 +1497,9 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
// Try script event handlers first if its not a focus/blur event
//we dont want the doc to get these
rv = nsGenericHTMLLeafFormElement::HandleDOMEvent(aPresContext,
aEvent,
aDOMEvent,
aFlags,
aEventStatus);
rv = nsGenericHTMLFormElement::HandleDOMEvent(aPresContext, aEvent,
aDOMEvent, aFlags,
aEventStatus);
if (!(aFlags & NS_EVENT_FLAG_CAPTURE) && !(aFlags & NS_EVENT_FLAG_SYSTEM_EVENT) &&
aEvent->message == NS_MOUSE_LEFT_CLICK) {
@ -1743,8 +1739,8 @@ nsHTMLInputElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
WillRemoveFromRadioGroup();
}
nsGenericHTMLLeafFormElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLFormElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
if (mType == NS_FORM_INPUT_IMAGE &&
documentChanging && aDocument && GetParent()) {
@ -1774,7 +1770,7 @@ nsHTMLInputElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
void
nsHTMLInputElement::SetParent(nsIContent* aParent)
{
nsGenericHTMLLeafFormElement::SetParent(aParent);
nsGenericHTMLFormElement::SetParent(aParent);
if (mType == NS_FORM_INPUT_IMAGE && aParent && mDocument) {
// Our base URI may have changed; claim that our URI changed, and the
// nsImageLoadingContent will decide whether a new image load is warranted.
@ -1932,8 +1928,8 @@ nsHTMLInputElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLLeafFormElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
aResult);
}
static void
@ -1944,17 +1940,17 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
aAttributes->GetAttribute(nsHTMLAtoms::type, value);
if (value.GetUnit() == eHTMLUnit_Enumerated &&
value.GetIntValue() == NS_FORM_INPUT_IMAGE) {
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageSizeAttributesInto(aAttributes, aData);
// Images treat align as "float"
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageAlignAttributeInto(aAttributes, aData);
} else {
// Everything else treats align as "text-align"
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapDivAlignAttributeInto(aAttributes, aData);
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP
@ -1963,8 +1959,8 @@ nsHTMLInputElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
nsChangeHint& aHint) const
{
nsresult rv =
nsGenericHTMLLeafFormElement::GetAttributeChangeHint(aAttribute,
aModType, aHint);
nsGenericHTMLFormElement::GetAttributeChangeHint(aAttribute, aModType,
aHint);
if (aAttribute == nsHTMLAtoms::type) {
NS_UpdateHint(aHint, NS_STYLE_HINT_FRAMECHANGE);
} else if (aAttribute == nsHTMLAtoms::value) {

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsIPresContext.h"
class nsHTMLInsElement : public nsGenericHTMLContainerElement,
class nsHTMLInsElement : public nsGenericHTMLElement,
public nsIDOMHTMLModElement
{
public:
@ -55,13 +55,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLModElement
NS_DECL_NSIDOMHTMLMODELEMENT
@ -108,8 +108,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLInsElement, nsGenericElement)
// QueryInterface implementation for nsHTMLInsElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLInsElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLInsElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLModElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLInsElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -134,7 +133,7 @@ nsHTMLInsElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsMappedAttributes.h"
#include "nsRuleNode.h"
class nsHTMLLIElement : public nsGenericHTMLContainerElement,
class nsHTMLLIElement : public nsGenericHTMLElement,
public nsIDOMHTMLLIElement
{
public:
@ -56,13 +56,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLLIElement
NS_DECL_NSIDOMHTMLLIELEMENT
@ -118,8 +118,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLLIElement, nsGenericElement)
// QueryInterface implementation for nsHTMLLIElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLLIElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLLIElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLLIElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLLIElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -144,7 +143,7 @@ nsHTMLLIElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -210,8 +209,7 @@ nsHTMLLIElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -55,7 +55,7 @@
#include "nsIEventStateManager.h"
class nsHTMLLabelElement : public nsGenericHTMLContainerFormElement,
class nsHTMLLabelElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLLabelElement
{
public:
@ -66,103 +66,100 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerFormElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLFormElement::)
// nsIDOMElement, because of the "htmlFor" attribute handling we can't
// use the NS_FORWARD_NSIDOMHTMLELEMENT macro here...
NS_IMETHOD GetTagName(nsAString& aTagName) {
return nsGenericHTMLContainerFormElement::GetTagName(aTagName);
return nsGenericHTMLFormElement::GetTagName(aTagName);
}
NS_IMETHOD GetAttribute(const nsAString& aName,
nsAString& aReturn) {
nsAutoString name(aName);
if (name.EqualsIgnoreCase("htmlfor")) {
return nsGenericHTMLContainerFormElement::GetAttribute(NS_LITERAL_STRING("for"), aReturn);
return nsGenericHTMLFormElement::GetAttribute(NS_LITERAL_STRING("for"), aReturn);
}
return nsGenericHTMLContainerFormElement::GetAttribute(aName, aReturn);
return nsGenericHTMLFormElement::GetAttribute(aName, aReturn);
}
NS_IMETHOD SetAttribute(const nsAString& aName,
const nsAString& aValue) {
nsAutoString name(aName);
if (name.EqualsIgnoreCase("htmlfor")) {
return nsGenericHTMLContainerElement::SetAttribute(NS_LITERAL_STRING("for"), aValue);
return nsGenericHTMLFormElement::SetAttribute(NS_LITERAL_STRING("for"), aValue);
}
return nsGenericHTMLContainerElement::SetAttribute(aName, aValue);
return nsGenericHTMLFormElement::SetAttribute(aName, aValue);
}
NS_IMETHOD RemoveAttribute(const nsAString& aName) {
nsAutoString name(aName);
if (name.EqualsIgnoreCase("htmlfor")) {
return nsGenericHTMLContainerFormElement::RemoveAttribute(NS_LITERAL_STRING("for"));
return nsGenericHTMLFormElement::RemoveAttribute(NS_LITERAL_STRING("for"));
}
return nsGenericHTMLContainerFormElement::RemoveAttribute(aName);
return nsGenericHTMLFormElement::RemoveAttribute(aName);
}
NS_IMETHOD GetAttributeNode(const nsAString& aName,
nsIDOMAttr** aReturn) {
nsAutoString name(aName);
if (name.EqualsIgnoreCase("htmlfor")) {
return nsGenericHTMLContainerFormElement::GetAttributeNode(NS_LITERAL_STRING("for"), aReturn);
return nsGenericHTMLFormElement::GetAttributeNode(NS_LITERAL_STRING("for"), aReturn);
}
return nsGenericHTMLContainerFormElement::GetAttributeNode(aName, aReturn);
return nsGenericHTMLFormElement::GetAttributeNode(aName, aReturn);
}
NS_IMETHOD SetAttributeNode(nsIDOMAttr* aNewAttr, nsIDOMAttr** aReturn) {
return nsGenericHTMLContainerFormElement::SetAttributeNode(aNewAttr, aReturn);
return nsGenericHTMLFormElement::SetAttributeNode(aNewAttr, aReturn);
}
NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* aOldAttr, nsIDOMAttr** aReturn) {
return nsGenericHTMLContainerFormElement::RemoveAttributeNode(aOldAttr, aReturn);
return nsGenericHTMLFormElement::RemoveAttributeNode(aOldAttr, aReturn);
}
NS_IMETHOD GetElementsByTagName(const nsAString& aTagname,
nsIDOMNodeList** aReturn) {
return nsGenericHTMLContainerFormElement::GetElementsByTagName(aTagname,
aReturn);
return nsGenericHTMLFormElement::GetElementsByTagName(aTagname, aReturn);
}
NS_IMETHOD GetAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsAString& aReturn) {
return nsGenericHTMLContainerFormElement::GetAttributeNS(aNamespaceURI,
aLocalName,
aReturn);
return nsGenericHTMLFormElement::GetAttributeNS(aNamespaceURI, aLocalName,
aReturn);
}
NS_IMETHOD SetAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aQualifiedName,
const nsAString& aValue) {
return nsGenericHTMLContainerFormElement::SetAttributeNS(aNamespaceURI,
aQualifiedName,
aValue);
return nsGenericHTMLFormElement::SetAttributeNS(aNamespaceURI,
aQualifiedName,
aValue);
}
NS_IMETHOD RemoveAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName) {
return nsGenericHTMLContainerFormElement::RemoveAttributeNS(aNamespaceURI,
aLocalName);
return nsGenericHTMLFormElement::RemoveAttributeNS(aNamespaceURI,
aLocalName);
}
NS_IMETHOD GetAttributeNodeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMAttr** aReturn) {
return nsGenericHTMLContainerFormElement::GetAttributeNodeNS(aNamespaceURI,
aLocalName,
aReturn);
return nsGenericHTMLFormElement::GetAttributeNodeNS(aNamespaceURI,
aLocalName, aReturn);
}
NS_IMETHOD SetAttributeNodeNS(nsIDOMAttr* aNewAttr, nsIDOMAttr** aReturn) {
return nsGenericHTMLContainerFormElement::SetAttributeNodeNS(aNewAttr,
aReturn);
return nsGenericHTMLFormElement::SetAttributeNodeNS(aNewAttr, aReturn);
}
NS_IMETHOD GetElementsByTagNameNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
nsIDOMNodeList** aReturn) {
return nsGenericHTMLContainerFormElement::GetElementsByTagNameNS(aNamespaceURI, aLocalName, aReturn);
return nsGenericHTMLFormElement::GetElementsByTagNameNS(aNamespaceURI,
aLocalName,
aReturn);
}
NS_IMETHOD HasAttribute(const nsAString& aName, PRBool* aReturn) {
return nsGenericHTMLContainerFormElement::HasAttribute(aName, aReturn);
return nsGenericHTMLFormElement::HasAttribute(aName, aReturn);
}
NS_IMETHOD HasAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
PRBool* aReturn) {
return nsGenericHTMLContainerFormElement::HasAttributeNS(aNamespaceURI,
aLocalName,
aReturn);
return nsGenericHTMLFormElement::HasAttributeNS(aNamespaceURI, aLocalName,
aReturn);
}
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerFormElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLLabelElement
NS_DECL_NSIDOMHTMLLABELELEMENT
@ -246,7 +243,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLLabelElement, nsGenericElement)
// QueryInterface implementation for nsHTMLLabelElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLLabelElement,
nsGenericHTMLContainerFormElement)
nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLLabelElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLLabelElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -273,7 +270,7 @@ nsHTMLLabelElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -285,7 +282,7 @@ nsHTMLLabelElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsHTMLLabelElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLContainerFormElement::GetForm(aForm);
return nsGenericHTMLFormElement::GetForm(aForm);
}
@ -295,8 +292,8 @@ NS_IMPL_STRING_ATTR(nsHTMLLabelElement, AccessKey, accesskey)
NS_IMETHODIMP
nsHTMLLabelElement::GetHtmlFor(nsAString& aValue)
{
nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_None,
nsHTMLAtoms::_for, aValue);
nsGenericHTMLFormElement::GetAttr(kNameSpaceID_None, nsHTMLAtoms::_for,
aValue);
return NS_OK;
}
@ -307,9 +304,8 @@ nsHTMLLabelElement::SetHtmlFor(const nsAString& aValue)
static char whitespace[] = " \r\n\t";
nsAutoString value(aValue);
value.Trim(whitespace, PR_TRUE, PR_TRUE);
return nsGenericHTMLContainerFormElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::_for,
value, PR_TRUE);
return nsGenericHTMLFormElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::_for, value, PR_TRUE);
}
void
@ -323,8 +319,8 @@ nsHTMLLabelElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
RegUnRegAccessKey(PR_FALSE);
}
nsGenericHTMLContainerFormElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLFormElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
// Register the access key for the new document.
if (documentChanging && mDocument) {
@ -364,8 +360,9 @@ nsHTMLLabelElement::HandleDOMEvent(nsIPresContext* aPresContext,
{
NS_ENSURE_ARG_POINTER(aEventStatus);
nsresult rv = nsGenericHTMLContainerFormElement::HandleDOMEvent(aPresContext,
aEvent, aDOMEvent, aFlags, aEventStatus);
nsresult rv = nsGenericHTMLFormElement::HandleDOMEvent(aPresContext, aEvent,
aDOMEvent, aFlags,
aEventStatus);
if (NS_FAILED(rv))
return rv;

Просмотреть файл

@ -47,7 +47,7 @@
#include "nsIFormControl.h"
class nsHTMLLegendElement : public nsGenericHTMLContainerFormElement,
class nsHTMLLegendElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLLegendElement
{
public:
@ -58,13 +58,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLFormElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLLegendElement
NS_DECL_NSIDOMHTMLLEGENDELEMENT
@ -129,7 +129,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLLegendElement, nsGenericElement)
// QueryInterface implementation for nsHTMLLegendElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLLegendElement,
nsGenericHTMLContainerFormElement)
nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLLegendElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLLegendElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -155,7 +155,7 @@ nsHTMLLegendElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -167,7 +167,7 @@ nsHTMLLegendElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsHTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLContainerFormElement::GetForm(aForm);
return nsGenericHTMLFormElement::GetForm(aForm);
}
@ -210,8 +210,8 @@ nsHTMLLegendElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerFormElement::AttributeToString(aAttribute,
aValue, aResult);
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
aResult);
}
NS_IMETHODIMP
@ -220,8 +220,8 @@ nsHTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
nsChangeHint& aHint) const
{
nsresult rv =
nsGenericHTMLContainerFormElement::GetAttributeChangeHint(aAttribute,
aModType, aHint);
nsGenericHTMLFormElement::GetAttributeChangeHint(aAttribute, aModType,
aHint);
if (aAttribute == nsHTMLAtoms::align) {
NS_UpdateHint(aHint, NS_STYLE_HINT_REFLOW);
}

Просмотреть файл

@ -58,7 +58,7 @@
#include "nsIDOMEventTarget.h"
#include "nsParserUtils.h"
class nsHTMLLinkElement : public nsGenericHTMLLeafElement,
class nsHTMLLinkElement : public nsGenericHTMLElement,
public nsIDOMHTMLLinkElement,
public nsILink,
public nsStyleLinkElement
@ -71,13 +71,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLLinkElement
NS_DECL_NSIDOMHTMLLINKELEMENT
@ -162,8 +162,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLLinkElement, nsGenericElement)
// QueryInterface implementation for nsHTMLLinkElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLLinkElement,
nsGenericHTMLLeafElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLLinkElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLLinkElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMLinkStyle)
NS_INTERFACE_MAP_ENTRY(nsILink)
@ -191,7 +190,7 @@ nsHTMLLinkElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -254,8 +253,7 @@ nsHTMLLinkElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
NS_LITERAL_STRING("DOMLinkRemoved"));
// Do the removal and addition into the new doc.
nsGenericHTMLLeafElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLElement::SetDocument(aDocument, aDeep, aCompileEventHandlers);
UpdateStyleSheet(oldDoc);
CreateAndDispatchEvent(mDocument, rel, rev,
@ -303,8 +301,8 @@ nsHTMLLinkElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
SetLinkState(eLinkState_Unknown);
}
nsresult rv = nsGenericHTMLLeafElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
if (NS_SUCCEEDED(rv)) {
UpdateStyleSheet();
}
@ -316,8 +314,8 @@ nsresult
nsHTMLLinkElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify)
{
nsresult rv = nsGenericHTMLLeafElement::UnsetAttr(aNameSpaceID, aAttribute,
aNotify);
nsresult rv = nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute,
aNotify);
if (NS_SUCCEEDED(rv)) {
UpdateStyleSheet();
}

Просмотреть файл

@ -48,7 +48,7 @@
#include "nsCOMPtr.h"
class nsHTMLMapElement : public nsGenericHTMLContainerElement,
class nsHTMLMapElement : public nsGenericHTMLElement,
public nsIDOMHTMLMapElement
{
public:
@ -59,13 +59,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLMapElement
NS_DECL_NSIDOMHTMLMAPELEMENT
@ -124,8 +124,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLMapElement, nsGenericElement)
// QueryInterface implementation for nsHTMLMapElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLMapElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLMapElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLMapElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLMapElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -145,8 +144,7 @@ nsHTMLMapElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
}
}
nsGenericHTMLContainerElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLElement::SetDocument(aDocument, aDeep, aCompileEventHandlers);
if (documentChanging) {
// Since we changed the document, gotta re-QI
@ -177,7 +175,7 @@ nsHTMLMapElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -50,7 +50,7 @@
extern nsHTMLValue::EnumTable kListTypeTable[];
class nsHTMLMenuElement : public nsGenericHTMLContainerElement,
class nsHTMLMenuElement : public nsGenericHTMLElement,
public nsIDOMHTMLMenuElement
{
public:
@ -61,13 +61,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLMenuElement
NS_IMETHOD GetCompact(PRBool* aCompact);
@ -124,8 +124,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLMenuElement, nsGenericElement)
// QueryInterface implementation for nsHTMLMenuElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLMenuElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLMenuElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLMenuElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLMenuElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -150,7 +149,7 @@ nsHTMLMenuElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -192,8 +191,7 @@ nsHTMLMenuElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsIPresContext.h"
class nsHTMLMetaElement : public nsGenericHTMLLeafElement,
class nsHTMLMetaElement : public nsGenericHTMLElement,
public nsIDOMHTMLMetaElement
{
public:
@ -55,13 +55,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLMetaElement
NS_DECL_NSIDOMHTMLMETAELEMENT
@ -110,7 +110,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLMetaElement, nsGenericElement)
// QueryInterface implementation for nsHTMLMetaElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLMetaElement,
nsGenericHTMLLeafElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLMetaElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLMetaElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -135,7 +135,7 @@ nsHTMLMetaElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsMappedAttributes.h"
#include "nsRuleNode.h"
class nsHTMLOListElement : public nsGenericHTMLContainerElement,
class nsHTMLOListElement : public nsGenericHTMLElement,
public nsIDOMHTMLOListElement
{
public:
@ -56,13 +56,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLOListElement
NS_DECL_NSIDOMHTMLOLISTELEMENT
@ -118,8 +118,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLOListElement, nsGenericElement)
// QueryInterface implementation for nsHTMLOListElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLOListElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLOListElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLOListElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLOListElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -144,7 +143,7 @@ nsHTMLOListElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -228,8 +227,7 @@ nsHTMLOListElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -48,7 +48,7 @@
#include "nsIWebNavigation.h"
#include "nsIFormControl.h"
class nsHTMLObjectElement : public nsGenericHTMLContainerFormElement,
class nsHTMLObjectElement : public nsGenericHTMLFormElement,
public nsImageLoadingContent,
public nsIDOMHTMLObjectElement
{
@ -60,13 +60,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLFormElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLObjectElement
NS_DECL_NSIDOMHTMLOBJECTELEMENT
@ -130,7 +130,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLObjectElement, nsGenericElement)
// QueryInterface implementation for nsHTMLObjectElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLObjectElement,
nsGenericHTMLContainerFormElement)
nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLObjectElement)
NS_INTERFACE_MAP_ENTRY(imgIDecoderObserver)
NS_INTERFACE_MAP_ENTRY(nsIImageLoadingContent)
@ -157,7 +157,7 @@ nsHTMLObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -169,7 +169,7 @@ nsHTMLObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsHTMLObjectElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLContainerFormElement::GetForm(aForm);
return nsGenericHTMLFormElement::GetForm(aForm);
}
// nsIFormControl
@ -275,19 +275,19 @@ nsHTMLObjectElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
aResult);
}
static void
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
{
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP_(PRBool)

Просмотреть файл

@ -52,7 +52,7 @@
/**
* The implementation of &lt;optgroup&gt;
*/
class nsHTMLOptGroupElement : public nsGenericHTMLContainerElement,
class nsHTMLOptGroupElement : public nsGenericHTMLElement,
public nsIDOMHTMLOptGroupElement
{
public:
@ -63,13 +63,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLOptGroupElement
NS_DECL_NSIDOMHTMLOPTGROUPELEMENT
@ -139,7 +139,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLOptGroupElement, nsGenericElement)
// QueryInterface implementation for nsHTMLOptGroupElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLOptGroupElement,
nsGenericHTMLContainerElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLOptGroupElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLOptGroupElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -164,7 +164,7 @@ nsHTMLOptGroupElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -207,9 +207,8 @@ nsHTMLOptGroupElement::HandleDOMEvent(nsIPresContext* aPresContext,
}
}
return nsGenericHTMLContainerElement::HandleDOMEvent(aPresContext, aEvent,
aDOMEvent, aFlags,
aEventStatus);
return nsGenericHTMLElement::HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
aFlags, aEventStatus);
}
void
@ -238,9 +237,7 @@ nsHTMLOptGroupElement::AppendChildTo(nsIContent* aKid, PRBool aNotify,
}
// Actually perform the append
return nsGenericHTMLContainerElement::AppendChildTo(aKid,
aNotify,
aDeepSetDocument);
return nsGenericHTMLElement::AppendChildTo(aKid, aNotify, aDeepSetDocument);
}
nsresult
@ -253,10 +250,8 @@ nsHTMLOptGroupElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
sel->WillAddOptions(aKid, this, aIndex);
}
return nsGenericHTMLContainerElement::InsertChildAt(aKid,
aIndex,
aNotify,
aDeepSetDocument);
return nsGenericHTMLElement::InsertChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
}
nsresult
@ -270,10 +265,8 @@ nsHTMLOptGroupElement::ReplaceChildAt(nsIContent* aKid, PRUint32 aIndex,
sel->WillAddOptions(aKid, this, aIndex);
}
return nsGenericHTMLContainerElement::ReplaceChildAt(aKid,
aIndex,
aNotify,
aDeepSetDocument);
return nsGenericHTMLElement::ReplaceChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
}
nsresult
@ -285,8 +278,5 @@ nsHTMLOptGroupElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify)
sel->WillRemoveOptions(this, aIndex);
}
nsresult rv = nsGenericHTMLContainerElement::RemoveChildAt(aIndex,
aNotify);
return rv;
return nsGenericHTMLElement::RemoveChildAt(aIndex, aNotify);
}

Просмотреть файл

@ -74,7 +74,7 @@
/**
* Implementation of &lt;option&gt;
*/
class nsHTMLOptionElement : public nsGenericHTMLContainerElement,
class nsHTMLOptionElement : public nsGenericHTMLElement,
public nsIDOMHTMLOptionElement,
public nsIDOMNSHTMLOptionElement,
public nsIJSNativeInitializer,
@ -88,13 +88,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLOptionElement
NS_DECL_NSIDOMHTMLOPTIONELEMENT
@ -215,8 +215,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLOptionElement, nsGenericElement)
// QueryInterface implementation for nsHTMLOptionElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLOptionElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLOptionElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLOptionElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLOptionElement)
NS_INTERFACE_MAP_ENTRY(nsIJSNativeInitializer)
@ -244,7 +243,7 @@ nsHTMLOptionElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -385,8 +384,7 @@ nsHTMLOptionElement::SetDisabled(PRBool aDisabled)
NS_IMETHODIMP
nsHTMLOptionElement::GetLabel(nsAString& aValue)
{
nsGenericHTMLContainerElement::GetAttr(kNameSpaceID_None,
nsHTMLAtoms::label, aValue);
nsGenericHTMLElement::GetAttr(kNameSpaceID_None, nsHTMLAtoms::label, aValue);
return NS_OK;
}
@ -395,9 +393,8 @@ nsHTMLOptionElement::SetLabel(const nsAString& aValue)
{
nsresult result;
result = nsGenericHTMLContainerElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::label,
aValue, PR_TRUE);
result = nsGenericHTMLElement::SetAttr(kNameSpaceID_None, nsHTMLAtoms::label,
aValue, PR_TRUE);
// XXX Why does this only happen to the combobox? and what about
// when the text gets set and label is blank?
if (NS_SUCCEEDED(result)) {
@ -495,8 +492,7 @@ nsHTMLOptionElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
nsChangeHint& aHint) const
{
nsresult rv =
nsGenericHTMLContainerElement::GetAttributeChangeHint(aAttribute,
aModType, aHint);
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType, aHint);
if (aAttribute == nsHTMLAtoms::label ||
aAttribute == nsHTMLAtoms::text) {
@ -599,9 +595,8 @@ nsresult
nsHTMLOptionElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument)
{
nsresult rv = nsGenericHTMLContainerElement::InsertChildAt(aKid, aIndex,
aNotify,
aDeepSetDocument);
nsresult rv = nsGenericHTMLElement::InsertChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
NotifyTextChanged();
return rv;
}
@ -610,9 +605,8 @@ nsresult
nsHTMLOptionElement::ReplaceChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument)
{
nsresult rv = nsGenericHTMLContainerElement::ReplaceChildAt(aKid, aIndex,
aNotify,
aDeepSetDocument);
nsresult rv = nsGenericHTMLElement::ReplaceChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
NotifyTextChanged();
return rv;
}
@ -620,9 +614,8 @@ nsHTMLOptionElement::ReplaceChildAt(nsIContent* aKid, PRUint32 aIndex,
nsresult
nsHTMLOptionElement::AppendChildTo(nsIContent* aKid, PRBool aNotify, PRBool aDeepSetDocument)
{
nsresult rv = nsGenericHTMLContainerElement::AppendChildTo(aKid,
aNotify,
aDeepSetDocument);
nsresult rv = nsGenericHTMLElement::AppendChildTo(aKid, aNotify,
aDeepSetDocument);
NotifyTextChanged();
return rv;
}
@ -630,8 +623,7 @@ nsHTMLOptionElement::AppendChildTo(nsIContent* aKid, PRBool aNotify, PRBool aDee
nsresult
nsHTMLOptionElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify)
{
nsresult rv = nsGenericHTMLContainerElement::RemoveChildAt(aIndex,
aNotify);
nsresult rv = nsGenericHTMLElement::RemoveChildAt(aIndex, aNotify);
NotifyTextChanged();
return rv;
}
@ -718,9 +710,9 @@ nsHTMLOptionElement::Initialize(JSContext* aContext,
nsAutoString value(NS_REINTERPRET_CAST(const PRUnichar*,
JS_GetStringChars(jsstr)));
result = nsGenericHTMLContainerElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::value,
value, PR_FALSE);
result = nsGenericHTMLElement::SetAttr(kNameSpaceID_None,
nsHTMLAtoms::value, value,
PR_FALSE);
if (NS_FAILED(result)) {
return result;
}

Просмотреть файл

@ -48,7 +48,7 @@
// XXX missing nav attributes
class nsHTMLParagraphElement : public nsGenericHTMLContainerElement,
class nsHTMLParagraphElement : public nsGenericHTMLElement,
public nsIDOMHTMLParagraphElement
{
public:
@ -59,13 +59,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLParagraphElement
NS_DECL_NSIDOMHTMLPARAGRAPHELEMENT
@ -122,7 +122,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLParagraphElement, nsGenericElement)
// QueryInterface implementation for nsHTMLParagraphElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLParagraphElement,
nsGenericHTMLContainerElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLParagraphElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLParagraphElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -147,7 +147,7 @@ nsHTMLParagraphElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -185,8 +185,7 @@ nsHTMLParagraphElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -49,7 +49,7 @@
// XXX wrap, variable, cols, tabstop
class nsHTMLPreElement : public nsGenericHTMLContainerElement,
class nsHTMLPreElement : public nsGenericHTMLElement,
public nsIDOMHTMLPreElement
{
public:
@ -60,13 +60,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLPreElement
NS_IMETHOD GetWidth(PRInt32* aWidth);
@ -123,8 +123,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLPreElement, nsGenericElement)
// QueryInterface implementation for nsHTMLPreElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLPreElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLPreElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLPreElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLPreElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -149,7 +148,7 @@ nsHTMLPreElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -253,8 +252,7 @@ nsHTMLPreElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
nsChangeHint& aHint) const
{
nsresult rv =
nsGenericHTMLContainerElement::GetAttributeChangeHint(aAttribute,
aModType, aHint);
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType, aHint);
if (aAttribute == nsHTMLAtoms::tabstop) {
NS_UpdateHint(aHint, NS_STYLE_HINT_REFLOW);
}

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsIPresContext.h"
class nsHTMLQuoteElement : public nsGenericHTMLContainerElement,
class nsHTMLQuoteElement : public nsGenericHTMLElement,
public nsIDOMHTMLQuoteElement
{
public:
@ -55,13 +55,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLQuoteElement
NS_DECL_NSIDOMHTMLQUOTEELEMENT
@ -107,8 +107,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLQuoteElement, nsGenericElement)
// QueryInterface implementation for nsHTMLQuoteElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLQuoteElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLQuoteElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLQuoteElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLQuoteElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -133,7 +132,7 @@ nsHTMLQuoteElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -307,7 +307,7 @@ nsHTMLScriptEventHandler::Invoke(nsISupports *aTargetObject,
}
class nsHTMLScriptElement : public nsGenericHTMLContainerElement,
class nsHTMLScriptElement : public nsGenericHTMLElement,
public nsIDOMHTMLScriptElement,
public nsIScriptLoaderObserver,
public nsIScriptElement
@ -320,13 +320,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLScriptElement
NS_DECL_NSIDOMHTMLSCRIPTELEMENT
@ -428,8 +428,7 @@ NS_IMPL_ADDREF_INHERITED(nsHTMLScriptElement, nsGenericElement)
NS_IMPL_RELEASE_INHERITED(nsHTMLScriptElement, nsGenericElement)
// QueryInterface implementation for nsHTMLScriptElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLScriptElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLScriptElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLScriptElement)
NS_INTERFACE_MAP_ENTRY(nsIScriptLoaderObserver)
NS_INTERFACE_MAP_ENTRY(nsIScriptElement)
@ -446,9 +445,8 @@ nsHTMLScriptElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
nsresult rv = nsGenericHTMLContainerElement::SetAttr(aNameSpaceID, aName,
aPrefix, aValue,
aNotify);
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
if (aNameSpaceID != kNameSpaceID_None) {
@ -466,8 +464,7 @@ void
nsHTMLScriptElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
PRBool aCompileEventHandlers)
{
nsGenericHTMLContainerElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLElement::SetDocument(aDocument, aDeep, aCompileEventHandlers);
if (aDocument) {
MaybeProcessScript();
}
@ -477,9 +474,8 @@ nsresult
nsHTMLScriptElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument)
{
nsresult rv = nsGenericHTMLContainerElement::InsertChildAt(aKid, aIndex,
aNotify,
aDeepSetDocument);
nsresult rv = nsGenericHTMLElement::InsertChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
if (NS_SUCCEEDED(rv) && aNotify) {
MaybeProcessScript();
}
@ -491,8 +487,8 @@ nsresult
nsHTMLScriptElement::AppendChildTo(nsIContent* aKid, PRBool aNotify,
PRBool aDeepSetDocument)
{
nsresult rv = nsGenericHTMLContainerElement::AppendChildTo(aKid, aNotify,
aDeepSetDocument);
nsresult rv = nsGenericHTMLElement::AppendChildTo(aKid, aNotify,
aDeepSetDocument);
if (NS_SUCCEEDED(rv) && aNotify) {
MaybeProcessScript();
}
@ -519,7 +515,7 @@ nsHTMLScriptElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -180,7 +180,7 @@ NS_IMPL_ISUPPORTS0(nsSelectState)
/**
* Implementation of &lt;select&gt;
*/
class nsHTMLSelectElement : public nsGenericHTMLContainerFormElement,
class nsHTMLSelectElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLSelectElement,
public nsIDOMNSHTMLSelectElement,
public nsIDOMNSXBLFormControl,
@ -194,13 +194,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLFormElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLSelectElement
NS_DECL_NSIDOMHTMLSELECTELEMENT
@ -431,7 +431,7 @@ NS_NewHTMLSelectElement(nsIHTMLContent** aInstancePtrResult,
return NS_ERROR_OUT_OF_MEMORY;
}
nsresult rv = NS_STATIC_CAST(nsGenericHTMLElement *, it)->Init(aNodeInfo);
nsresult rv = it->Init(aNodeInfo);
if (NS_FAILED(rv)) {
delete it;
@ -478,7 +478,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLSelectElement, nsGenericElement)
// QueryInterface implementation for nsHTMLSelectElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLSelectElement,
nsGenericHTMLContainerFormElement)
nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLSelectElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLSelectElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSXBLFormControl)
@ -503,12 +503,12 @@ nsHTMLSelectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
nsCOMPtr<nsIDOMNode> kungFuDeathGrip(it);
nsresult rv = NS_STATIC_CAST(nsGenericHTMLElement *, it)->Init(mNodeInfo);
nsresult rv = it->Init(mNodeInfo);
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -520,7 +520,7 @@ nsHTMLSelectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsHTMLSelectElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLContainerFormElement::GetForm(aForm);
return nsGenericHTMLFormElement::GetForm(aForm);
}
@ -532,9 +532,8 @@ nsHTMLSelectElement::AppendChildTo(nsIContent* aKid, PRBool aNotify,
WillAddOptions(aKid, this, GetChildCount());
// Actually perform the append
return nsGenericHTMLContainerFormElement::AppendChildTo(aKid,
aNotify,
aDeepSetDocument);
return nsGenericHTMLFormElement::AppendChildTo(aKid, aNotify,
aDeepSetDocument);
}
nsresult
@ -543,10 +542,8 @@ nsHTMLSelectElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
{
WillAddOptions(aKid, this, aIndex);
return nsGenericHTMLContainerFormElement::InsertChildAt(aKid,
aIndex,
aNotify,
aDeepSetDocument);
return nsGenericHTMLFormElement::InsertChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
}
nsresult
@ -556,10 +553,8 @@ nsHTMLSelectElement::ReplaceChildAt(nsIContent* aKid, PRUint32 aIndex,
WillRemoveOptions(this, aIndex);
WillAddOptions(aKid, this, aIndex);
return nsGenericHTMLContainerFormElement::ReplaceChildAt(aKid,
aIndex,
aNotify,
aDeepSetDocument);
return nsGenericHTMLFormElement::ReplaceChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
}
nsresult
@ -567,8 +562,7 @@ nsHTMLSelectElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify)
{
WillRemoveOptions(this, aIndex);
return nsGenericHTMLContainerFormElement::RemoveChildAt(aIndex,
aNotify);
return nsGenericHTMLFormElement::RemoveChildAt(aIndex, aNotify);
}
@ -1667,9 +1661,9 @@ nsHTMLSelectElement::SetFocus(nsIPresContext* aPresContext)
nsAutoString disabled;
if (NS_CONTENT_ATTR_HAS_VALUE ==
nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_None,
nsHTMLAtoms::disabled,
disabled)) {
nsGenericHTMLFormElement::GetAttr(kNameSpaceID_None,
nsHTMLAtoms::disabled,
disabled)) {
return;
}
@ -1833,8 +1827,8 @@ static void
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
{
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP
@ -1843,8 +1837,8 @@ nsHTMLSelectElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
nsChangeHint& aHint) const
{
nsresult rv =
nsGenericHTMLContainerFormElement::GetAttributeChangeHint(aAttribute,
aModType, aHint);
nsGenericHTMLFormElement::GetAttributeChangeHint(aAttribute, aModType,
aHint);
if (aAttribute == nsHTMLAtoms::multiple ||
aAttribute == nsHTMLAtoms::size) {
NS_UpdateHint(aHint, NS_STYLE_HINT_FRAMECHANGE);
@ -1912,10 +1906,9 @@ nsHTMLSelectElement::HandleDOMEvent(nsIPresContext* aPresContext,
formControlFrame->SetFocus(PR_FALSE, PR_TRUE);
}
return nsGenericHTMLContainerFormElement::HandleDOMEvent(aPresContext,
aEvent, aDOMEvent,
aFlags,
aEventStatus);
return nsGenericHTMLFormElement::HandleDOMEvent(aPresContext, aEvent,
aDOMEvent, aFlags,
aEventStatus);
}
// nsIFormControl

Просмотреть файл

@ -50,7 +50,7 @@
#include "nsRuleNode.h"
class nsHTMLSharedContainerElement : public nsGenericHTMLContainerElement,
class nsHTMLSharedContainerElement : public nsGenericHTMLElement,
public nsIDOMHTMLDirectoryElement,
public nsIDOMHTMLMenuElement,
public nsIDOMHTMLModElement,
@ -66,13 +66,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLModElement and nsIDOMHTMLQuoteElement
NS_DECL_NSIDOMHTMLMODELEMENT
@ -141,7 +141,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLSharedContainerElement, nsGenericElement)
// QueryInterface implementation for nsHTMLSharedContainerElement
NS_HTML_CONTENT_INTERFACE_MAP_AMBIGOUS_BEGIN(nsHTMLSharedContainerElement,
nsGenericHTMLContainerElement,
nsGenericHTMLElement,
nsIDOMHTMLDirectoryElement)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMHTMLElement,
nsIDOMHTMLDirectoryElement)
@ -184,7 +184,7 @@ nsHTMLSharedContainerElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMHTMLModElement *, it);
@ -275,8 +275,7 @@ nsHTMLSharedContainerElement::StringToAttribute(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::StringToAttribute(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::StringToAttribute(aAttribute, aValue, aResult);
}
NS_IMETHODIMP
@ -318,14 +317,13 @@ nsHTMLSharedContainerElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
NS_IMETHODIMP_(PRBool)
nsHTMLSharedContainerElement::HasAttributeDependentStyle(const nsIAtom* aAttr) const
{
if (nsGenericHTMLContainerElement::HasAttributeDependentStyle(aAttr)) {
if (nsGenericHTMLElement::HasAttributeDependentStyle(aAttr)) {
return PR_TRUE;
}
@ -437,5 +435,5 @@ nsHTMLSharedContainerElement::GetAttributeMappingFunction(nsMapRuleToAttributesF
}
return
nsGenericHTMLContainerElement::GetAttributeMappingFunction(aMapRuleFunc);
nsGenericHTMLElement::GetAttributeMappingFunction(aMapRuleFunc);
}

Просмотреть файл

@ -51,7 +51,7 @@
#include "nsStyleContext.h"
class nsHTMLSharedLeafElement : public nsGenericHTMLLeafElement,
class nsHTMLSharedLeafElement : public nsGenericHTMLElement,
public nsImageLoadingContent,
public nsIDOMHTMLEmbedElement,
public nsIDOMHTMLIsIndexElement,
@ -66,13 +66,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLEmbedElement
NS_DECL_NSIDOMHTMLEMBEDELEMENT
@ -145,7 +145,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLSharedLeafElement, nsGenericElement)
// QueryInterface implementation for nsHTMLSharedLeafElement
NS_HTML_CONTENT_INTERFACE_MAP_AMBIGOUS_BEGIN(nsHTMLSharedLeafElement,
nsGenericHTMLLeafElement,
nsGenericHTMLElement,
nsIDOMHTMLEmbedElement)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMHTMLElement, nsIDOMHTMLEmbedElement)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLEmbedElement, embed)
@ -184,7 +184,7 @@ nsHTMLSharedLeafElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMHTMLEmbedElement *, it);
@ -213,7 +213,9 @@ NS_IMPL_STRING_ATTR(nsHTMLSharedLeafElement, Prompt, prompt)
NS_IMETHODIMP
nsHTMLSharedLeafElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return FindForm(aForm);
*aForm = FindForm().get();
return NS_OK;
}
// nsIDOMHTMLBaseElement
@ -252,8 +254,7 @@ nsHTMLSharedLeafElement::StringToAttribute(nsIAtom* aAttribute,
}
}
return nsGenericHTMLLeafElement::StringToAttribute(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::StringToAttribute(aAttribute, aValue, aResult);
}
NS_IMETHODIMP
@ -279,8 +280,7 @@ nsHTMLSharedLeafElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLLeafElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void
@ -423,7 +423,7 @@ nsHTMLSharedLeafElement::HasAttributeDependentStyle(const nsIAtom* aAttribute) c
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
}
return nsGenericHTMLLeafElement::HasAttributeDependentStyle(aAttribute);
return nsGenericHTMLElement::HasAttributeDependentStyle(aAttribute);
}
NS_IMETHODIMP

Просмотреть файл

@ -51,7 +51,7 @@
#include "nsStyleContext.h"
class nsHTMLSharedLeafElement : public nsGenericHTMLLeafElement,
class nsHTMLSharedLeafElement : public nsGenericHTMLElement,
public nsImageLoadingContent,
public nsIDOMHTMLEmbedElement,
public nsIDOMHTMLIsIndexElement,
@ -66,13 +66,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLLeafElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLEmbedElement
NS_DECL_NSIDOMHTMLEMBEDELEMENT
@ -145,7 +145,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLSharedLeafElement, nsGenericElement)
// QueryInterface implementation for nsHTMLSharedLeafElement
NS_HTML_CONTENT_INTERFACE_MAP_AMBIGOUS_BEGIN(nsHTMLSharedLeafElement,
nsGenericHTMLLeafElement,
nsGenericHTMLElement,
nsIDOMHTMLEmbedElement)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMHTMLElement, nsIDOMHTMLEmbedElement)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLEmbedElement, embed)
@ -184,7 +184,7 @@ nsHTMLSharedLeafElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMHTMLEmbedElement *, it);
@ -213,7 +213,9 @@ NS_IMPL_STRING_ATTR(nsHTMLSharedLeafElement, Prompt, prompt)
NS_IMETHODIMP
nsHTMLSharedLeafElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return FindForm(aForm);
*aForm = FindForm().get();
return NS_OK;
}
// nsIDOMHTMLBaseElement
@ -252,8 +254,7 @@ nsHTMLSharedLeafElement::StringToAttribute(nsIAtom* aAttribute,
}
}
return nsGenericHTMLLeafElement::StringToAttribute(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::StringToAttribute(aAttribute, aValue, aResult);
}
NS_IMETHODIMP
@ -279,8 +280,7 @@ nsHTMLSharedLeafElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLLeafElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void
@ -423,7 +423,7 @@ nsHTMLSharedLeafElement::HasAttributeDependentStyle(const nsIAtom* aAttribute) c
return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map));
}
return nsGenericHTMLLeafElement::HasAttributeDependentStyle(aAttribute);
return nsGenericHTMLElement::HasAttributeDependentStyle(aAttribute);
}
NS_IMETHODIMP

Просмотреть файл

@ -48,7 +48,7 @@
#include "nsIWebNavigation.h"
#include "nsIFormControl.h"
class nsHTMLObjectElement : public nsGenericHTMLContainerFormElement,
class nsHTMLObjectElement : public nsGenericHTMLFormElement,
public nsImageLoadingContent,
public nsIDOMHTMLObjectElement
{
@ -60,13 +60,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLFormElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLObjectElement
NS_DECL_NSIDOMHTMLOBJECTELEMENT
@ -130,7 +130,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLObjectElement, nsGenericElement)
// QueryInterface implementation for nsHTMLObjectElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLObjectElement,
nsGenericHTMLContainerFormElement)
nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLObjectElement)
NS_INTERFACE_MAP_ENTRY(imgIDecoderObserver)
NS_INTERFACE_MAP_ENTRY(nsIImageLoadingContent)
@ -157,7 +157,7 @@ nsHTMLObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -169,7 +169,7 @@ nsHTMLObjectElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsHTMLObjectElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLContainerFormElement::GetForm(aForm);
return nsGenericHTMLFormElement::GetForm(aForm);
}
// nsIFormControl
@ -275,19 +275,19 @@ nsHTMLObjectElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
aResult);
}
static void
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
{
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP_(PRBool)

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsIPresContext.h"
#include "nsIAtom.h"
class nsHTMLSpanElement : public nsGenericHTMLContainerElement,
class nsHTMLSpanElement : public nsGenericHTMLElement,
public nsIDOMHTMLElement
{
public:
@ -55,13 +55,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
virtual nsresult GetInnerHTML(nsAString& aInnerHTML);
virtual nsresult SetInnerHTML(const nsAString& aInnerHTML);
@ -108,8 +108,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLSpanElement, nsGenericElement)
// QueryInterface implementation for nsHTMLSpanElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLSpanElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLSpanElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLSpanElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -133,7 +132,7 @@ nsHTMLSpanElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -150,7 +149,7 @@ nsHTMLSpanElement::GetInnerHTML(nsAString& aInnerHTML)
return GetContentsAsText(aInnerHTML);
}
return nsGenericHTMLContainerElement::GetInnerHTML(aInnerHTML);
return nsGenericHTMLElement::GetInnerHTML(aInnerHTML);
}
nsresult
@ -161,5 +160,5 @@ nsHTMLSpanElement::SetInnerHTML(const nsAString& aInnerHTML)
return ReplaceContentsWithText(aInnerHTML, PR_TRUE);
}
return nsGenericHTMLContainerElement::SetInnerHTML(aInnerHTML);
return nsGenericHTMLElement::SetInnerHTML(aInnerHTML);
}

Просмотреть файл

@ -53,7 +53,7 @@
#include "nsParserUtils.h"
class nsHTMLStyleElement : public nsGenericHTMLContainerElement,
class nsHTMLStyleElement : public nsGenericHTMLElement,
public nsIDOMHTMLStyleElement,
public nsStyleLinkElement
{
@ -65,13 +65,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLStyleElement
NS_DECL_NSIDOMHTMLSTYLEELEMENT
@ -149,8 +149,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLStyleElement, nsGenericElement)
// QueryInterface implementation for nsHTMLStyleElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLStyleElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLStyleElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLStyleElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMLinkStyle)
NS_INTERFACE_MAP_ENTRY(nsIStyleSheetLinkingElement)
@ -177,7 +176,7 @@ nsHTMLStyleElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -229,8 +228,8 @@ nsHTMLStyleElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument)
{
nsresult rv =
nsGenericHTMLContainerElement::InsertChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
nsGenericHTMLElement::InsertChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
if (NS_SUCCEEDED(rv)) {
UpdateStyleSheet();
}
@ -243,8 +242,8 @@ nsHTMLStyleElement::ReplaceChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument)
{
nsresult rv =
nsGenericHTMLContainerElement::ReplaceChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
nsGenericHTMLElement::ReplaceChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
if (NS_SUCCEEDED(rv)) {
UpdateStyleSheet();
}
@ -257,8 +256,7 @@ nsHTMLStyleElement::AppendChildTo(nsIContent* aKid, PRBool aNotify,
PRBool aDeepSetDocument)
{
nsresult rv =
nsGenericHTMLContainerElement::AppendChildTo(aKid, aNotify,
aDeepSetDocument);
nsGenericHTMLElement::AppendChildTo(aKid, aNotify, aDeepSetDocument);
if (NS_SUCCEEDED(rv)) {
UpdateStyleSheet();
}
@ -269,7 +267,7 @@ nsHTMLStyleElement::AppendChildTo(nsIContent* aKid, PRBool aNotify,
nsresult
nsHTMLStyleElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify)
{
nsresult rv = nsGenericHTMLContainerElement::RemoveChildAt(aIndex, aNotify);
nsresult rv = nsGenericHTMLElement::RemoveChildAt(aIndex, aNotify);
if (NS_SUCCEEDED(rv)) {
UpdateStyleSheet();
}
@ -283,8 +281,7 @@ nsHTMLStyleElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
{
nsCOMPtr<nsIDocument> oldDoc = mDocument;
nsGenericHTMLContainerElement::SetDocument(aDocument, aDeep,
aCompileEventHandlers);
nsGenericHTMLElement::SetDocument(aDocument, aDeep, aCompileEventHandlers);
UpdateStyleSheet(oldDoc);
}
@ -294,9 +291,8 @@ nsHTMLStyleElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify)
{
nsresult rv = nsGenericHTMLContainerElement::SetAttr(aNameSpaceID, aName,
aPrefix, aValue,
aNotify);
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
if (NS_SUCCEEDED(rv)) {
UpdateStyleSheet();
}
@ -308,9 +304,8 @@ nsresult
nsHTMLStyleElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRBool aNotify)
{
nsresult rv = nsGenericHTMLContainerElement::UnsetAttr(aNameSpaceID,
aAttribute,
aNotify);
nsresult rv = nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute,
aNotify);
if (NS_SUCCEEDED(rv)) {
UpdateStyleSheet();
}

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsMappedAttributes.h"
#include "nsRuleNode.h"
class nsHTMLTableCaptionElement : public nsGenericHTMLContainerElement,
class nsHTMLTableCaptionElement : public nsGenericHTMLElement,
public nsIDOMHTMLTableCaptionElement
{
public:
@ -56,13 +56,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLTableCaptionElement
NS_DECL_NSIDOMHTMLTABLECAPTIONELEMENT
@ -119,7 +119,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTableCaptionElement, nsGenericElement)
// QueryInterface implementation for nsHTMLTableCaptionElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableCaptionElement,
nsGenericHTMLContainerElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTableCaptionElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLTableCaptionElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -144,7 +144,7 @@ nsHTMLTableCaptionElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -49,7 +49,7 @@
#include "nsRuleNode.h"
#include "nsIDocument.h"
class nsHTMLTableCellElement : public nsGenericHTMLContainerElement,
class nsHTMLTableCellElement : public nsGenericHTMLElement,
public nsIHTMLTableCellElement,
public nsIDOMHTMLTableCellElement
{
@ -61,13 +61,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLTableCellElement
NS_DECL_NSIDOMHTMLTABLECELLELEMENT
@ -137,8 +137,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTableCellElement, nsGenericElement)
// QueryInterface implementation for nsHTMLTableCellElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableCellElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableCellElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTableCellElement)
NS_INTERFACE_MAP_ENTRY(nsIHTMLTableCellElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLTableCellElement)
@ -164,7 +163,7 @@ nsHTMLTableCellElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -267,8 +266,7 @@ nsHTMLTableCellElement::GetCellIndex(PRInt32* aCellIndex)
NS_IMETHODIMP
nsHTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
{
nsresult rv =
nsGenericHTMLContainerElement::WalkContentStyleRules(aRuleWalker);
nsresult rv = nsGenericHTMLElement::WalkContentStyleRules(aRuleWalker);
NS_ENSURE_SUCCESS(rv, rv);
// Add style information from the mapped attributes of the table
@ -392,8 +390,7 @@ nsHTMLTableCellElement::StringToAttribute(nsIAtom* aAttribute,
}
}
else if (aAttribute == nsHTMLAtoms::bgcolor) {
if (aResult.ParseColor(aValue,
nsGenericHTMLContainerElement::GetOwnerDocument())) {
if (aResult.ParseColor(aValue, nsGenericHTMLElement::GetOwnerDocument())) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -438,8 +435,7 @@ nsHTMLTableCellElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static

Просмотреть файл

@ -50,7 +50,7 @@
// http://lxr.mozilla.org/classic/source/lib/layout/laytable.c#46
#define MAX_COLSPAN 1000
class nsHTMLTableColElement : public nsGenericHTMLContainerElement,
class nsHTMLTableColElement : public nsGenericHTMLElement,
public nsIDOMHTMLTableColElement,
public nsIHTMLTableColElement
{
@ -62,13 +62,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLTableColElement
NS_DECL_NSIDOMHTMLTABLECOLELEMENT
@ -128,7 +128,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTableColElement, nsGenericElement)
// QueryInterface implementation for nsHTMLTableColElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableColElement,
nsGenericHTMLContainerElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTableColElement)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIHTMLTableColElement, col) // for col only
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLTableColElement)
@ -154,7 +154,7 @@ nsHTMLTableColElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -240,8 +240,7 @@ nsHTMLTableColElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static

Просмотреть файл

@ -61,7 +61,7 @@
class GenericElementCollection;
class TableRowsCollection;
class nsHTMLTableElement : public nsGenericHTMLContainerElement,
class nsHTMLTableElement : public nsGenericHTMLElement,
public nsIDOMHTMLTableElement
{
public:
@ -72,13 +72,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLTableElement
NS_DECL_NSIDOMHTMLTABLEELEMENT
@ -363,8 +363,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTableElement, nsGenericElement)
// QueryInterface implementation for nsHTMLTableElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTableElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLTableElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -389,7 +388,7 @@ nsHTMLTableElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -1009,8 +1008,7 @@ nsHTMLTableElement::StringToAttribute(nsIAtom* aAttribute,
}
else if (aAttribute == nsHTMLAtoms::bgcolor ||
aAttribute == nsHTMLAtoms::bordercolor) {
if (aResult.ParseColor(aValue,
nsGenericHTMLContainerElement::GetOwnerDocument())) {
if (aResult.ParseColor(aValue, nsGenericHTMLElement::GetOwnerDocument())) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -1068,8 +1066,7 @@ nsHTMLTableElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -147,7 +147,7 @@ nsTableCellCollection::Item(PRUint32 aIndex,
//----------------------------------------------------------------------
class nsHTMLTableRowElement : public nsGenericHTMLContainerElement,
class nsHTMLTableRowElement : public nsGenericHTMLElement,
public nsIDOMHTMLTableRowElement
{
public:
@ -158,13 +158,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLTableRowElement
NS_DECL_NSIDOMHTMLTABLEROWELEMENT
@ -257,7 +257,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTableRowElement, nsGenericElement)
// QueryInterface implementation for nsHTMLTableRowElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableRowElement,
nsGenericHTMLContainerElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTableRowElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLTableRowElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -282,7 +282,7 @@ nsHTMLTableRowElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -545,8 +545,7 @@ nsHTMLTableRowElement::StringToAttribute(nsIAtom* aAttribute,
}
}
else if (aAttribute == nsHTMLAtoms::bgcolor) {
if (aResult.ParseColor(aValue,
nsGenericHTMLContainerElement::GetOwnerDocument())) {
if (aResult.ParseColor(aValue, nsGenericHTMLElement::GetOwnerDocument())) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -581,8 +580,7 @@ nsHTMLTableRowElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static

Просмотреть файл

@ -51,7 +51,7 @@
// you will see the phrases "rowgroup" and "section" used interchangably
class nsHTMLTableSectionElement : public nsGenericHTMLContainerElement,
class nsHTMLTableSectionElement : public nsGenericHTMLElement,
public nsIDOMHTMLTableSectionElement
{
public:
@ -62,13 +62,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLTableSectionElement
NS_DECL_NSIDOMHTMLTABLESECTIONELEMENT
@ -133,7 +133,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTableSectionElement, nsGenericElement)
// QueryInterface implementation for nsHTMLTableSectionElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableSectionElement,
nsGenericHTMLContainerElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTableSectionElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLTableSectionElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -158,7 +158,7 @@ nsHTMLTableSectionElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -311,8 +311,7 @@ nsHTMLTableSectionElement::StringToAttribute(nsIAtom* aAttribute,
}
}
else if (aAttribute == nsHTMLAtoms::bgcolor) {
if (aResult.ParseColor(aValue,
nsGenericHTMLContainerElement::GetOwnerDocument())) {
if (aResult.ParseColor(aValue, nsGenericHTMLElement::GetOwnerDocument())) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
@ -347,8 +346,7 @@ nsHTMLTableSectionElement::AttributeToString(nsIAtom* aAttribute,
}
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static

Просмотреть файл

@ -74,7 +74,7 @@
static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID);
class nsHTMLTextAreaElement : public nsGenericHTMLContainerFormElement,
class nsHTMLTextAreaElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLTextAreaElement,
public nsIDOMNSHTMLTextAreaElement,
public nsITextControlElement,
@ -88,13 +88,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLFormElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
// nsIDOMHTMLTextAreaElement
NS_DECL_NSIDOMHTMLTEXTAREAELEMENT
@ -215,7 +215,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTextAreaElement, nsGenericElement)
// QueryInterface implementation for nsHTMLTextAreaElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTextAreaElement,
nsGenericHTMLContainerFormElement)
nsGenericHTMLFormElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTextAreaElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSHTMLTextAreaElement)
NS_INTERFACE_MAP_ENTRY(nsITextControlElement)
@ -245,7 +245,7 @@ nsHTMLTextAreaElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -257,7 +257,7 @@ nsHTMLTextAreaElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsHTMLTextAreaElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLContainerFormElement::GetForm(aForm);
return nsGenericHTMLFormElement::GetForm(aForm);
}
@ -289,9 +289,8 @@ nsHTMLTextAreaElement::SetFocus(nsIPresContext* aPresContext)
nsAutoString disabled;
if (NS_CONTENT_ATTR_HAS_VALUE ==
nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_None,
nsHTMLAtoms::disabled,
disabled)) {
nsGenericHTMLFormElement::GetAttr(kNameSpaceID_None,
nsHTMLAtoms::disabled, disabled)) {
return;
}
@ -343,9 +342,8 @@ nsHTMLTextAreaElement::Select()
// first see if we are disabled or not. If disabled then do nothing.
nsAutoString disabled;
if (NS_CONTENT_ATTR_HAS_VALUE ==
nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_None,
nsHTMLAtoms::disabled,
disabled)) {
nsGenericHTMLFormElement::GetAttr(kNameSpaceID_None,
nsHTMLAtoms::disabled, disabled)) {
return rv;
}
@ -536,8 +534,8 @@ nsHTMLTextAreaElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument)
{
nsresult rv;
rv = nsGenericHTMLContainerFormElement::InsertChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
rv = nsGenericHTMLFormElement::InsertChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
if (!mValueChanged) {
Reset();
}
@ -549,8 +547,8 @@ nsHTMLTextAreaElement::ReplaceChildAt(nsIContent* aKid, PRUint32 aIndex,
PRBool aNotify, PRBool aDeepSetDocument)
{
nsresult rv;
rv = nsGenericHTMLContainerFormElement::ReplaceChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
rv = nsGenericHTMLFormElement::ReplaceChildAt(aKid, aIndex, aNotify,
aDeepSetDocument);
if (!mValueChanged) {
Reset();
}
@ -562,8 +560,8 @@ nsHTMLTextAreaElement::AppendChildTo(nsIContent* aKid, PRBool aNotify,
PRBool aDeepSetDocument)
{
nsresult rv;
rv = nsGenericHTMLContainerFormElement::AppendChildTo(aKid, aNotify,
aDeepSetDocument);
rv = nsGenericHTMLFormElement::AppendChildTo(aKid, aNotify,
aDeepSetDocument);
if (!mValueChanged) {
Reset();
}
@ -574,7 +572,7 @@ nsresult
nsHTMLTextAreaElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify)
{
nsresult rv;
rv = nsGenericHTMLContainerFormElement::RemoveChildAt(aIndex, aNotify);
rv = nsGenericHTMLFormElement::RemoveChildAt(aIndex, aNotify);
if (!mValueChanged) {
Reset();
}
@ -617,8 +615,8 @@ static void
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
{
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapDivAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP
@ -631,8 +629,8 @@ nsHTMLTextAreaElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
// nsTextControlFrame does take care of the entire problem, but
// it doesn't and this makes things better
nsresult rv =
nsGenericHTMLContainerFormElement::GetAttributeChangeHint(aAttribute,
aModType, aHint);
nsGenericHTMLFormElement::GetAttributeChangeHint(aAttribute, aModType,
aHint);
if (aAttribute == nsHTMLAtoms::rows ||
aAttribute == nsHTMLAtoms::cols) {
NS_UpdateHint(aHint, NS_STYLE_HINT_REFLOW);
@ -706,9 +704,9 @@ nsHTMLTextAreaElement::HandleDOMEvent(nsIPresContext* aPresContext,
mHandlingSelect = PR_TRUE;
}
rv = nsGenericHTMLContainerFormElement::HandleDOMEvent(aPresContext, aEvent,
aDOMEvent,
aFlags, aEventStatus);
rv = nsGenericHTMLFormElement::HandleDOMEvent(aPresContext, aEvent,
aDOMEvent, aFlags,
aEventStatus);
if (isSelectEvent) {
mHandlingSelect = PR_FALSE;

Просмотреть файл

@ -47,7 +47,7 @@
#include "nsIDOMHTMLDocument.h"
class nsHTMLTitleElement : public nsGenericHTMLContainerElement,
class nsHTMLTitleElement : public nsGenericHTMLElement,
public nsIDOMHTMLTitleElement
{
public:
@ -58,13 +58,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLTitleElement
NS_DECL_NSIDOMHTMLTITLEELEMENT
@ -111,8 +111,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTitleElement, nsGenericElement)
// QueryInterface implementation for nsHTMLTitleElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTitleElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTitleElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTitleElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLTitleElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -137,7 +136,7 @@ nsHTMLTitleElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -48,7 +48,7 @@
extern nsHTMLValue::EnumTable kListTypeTable[];
extern nsHTMLValue::EnumTable kOldListTypeTable[];
class nsHTMLUListElement : public nsGenericHTMLContainerElement,
class nsHTMLUListElement : public nsGenericHTMLElement,
public nsIDOMHTMLUListElement
{
public:
@ -59,13 +59,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLUListElement
NS_DECL_NSIDOMHTMLULISTELEMENT
@ -121,8 +121,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLUListElement, nsGenericElement)
// QueryInterface implementation for nsHTMLUListElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLUListElement,
nsGenericHTMLContainerElement)
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLUListElement, nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLUListElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLUListElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -147,7 +146,7 @@ nsHTMLUListElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);
@ -209,8 +208,7 @@ nsHTMLUListElement::AttributeToString(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
return nsGenericHTMLContainerElement::AttributeToString(aAttribute, aValue,
aResult);
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
}
static void

Просмотреть файл

@ -49,7 +49,7 @@
#include "nsIHTMLStyleSheet.h"
#include "nsIDOMMutationEvent.h"
class nsHTMLUnknownElement : public nsGenericHTMLContainerElement,
class nsHTMLUnknownElement : public nsGenericHTMLElement,
public nsIDOMHTMLElement
{
public:
@ -60,13 +60,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericHTMLElement::)
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLContainerElement::)
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
};
nsresult
@ -111,7 +111,7 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLUnknownElement, nsGenericElement)
// QueryInterface implementation for nsHTMLUnknownElement
NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLUnknownElement,
nsGenericHTMLContainerElement)
nsGenericHTMLElement)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLUnknownElement)
NS_HTML_CONTENT_INTERFACE_MAP_END
@ -135,7 +135,7 @@ nsHTMLUnknownElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
if (NS_FAILED(rv))
return rv;
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
*aReturn = NS_STATIC_CAST(nsIDOMNode *, it);

Просмотреть файл

@ -64,13 +64,6 @@ nsSVGElement::nsSVGElement()
nsSVGElement::~nsSVGElement()
{
PRInt32 count = mChildren.Count();
PRInt32 index;
for (index = 0; index < count; index++) {
mChildren[index]->SetParent(nsnull);
}
if (mAttributes)
NS_RELEASE(mAttributes);
}
@ -138,19 +131,19 @@ nsSVGElement::CanContainChildren() const
PRUint32
nsSVGElement::GetChildCount() const
{
return mChildren.Count();
return mAttrsAndChildren.ChildCount();
}
nsIContent *
nsSVGElement::GetChildAt(PRUint32 aIndex) const
{
return mChildren.SafeObjectAt(aIndex);
return mAttrsAndChildren.GetSafeChildAt(aIndex);
}
PRInt32
nsSVGElement::IndexOf(nsIContent* aPossibleChild) const
{
return mChildren.IndexOf(aPossibleChild);
return mAttrsAndChildren.IndexOfChild(aPossibleChild);
}
nsIAtom *
@ -379,62 +372,25 @@ nsSVGElement::GetNodeType(PRUint16* aNodeType)
NS_IMETHODIMP
nsSVGElement::GetParentNode(nsIDOMNode** aParentNode)
{
if (GetParent()) {
return CallQueryInterface(GetParent(), aParentNode);
}
if (mDocument) {
// we're the root content
return CallQueryInterface(mDocument, aParentNode);
}
// A standalone element (i.e. one without a parent or a document)
*aParentNode = nsnull;
return NS_OK;
return nsGenericElement::GetParentNode(aParentNode);
}
NS_IMETHODIMP
nsSVGElement::GetChildNodes(nsIDOMNodeList** aChildNodes)
{
nsDOMSlots *slots = GetDOMSlots();
if (!slots->mChildNodes) {
slots->mChildNodes = new nsChildContentList(this);
if (!slots->mChildNodes) {
return NS_ERROR_OUT_OF_MEMORY;
}
}
NS_ADDREF(*aChildNodes = slots->mChildNodes);
return NS_OK;
return nsGenericElement::GetChildNodes(aChildNodes);
}
NS_IMETHODIMP
nsSVGElement::GetFirstChild(nsIDOMNode** aNode)
{
nsIContent *child = mChildren.SafeObjectAt(0);
if (child) {
nsresult res = CallQueryInterface(child, aNode);
NS_ASSERTION(NS_SUCCEEDED(res), "Must be a DOM Node"); // must be a DOM Node
return res;
}
*aNode = nsnull;
return NS_OK;
return nsGenericElement::GetFirstChild(aNode);
}
NS_IMETHODIMP
nsSVGElement::GetLastChild(nsIDOMNode** aNode)
{
PRInt32 count = mChildren.Count();
if (count) {
nsresult res = CallQueryInterface(mChildren[count - 1], aNode);
NS_ASSERTION(NS_SUCCEEDED(res), "Must be a DOM Node"); // must be a DOM Node
return res;
}
*aNode = nsnull;
return NS_OK;
return nsGenericElement::GetLastChild(aNode);
}
NS_IMETHODIMP
@ -514,7 +470,7 @@ nsSVGElement::AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn)
NS_IMETHODIMP
nsSVGElement::HasChildNodes(PRBool* aReturn)
{
if (0 != mChildren.Count()) {
if (0 != mAttrsAndChildren.ChildCount()) {
*aReturn = PR_TRUE;
}
else {
@ -679,13 +635,9 @@ nsSVGElement::CopyNode(nsSVGElement* dest, PRBool deep)
if (deep) {
// copy children:
PRInt32 count = mChildren.Count();
PRInt32 count = mAttrsAndChildren.ChildCount();
for (PRInt32 i = 0; i < count; ++i) {
nsIContent* child = mChildren[i];
NS_ASSERTION(child != nsnull, "null ptr");
if (!child)
return NS_ERROR_UNEXPECTED;
nsIContent* child = mAttrsAndChildren.ChildAt(i);
nsCOMPtr<nsIDOMNode> domchild = do_QueryInterface(child);
NS_ASSERTION(domchild != nsnull, "child is not a DOM node");

Просмотреть файл

@ -99,20 +99,6 @@ public:
virtual void DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const;
#endif // DEBUG
// Child list modification hooks
virtual PRBool InternalInsertChildAt(nsIContent* aKid, PRUint32 aIndex) {
return mChildren.InsertObjectAt(aKid, aIndex);
}
virtual PRBool InternalReplaceChildAt(nsIContent* aKid, PRUint32 aIndex) {
return mChildren.ReplaceObjectAt(aKid, aIndex);
}
virtual PRBool InternalAppendChildTo(nsIContent* aKid) {
return mChildren.AppendObject(aKid);
}
virtual PRBool InternalRemoveChildAt(PRUint32 aIndex) {
return mChildren.RemoveObjectAt(aIndex);
}
virtual const nsAttrName* InternalGetExistingAttrNameFromQName(const nsAString& aStr) const;
virtual nsresult SetBindingParent(nsIContent* aParent);
@ -152,7 +138,6 @@ protected:
nsresult CopyNode(nsSVGElement* dest, PRBool deep);
virtual void ParentChainChanged(){};
nsCOMArray<nsIContent> mChildren;
nsSVGAttributes* mAttributes;
nsCOMPtr<nsISVGStyleValue> mStyle;
};

Просмотреть файл

@ -507,7 +507,7 @@ nsXMLElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
return rv;
}
CopyInnerTo(this, it, aDeep);
CopyInnerTo(it, aDeep);
rv = CallQueryInterface(it, aReturn);
NS_RELEASE(it);