зеркало из https://github.com/mozilla/pjs.git
added namespace support
This commit is contained in:
Родитель
e465591426
Коммит
72d324bf2f
|
@ -48,6 +48,7 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
|
||||
#include "nsIHTMLContentContainer.h"
|
||||
#include "nsHTMLParts.h"
|
||||
|
@ -378,6 +379,14 @@ nsGenericHTMLElement::SetDocument(nsIDocument* aDocument, PRBool aDeep)
|
|||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::GetNameSpaceID(PRInt32& aID) const
|
||||
{
|
||||
aID = kNameSpaceID_HTML;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//void
|
||||
//nsHTMLTagContent::SizeOfWithoutThis(nsISizeOfHandler* aHandler) const
|
||||
//{
|
||||
|
@ -481,6 +490,15 @@ nsGenericHTMLElement::SetAttribute(nsIAtom* aAttribute,
|
|||
AddScriptEventListener(aAttribute, aValue, kIDOMFormListenerIID);
|
||||
else if (nsHTMLAtoms::onpaint == aAttribute)
|
||||
AddScriptEventListener(aAttribute, aValue, kIDOMPaintListenerIID);
|
||||
// check for class and upper case it
|
||||
else if (nsHTMLAtoms::kClass == aAttribute) {
|
||||
nsAutoString buffer;
|
||||
aValue.ToUpperCase(buffer);
|
||||
nsIAtom* classAtom = NS_NewAtom(buffer);
|
||||
result = SetClass(classAtom);
|
||||
NS_RELEASE(classAtom);
|
||||
return result;
|
||||
}
|
||||
|
||||
nsHTMLValue val;
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
nsresult GetStyle(nsIDOMCSSStyleDeclaration** aStyle);
|
||||
|
||||
// Implementation for nsIContent
|
||||
nsresult GetNameSpaceID(PRInt32& aNameSpaceID) const;
|
||||
nsresult SetDocument(nsIDocument* aDocument, PRBool aDeep);
|
||||
nsresult SetAttribute(const nsString& aName, const nsString& aValue,
|
||||
PRBool aNotify);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "nsTextFragment.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
|
||||
extern const nsIID kIDOMCharacterDataIID;
|
||||
extern const nsIID kIDOMNodeIID;
|
||||
|
@ -128,6 +129,10 @@ struct nsGenericDOMDataNode {
|
|||
aResult = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult GetNameSpaceID(PRInt32& aID) const {
|
||||
aID = kNameSpaceID_None;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult GetTag(nsIAtom*& aResult) const {
|
||||
aResult = nsnull;
|
||||
return NS_OK;
|
||||
|
@ -425,6 +430,9 @@ struct nsGenericDOMDataNode {
|
|||
NS_IMETHOD IsSynthetic(PRBool& aResult) { \
|
||||
return _g.IsSynthetic(aResult); \
|
||||
} \
|
||||
NS_IMETHOD GetNameSpaceID(PRInt32& aID) const { \
|
||||
return _g.GetNameSpaceID(aID); \
|
||||
} \
|
||||
NS_IMETHOD GetTag(nsIAtom*& aResult) const { \
|
||||
return _g.GetTag(aResult); \
|
||||
} \
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
|
||||
#include "nsIHTMLContentContainer.h"
|
||||
#include "nsHTMLParts.h"
|
||||
|
@ -378,6 +379,14 @@ nsGenericHTMLElement::SetDocument(nsIDocument* aDocument, PRBool aDeep)
|
|||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::GetNameSpaceID(PRInt32& aID) const
|
||||
{
|
||||
aID = kNameSpaceID_HTML;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//void
|
||||
//nsHTMLTagContent::SizeOfWithoutThis(nsISizeOfHandler* aHandler) const
|
||||
//{
|
||||
|
@ -481,6 +490,15 @@ nsGenericHTMLElement::SetAttribute(nsIAtom* aAttribute,
|
|||
AddScriptEventListener(aAttribute, aValue, kIDOMFormListenerIID);
|
||||
else if (nsHTMLAtoms::onpaint == aAttribute)
|
||||
AddScriptEventListener(aAttribute, aValue, kIDOMPaintListenerIID);
|
||||
// check for class and upper case it
|
||||
else if (nsHTMLAtoms::kClass == aAttribute) {
|
||||
nsAutoString buffer;
|
||||
aValue.ToUpperCase(buffer);
|
||||
nsIAtom* classAtom = NS_NewAtom(buffer);
|
||||
result = SetClass(classAtom);
|
||||
NS_RELEASE(classAtom);
|
||||
return result;
|
||||
}
|
||||
|
||||
nsHTMLValue val;
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
nsresult GetStyle(nsIDOMCSSStyleDeclaration** aStyle);
|
||||
|
||||
// Implementation for nsIContent
|
||||
nsresult GetNameSpaceID(PRInt32& aNameSpaceID) const;
|
||||
nsresult SetDocument(nsIDocument* aDocument, PRBool aDeep);
|
||||
nsresult SetAttribute(const nsString& aName, const nsString& aValue,
|
||||
PRBool aNotify);
|
||||
|
|
Загрузка…
Ссылка в новой задаче