Spanked
git-svn-id: svn://10.0.0.236/trunk@9173 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -23,101 +23,103 @@ REQUIRES=xpcom raptor js
|
||||
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
CPPSRCS= \
|
||||
nsHTMLAnchor.cpp \
|
||||
nsHTMLApplet.cpp \
|
||||
nsHTMLArea.cpp \
|
||||
nsHTMLBR.cpp \
|
||||
nsHTMLBase.cpp \
|
||||
nsHTMLBaseFont.cpp \
|
||||
nsHTMLBody.cpp \
|
||||
nsHTMLComment.cpp \
|
||||
nsHTMLDList.cpp \
|
||||
nsHTMLDel.cpp \
|
||||
nsHTMLDirectory.cpp \
|
||||
nsHTMLDiv.cpp \
|
||||
nsHTMLEmbed.cpp \
|
||||
nsHTMLFont.cpp \
|
||||
nsHTMLGenericContent.cpp \
|
||||
nsHTMLHR.cpp \
|
||||
nsHTMLHead.cpp \
|
||||
nsHTMLHeading.cpp \
|
||||
nsHTMLHtml.cpp \
|
||||
nsHTMLInput.cpp \
|
||||
nsHTMLIns.cpp \
|
||||
nsHTMLLI.cpp \
|
||||
nsHTMLLayer.cpp \
|
||||
nsHTMLLink.cpp \
|
||||
nsHTMLMap.cpp \
|
||||
nsHTMLMenu.cpp \
|
||||
nsHTMLMeta.cpp \
|
||||
nsHTMLMod.cpp \
|
||||
nsHTMLOList.cpp \
|
||||
nsHTMLObject.cpp \
|
||||
nsHTMLOption.cpp \
|
||||
nsHTMLParagraph.cpp \
|
||||
nsHTMLParam.cpp \
|
||||
nsHTMLPre.cpp \
|
||||
nsHTMLQuote.cpp \
|
||||
nsHTMLScript.cpp \
|
||||
nsHTMLStyle.cpp \
|
||||
nsHTMLTable.cpp \
|
||||
nsHTMLTableCaption.cpp \
|
||||
nsHTMLTableCell.cpp \
|
||||
nsHTMLTableCol.cpp \
|
||||
nsHTMLTableRow.cpp \
|
||||
nsHTMLTableSection.cpp \
|
||||
nsHTMLTitle.cpp \
|
||||
nsHTMLUList.cpp \
|
||||
nsObjectContent.cpp \
|
||||
nsCommentNode.cpp \
|
||||
nsGenericHTMLElement.cpp \
|
||||
nsHTMLAnchorElement.cpp \
|
||||
nsHTMLAppletElement.cpp \
|
||||
nsHTMLAreaElement.cpp \
|
||||
nsHTMLBRElement.cpp \
|
||||
nsHTMLBaseElement.cpp \
|
||||
nsHTMLBaseFontElement.cpp \
|
||||
nsHTMLBodyElement.cpp \
|
||||
nsHTMLDListElement.cpp \
|
||||
nsHTMLDelElement.cpp \
|
||||
nsHTMLDirectoryElement.cpp \
|
||||
nsHTMLDivElement.cpp \
|
||||
nsHTMLEmbedElement.cpp \
|
||||
nsHTMLFontElement.cpp \
|
||||
nsHTMLFormElement.cpp \
|
||||
nsHTMLHRElement.cpp \
|
||||
nsHTMLHeadElement.cpp \
|
||||
nsHTMLHeadingElement.cpp \
|
||||
nsHTMLHtmlElement.cpp \
|
||||
nsHTMLInputElement.cpp \
|
||||
nsHTMLInsElement.cpp \
|
||||
nsHTMLLIElement.cpp \
|
||||
nsHTMLLayerElement.cpp \
|
||||
nsHTMLLinkElement.cpp \
|
||||
nsHTMLMapElement.cpp \
|
||||
nsHTMLMenuElement.cpp \
|
||||
nsHTMLMetaElement.cpp \
|
||||
nsHTMLModElement.cpp \
|
||||
nsHTMLOListElement.cpp \
|
||||
nsHTMLObjectElement.cpp \
|
||||
nsHTMLOptionElement.cpp \
|
||||
nsHTMLParagraphElement.cpp \
|
||||
nsHTMLParamElement.cpp \
|
||||
nsHTMLPreElement.cpp \
|
||||
nsHTMLQuoteElement.cpp \
|
||||
nsHTMLScriptElement.cpp \
|
||||
nsHTMLSelectElement.cpp \
|
||||
nsHTMLStyleElement.cpp \
|
||||
nsHTMLTableElement.cpp \
|
||||
nsHTMLTableCaptionElement.cpp \
|
||||
nsHTMLTableCellElement.cpp \
|
||||
nsHTMLTableColElement.cpp \
|
||||
nsHTMLTableRowElement.cpp \
|
||||
nsHTMLTableSectionElement.cpp \
|
||||
nsHTMLTitleElement.cpp \
|
||||
nsHTMLUListElement.cpp \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsHTMLAnchor.obj \
|
||||
.\$(OBJDIR)\nsHTMLApplet.obj \
|
||||
.\$(OBJDIR)\nsHTMLArea.obj \
|
||||
.\$(OBJDIR)\nsHTMLBR.obj \
|
||||
.\$(OBJDIR)\nsHTMLBase.obj \
|
||||
.\$(OBJDIR)\nsHTMLBaseFont.obj \
|
||||
.\$(OBJDIR)\nsHTMLBody.obj \
|
||||
.\$(OBJDIR)\nsHTMLComment.obj \
|
||||
.\$(OBJDIR)\nsHTMLDList.obj \
|
||||
.\$(OBJDIR)\nsHTMLDel.obj \
|
||||
.\$(OBJDIR)\nsHTMLDirectory.obj \
|
||||
.\$(OBJDIR)\nsHTMLDiv.obj \
|
||||
.\$(OBJDIR)\nsHTMLEmbed.obj \
|
||||
.\$(OBJDIR)\nsHTMLFont.obj \
|
||||
.\$(OBJDIR)\nsHTMLGenericContent.obj \
|
||||
.\$(OBJDIR)\nsHTMLHR.obj \
|
||||
.\$(OBJDIR)\nsHTMLHead.obj \
|
||||
.\$(OBJDIR)\nsHTMLHeading.obj \
|
||||
.\$(OBJDIR)\nsHTMLHtml.obj \
|
||||
.\$(OBJDIR)\nsHTMLInput.obj \
|
||||
.\$(OBJDIR)\nsHTMLIns.obj \
|
||||
.\$(OBJDIR)\nsHTMLLI.obj \
|
||||
.\$(OBJDIR)\nsHTMLLayer.obj \
|
||||
.\$(OBJDIR)\nsHTMLLink.obj \
|
||||
.\$(OBJDIR)\nsHTMLMap.obj \
|
||||
.\$(OBJDIR)\nsHTMLMenu.obj \
|
||||
.\$(OBJDIR)\nsHTMLMeta.obj \
|
||||
.\$(OBJDIR)\nsHTMLMod.obj \
|
||||
.\$(OBJDIR)\nsHTMLOList.obj \
|
||||
.\$(OBJDIR)\nsHTMLObject.obj \
|
||||
.\$(OBJDIR)\nsHTMLOption.obj \
|
||||
.\$(OBJDIR)\nsHTMLParagraph.obj \
|
||||
.\$(OBJDIR)\nsHTMLParam.obj \
|
||||
.\$(OBJDIR)\nsHTMLPre.obj \
|
||||
.\$(OBJDIR)\nsHTMLQuote.obj \
|
||||
.\$(OBJDIR)\nsHTMLScript.obj \
|
||||
.\$(OBJDIR)\nsHTMLStyle.obj \
|
||||
.\$(OBJDIR)\nsHTMLTable.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCaption.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCell.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCol.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableRow.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableSection.obj \
|
||||
.\$(OBJDIR)\nsHTMLTitle.obj \
|
||||
.\$(OBJDIR)\nsHTMLUList.obj \
|
||||
.\$(OBJDIR)\nsObjectContent.obj \
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsCommentNode.obj \
|
||||
.\$(OBJDIR)\nsGenericHTMLElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLAnchorElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLAppletElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLAreaElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLBRElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLBaseElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLBaseFontElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLBodyElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLDListElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLDelElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLDirectoryElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLDivElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLEmbedElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLFontElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLFormElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLHRElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLHeadElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLHeadingElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLHtmlElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLInputElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLInsElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLLIElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLLayerElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLLinkElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLMapElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLMenuElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLMetaElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLModElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLOListElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLObjectElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLOptionElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLParagraphElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLParamElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLPreElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLQuoteElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLScriptElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLSelectElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLStyleElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCaptionElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCellElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableColElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableRowElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableSectionElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTitleElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLUListElement.obj \
|
||||
$(NULL)
|
||||
|
||||
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
||||
#include "nsIAtom.h"
|
||||
#include "nsIContentDelegate.h"
|
||||
@@ -1576,9 +1576,15 @@ nsHTMLGenericContent::CreateFrame(nsIPresContext* aPresContext,
|
||||
else if (mTag == nsHTMLAtoms::br) {
|
||||
rv = NS_NewBRFrame(mContent, aParentFrame, frame);
|
||||
}
|
||||
else if (mTag == nsHTMLAtoms::embed) {
|
||||
rv = NS_NewObjectFrame(mContent, aParentFrame, frame);
|
||||
}
|
||||
else if (mTag == nsHTMLAtoms::hr) {
|
||||
rv = NS_NewHRFrame(mContent, aParentFrame, frame);
|
||||
}
|
||||
else if (mTag == nsHTMLAtoms::object) {
|
||||
rv = NS_NewObjectFrame(mContent, aParentFrame, frame);
|
||||
}
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -32,14 +32,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLAnchorElementIID, NS_IDOMHTMLANCHORELEMENT_IID);
|
||||
|
||||
class nsHTMLAnchor : public nsIDOMHTMLAnchorElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
class nsHTMLAnchorElement : public nsIDOMHTMLAnchorElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLAnchor(nsIAtom* aTag);
|
||||
~nsHTMLAnchor();
|
||||
nsHTMLAnchorElement(nsIAtom* aTag);
|
||||
~nsHTMLAnchorElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -98,35 +98,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLAnchor(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLAnchorElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLAnchor(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLAnchorElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLAnchor::nsHTMLAnchor(nsIAtom* aTag)
|
||||
nsHTMLAnchorElement::nsHTMLAnchorElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLAnchor::~nsHTMLAnchor()
|
||||
nsHTMLAnchorElement::~nsHTMLAnchorElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLAnchor)
|
||||
NS_IMPL_ADDREF(nsHTMLAnchorElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLAnchor)
|
||||
NS_IMPL_RELEASE(nsHTMLAnchorElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLAnchor::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLAnchorElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLAnchorElementIID)) {
|
||||
@@ -139,9 +139,9 @@ nsHTMLAnchor::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLAnchor::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLAnchorElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLAnchor* it = new nsHTMLAnchor(mInner.mTag);
|
||||
nsHTMLAnchorElement* it = new nsHTMLAnchorElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -149,37 +149,37 @@ nsHTMLAnchor::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, AccessKey, accesskey, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Charset, charset, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Coords, coords, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Href, href, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Hreflang, hreflang, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Rel, rel, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Rev, rev, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Shape, shape, eSetAttrNotify_None)
|
||||
NS_IMPL_INT_ATTR(nsHTMLAnchor, TabIndex, tabindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Target, target, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchor, Type, type, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, AccessKey, accesskey, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Charset, charset, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Coords, coords, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Href, href, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Hreflang, hreflang, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Rel, rel, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Rev, rev, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Shape, shape, eSetAttrNotify_None)
|
||||
NS_IMPL_INT_ATTR(nsHTMLAnchorElement, TabIndex, tabindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Target, target, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Type, type, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchor::Blur()
|
||||
nsHTMLAnchorElement::Blur()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchor::Focus()
|
||||
nsHTMLAnchorElement::Focus()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchor::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
nsHTMLAnchorElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::tabindex) {
|
||||
nsHTMLGenericContent::ParseValue(aValue, 0, 32767, aResult,
|
||||
@@ -190,26 +190,26 @@ nsHTMLAnchor::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchor::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
nsHTMLAnchorElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchor::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
nsHTMLAnchorElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchor::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
nsHTMLAnchorElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
// Try script event handlers first
|
||||
nsresult ret = mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLAppletElementIID, NS_IDOMHTMLAPPLETELEMENT_IID);
|
||||
|
||||
class nsHTMLApplet : public nsIDOMHTMLAppletElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
class nsHTMLAppletElement : public nsIDOMHTMLAppletElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLApplet(nsIAtom* aTag);
|
||||
~nsHTMLApplet();
|
||||
nsHTMLAppletElement(nsIAtom* aTag);
|
||||
~nsHTMLAppletElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -91,35 +91,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLApplet(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLAppletElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLApplet(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLAppletElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLApplet::nsHTMLApplet(nsIAtom* aTag)
|
||||
nsHTMLAppletElement::nsHTMLAppletElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLApplet::~nsHTMLApplet()
|
||||
nsHTMLAppletElement::~nsHTMLAppletElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLApplet)
|
||||
NS_IMPL_ADDREF(nsHTMLAppletElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLApplet)
|
||||
NS_IMPL_RELEASE(nsHTMLAppletElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLApplet::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLAppletElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLAppletElementIID)) {
|
||||
@@ -132,9 +132,9 @@ nsHTMLApplet::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLApplet::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLAppletElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLApplet* it = new nsHTMLApplet(mInner.mTag);
|
||||
nsHTMLAppletElement* it = new nsHTMLAppletElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -142,22 +142,22 @@ nsHTMLApplet::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Alt, alt, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Archive, archive, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Code, code, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, CodeBase, codebase, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Height, height, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Hspace, hspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Object, object, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Vspace, vspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLApplet, Width, width, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Alt, alt, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Archive, archive, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Code, code, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, CodeBase, codebase, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Height, height, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Hspace, hspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Object, object, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Vspace, vspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLApplet::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
nsHTMLAppletElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
@@ -172,9 +172,9 @@ nsHTMLApplet::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLApplet::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
nsHTMLAppletElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
@@ -190,8 +190,8 @@ nsHTMLApplet::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLApplet::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
nsHTMLAppletElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
mInner.MapImageAlignAttributeInto(aContext, aPresContext);
|
||||
mInner.MapImageAttributesInto(aContext, aPresContext);
|
||||
@@ -200,11 +200,11 @@ nsHTMLApplet::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLApplet::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
nsHTMLAppletElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLAreaElementIID, NS_IDOMHTMLAREAELEMENT_IID);
|
||||
|
||||
class nsHTMLArea : public nsIDOMHTMLAreaElement,
|
||||
class nsHTMLAreaElement : public nsIDOMHTMLAreaElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLArea(nsIAtom* aTag);
|
||||
~nsHTMLArea();
|
||||
nsHTMLAreaElement(nsIAtom* aTag);
|
||||
~nsHTMLAreaElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -85,35 +85,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLArea(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLAreaElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLArea(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLAreaElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLArea::nsHTMLArea(nsIAtom* aTag)
|
||||
nsHTMLAreaElement::nsHTMLAreaElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLArea::~nsHTMLArea()
|
||||
nsHTMLAreaElement::~nsHTMLAreaElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLArea)
|
||||
NS_IMPL_ADDREF(nsHTMLAreaElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLArea)
|
||||
NS_IMPL_RELEASE(nsHTMLAreaElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLArea::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLAreaElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLAreaElementIID)) {
|
||||
@@ -126,9 +126,9 @@ nsHTMLArea::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLArea::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLAreaElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLArea* it = new nsHTMLArea(mInner.mTag);
|
||||
nsHTMLAreaElement* it = new nsHTMLAreaElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -136,44 +136,44 @@ nsHTMLArea::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLArea, AccessKey, accesskey, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLArea, Alt, alt, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLArea, Coords, coords, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLArea, Href, href, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLArea, NoHref, nohref, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLArea, Shape, shape, eSetAttrNotify_None)
|
||||
NS_IMPL_INT_ATTR(nsHTMLArea, TabIndex, tabindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLArea, Target, target, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, AccessKey, accesskey, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Alt, alt, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Coords, coords, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Href, href, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLAreaElement, NoHref, nohref, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Shape, shape, eSetAttrNotify_None)
|
||||
NS_IMPL_INT_ATTR(nsHTMLAreaElement, TabIndex, tabindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Target, target, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLArea::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
nsHTMLAreaElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLArea::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
nsHTMLAreaElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLArea::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
nsHTMLAreaElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLArea::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
nsHTMLAreaElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBRElementIID, NS_IDOMHTMLBRELEMENT_IID);
|
||||
|
||||
class nsHTMLBR : public nsIDOMHTMLBRElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
class nsHTMLBRElement : public nsIDOMHTMLBRElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLBR(nsIAtom* aTag);
|
||||
~nsHTMLBR();
|
||||
nsHTMLBRElement(nsIAtom* aTag);
|
||||
~nsHTMLBRElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -71,35 +71,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLBR(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLBRElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLBR(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLBRElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLBR::nsHTMLBR(nsIAtom* aTag)
|
||||
nsHTMLBRElement::nsHTMLBRElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLBR::~nsHTMLBR()
|
||||
nsHTMLBRElement::~nsHTMLBRElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLBR)
|
||||
NS_IMPL_ADDREF(nsHTMLBRElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLBR)
|
||||
NS_IMPL_RELEASE(nsHTMLBRElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLBR::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLBRElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBRElementIID)) {
|
||||
@@ -112,9 +112,9 @@ nsHTMLBR::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLBR::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLBRElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLBR* it = new nsHTMLBR(mInner.mTag);
|
||||
nsHTMLBRElement* it = new nsHTMLBRElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ nsHTMLBR::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBR, Clear, clear, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBRElement, Clear, clear, eSetAttrNotify_Reflow)
|
||||
|
||||
static nsHTMLGenericContent::EnumTable kClearTable[] = {
|
||||
{ "left", NS_STYLE_CLEAR_LEFT },
|
||||
@@ -133,9 +133,9 @@ static nsHTMLGenericContent::EnumTable kClearTable[] = {
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBR::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
nsHTMLBRElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::clear) {
|
||||
if (nsHTMLGenericContent::ParseEnumValue(aValue, kClearTable, aResult)) {
|
||||
@@ -146,9 +146,9 @@ nsHTMLBR::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBR::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
nsHTMLBRElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::clear) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
@@ -160,8 +160,8 @@ nsHTMLBR::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBR::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
nsHTMLBRElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
if (nsnull != mInner.mAttributes) {
|
||||
nsStyleDisplay* display = (nsStyleDisplay*)
|
||||
@@ -176,11 +176,11 @@ nsHTMLBR::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBR::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
nsHTMLBRElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
162
mozilla/content/html/content/src/nsHTMLBaseElement.cpp
Normal file
162
mozilla/content/html/content/src/nsHTMLBaseElement.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLBaseElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBaseElementIID, NS_IDOMHTMLBASEELEMENT_IID);
|
||||
|
||||
class nsHTMLBaseElement : public nsIDOMHTMLBaseElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLBaseElement(nsIAtom* aTag);
|
||||
~nsHTMLBaseElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLBaseElement
|
||||
NS_IMETHOD GetHref(nsString& aHref);
|
||||
NS_IMETHOD SetHref(const nsString& aHref);
|
||||
NS_IMETHOD GetTarget(nsString& aTarget);
|
||||
NS_IMETHOD SetTarget(const nsString& aTarget);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLBaseElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLBaseElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLBaseElement::nsHTMLBaseElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLBaseElement::~nsHTMLBaseElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLBaseElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLBaseElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLBaseElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBaseElementIID)) {
|
||||
nsIDOMHTMLBaseElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLBaseElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLBaseElement* it = new nsHTMLBaseElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseElement, Href, href, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseElement, Target, target, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBaseFontElementIID, NS_IDOMHTMLBASEFONTELEMENT_IID);
|
||||
|
||||
class nsHTMLBaseFont : public nsIDOMHTMLBaseFontElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
class nsHTMLBaseFontElement : public nsIDOMHTMLBaseFontElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLBaseFont(nsIAtom* aTag);
|
||||
~nsHTMLBaseFont();
|
||||
nsHTMLBaseFontElement(nsIAtom* aTag);
|
||||
~nsHTMLBaseFontElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -75,35 +75,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLBaseFont(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLBaseFontElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLBaseFont(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLBaseFontElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLBaseFont::nsHTMLBaseFont(nsIAtom* aTag)
|
||||
nsHTMLBaseFontElement::nsHTMLBaseFontElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLBaseFont::~nsHTMLBaseFont()
|
||||
nsHTMLBaseFontElement::~nsHTMLBaseFontElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLBaseFont)
|
||||
NS_IMPL_ADDREF(nsHTMLBaseFontElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLBaseFont)
|
||||
NS_IMPL_RELEASE(nsHTMLBaseFontElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLBaseFont::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLBaseFontElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBaseFontElementIID)) {
|
||||
@@ -116,9 +116,9 @@ nsHTMLBaseFont::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLBaseFont::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLBaseFontElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLBaseFont* it = new nsHTMLBaseFont(mInner.mTag);
|
||||
nsHTMLBaseFontElement* it = new nsHTMLBaseFontElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -126,42 +126,42 @@ nsHTMLBaseFont::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFont, Color, color, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFont, Face, face, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFont, Size, size, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFontElement, Color, color, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFontElement, Face, face, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFontElement, Size, size, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseFont::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
nsHTMLBaseFontElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseFont::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
nsHTMLBaseFontElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseFont::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
nsHTMLBaseFontElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me?
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseFont::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
nsHTMLBaseFontElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBodyElementIID, NS_IDOMHTMLBODYELEMENT_IID);
|
||||
|
||||
class nsHTMLBody : public nsIDOMHTMLBodyElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
class nsHTMLBodyElement : public nsIDOMHTMLBodyElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLBody(nsIAtom* aTag);
|
||||
~nsHTMLBody();
|
||||
nsHTMLBodyElement(nsIAtom* aTag);
|
||||
~nsHTMLBodyElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -81,35 +81,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLBody(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLBodyElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLBody(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLBodyElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLBody::nsHTMLBody(nsIAtom* aTag)
|
||||
nsHTMLBodyElement::nsHTMLBodyElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLBody::~nsHTMLBody()
|
||||
nsHTMLBodyElement::~nsHTMLBodyElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLBody)
|
||||
NS_IMPL_ADDREF(nsHTMLBodyElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLBody)
|
||||
NS_IMPL_RELEASE(nsHTMLBodyElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLBody::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLBodyElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBodyElementIID)) {
|
||||
@@ -122,9 +122,9 @@ nsHTMLBody::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLBody::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLBodyElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLBody* it = new nsHTMLBody(mInner.mTag);
|
||||
nsHTMLBodyElement* it = new nsHTMLBodyElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -132,45 +132,45 @@ nsHTMLBody::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBody, ALink, alink, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBody, Background, background, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBody, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBody, Link, link, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBody, Text, text, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBody, VLink, vlink, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, ALink, alink, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, Background, background, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, Link, link, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, Text, text, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, VLink, vlink, eSetAttrNotify_Render)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBody::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
nsHTMLBodyElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBody::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
nsHTMLBodyElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBody::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
nsHTMLBodyElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBody::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
nsHTMLBodyElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
162
mozilla/content/html/content/src/nsHTMLDListElement.cpp
Normal file
162
mozilla/content/html/content/src/nsHTMLDListElement.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLDListElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDListElementIID, NS_IDOMHTMLDLISTELEMENT_IID);
|
||||
|
||||
class nsHTMLDListElement : public nsIDOMHTMLDListElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLDListElement(nsIAtom* aTag);
|
||||
~nsHTMLDListElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLDListElement
|
||||
NS_IMETHOD GetCompact(PRBool* aCompact);
|
||||
NS_IMETHOD SetCompact(PRBool aCompact);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLDListElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLDListElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLDListElement::nsHTMLDListElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLDListElement::~nsHTMLDListElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLDListElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLDListElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLDListElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDListElementIID)) {
|
||||
nsIDOMHTMLDListElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDListElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLDListElement* it = new nsHTMLDListElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLDListElement, Compact, compact, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDListElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDListElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDListElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDListElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDelElementIID, NS_IDOMHTMLDELELEMENT_IID);
|
||||
|
||||
class nsHTMLDel : public nsIDOMHTMLDelElement,
|
||||
class nsHTMLDelElement : public nsIDOMHTMLDelElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLDel(nsIAtom* aTag);
|
||||
~nsHTMLDel();
|
||||
nsHTMLDelElement(nsIAtom* aTag);
|
||||
~nsHTMLDelElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -73,35 +73,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLDel(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLDelElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLDel(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLDelElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLDel::nsHTMLDel(nsIAtom* aTag)
|
||||
nsHTMLDelElement::nsHTMLDelElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLDel::~nsHTMLDel()
|
||||
nsHTMLDelElement::~nsHTMLDelElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLDel)
|
||||
NS_IMPL_ADDREF(nsHTMLDelElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLDel)
|
||||
NS_IMPL_RELEASE(nsHTMLDelElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLDel::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLDelElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDelElementIID)) {
|
||||
@@ -114,9 +114,9 @@ nsHTMLDel::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDel::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLDelElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLDel* it = new nsHTMLDel(mInner.mTag);
|
||||
nsHTMLDelElement* it = new nsHTMLDelElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -124,11 +124,11 @@ nsHTMLDel::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDel, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDel, DateTime, datetime, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDelElement, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDelElement, DateTime, datetime, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDel::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLDelElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ nsHTMLDel::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDel::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLDelElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -146,7 +146,7 @@ nsHTMLDel::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDel::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLDelElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -154,7 +154,7 @@ nsHTMLDel::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDel::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLDelElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDirectoryElementIID, NS_IDOMHTMLDIRECTORYELEMENT_IID);
|
||||
|
||||
class nsHTMLDirectory : public nsIDOMHTMLDirectoryElement,
|
||||
class nsHTMLDirectoryElement : public nsIDOMHTMLDirectoryElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLDirectory(nsIAtom* aTag);
|
||||
~nsHTMLDirectory();
|
||||
nsHTMLDirectoryElement(nsIAtom* aTag);
|
||||
~nsHTMLDirectoryElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -71,35 +71,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLDirectory(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLDirectoryElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLDirectory(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLDirectoryElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLDirectory::nsHTMLDirectory(nsIAtom* aTag)
|
||||
nsHTMLDirectoryElement::nsHTMLDirectoryElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLDirectory::~nsHTMLDirectory()
|
||||
nsHTMLDirectoryElement::~nsHTMLDirectoryElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLDirectory)
|
||||
NS_IMPL_ADDREF(nsHTMLDirectoryElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLDirectory)
|
||||
NS_IMPL_RELEASE(nsHTMLDirectoryElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLDirectory::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLDirectoryElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDirectoryElementIID)) {
|
||||
@@ -112,9 +112,9 @@ nsHTMLDirectory::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDirectory::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLDirectoryElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLDirectory* it = new nsHTMLDirectory(mInner.mTag);
|
||||
nsHTMLDirectoryElement* it = new nsHTMLDirectoryElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ nsHTMLDirectory::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLDirectory, Compact, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLDirectoryElement, Compact, compact, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDirectory::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLDirectoryElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ nsHTMLDirectory::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDirectory::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLDirectoryElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -143,7 +143,7 @@ nsHTMLDirectory::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDirectory::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLDirectoryElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -151,7 +151,7 @@ nsHTMLDirectory::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDirectory::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLDirectoryElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -31,14 +31,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDivElementIID, NS_IDOMHTMLDIVELEMENT_IID);
|
||||
|
||||
class nsHTMLDiv : public nsIDOMHTMLDivElement,
|
||||
class nsHTMLDivElement : public nsIDOMHTMLDivElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLDiv(nsIAtom* aTag);
|
||||
~nsHTMLDiv();
|
||||
nsHTMLDivElement(nsIAtom* aTag);
|
||||
~nsHTMLDivElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -73,35 +73,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLDiv(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLDivElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLDiv(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLDivElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLDiv::nsHTMLDiv(nsIAtom* aTag)
|
||||
nsHTMLDivElement::nsHTMLDivElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLDiv::~nsHTMLDiv()
|
||||
nsHTMLDivElement::~nsHTMLDivElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLDiv)
|
||||
NS_IMPL_ADDREF(nsHTMLDivElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLDiv)
|
||||
NS_IMPL_RELEASE(nsHTMLDivElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLDiv::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLDivElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDivElementIID)) {
|
||||
@@ -114,9 +114,9 @@ nsHTMLDiv::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDiv::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLDivElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLDiv* it = new nsHTMLDiv(mInner.mTag);
|
||||
nsHTMLDivElement* it = new nsHTMLDivElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -124,10 +124,10 @@ nsHTMLDiv::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDiv, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDivElement, Align, align, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDiv::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLDivElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ nsHTMLDiv::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDiv::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLDivElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -154,7 +154,7 @@ nsHTMLDiv::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDiv::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLDivElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -162,7 +162,7 @@ nsHTMLDiv::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDiv::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLDivElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
181
mozilla/content/html/content/src/nsHTMLEmbedElement.cpp
Normal file
181
mozilla/content/html/content/src/nsHTMLEmbedElement.cpp
Normal file
@@ -0,0 +1,181 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
// XXX define nsIDOMHTMLEmbedElement; add in nav attrs
|
||||
|
||||
//static NS_DEFINE_IID(kIDOMHTMLEmbedElementIID, NS_IDOMHTMLEmbedELEMENT_IID);
|
||||
|
||||
class nsHTMLEmbedElement : public nsIDOMHTMLElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLEmbedElement(nsIAtom* aTag);
|
||||
~nsHTMLEmbedElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLEmbedElement
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLEmbedElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLEmbedElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLEmbedElement::nsHTMLEmbedElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLEmbedElement::~nsHTMLEmbedElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLEmbedElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLEmbedElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLEmbedElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
#if XXX
|
||||
if (aIID.Equals(kIDOMHTMLEmbedElementIID)) {
|
||||
nsIDOMHTMLEmbedElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLEmbedElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLEmbedElement* it = new nsHTMLEmbedElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLEmbedElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ParseImageAttribute(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLEmbedElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ImageAttributeToString(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLEmbedElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
mInner.MapImageAlignAttributeInto(aContext, aPresContext);
|
||||
mInner.MapImageAttributesInto(aContext, aPresContext);
|
||||
mInner.MapImageBorderAttributesInto(aContext, aPresContext, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLEmbedElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFontElementIID, NS_IDOMHTMLFONTELEMENT_IID);
|
||||
|
||||
class nsHTMLFont : public nsIDOMHTMLFontElement,
|
||||
class nsHTMLFontElement : public nsIDOMHTMLFontElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLFont(nsIAtom* aTag);
|
||||
~nsHTMLFont();
|
||||
nsHTMLFontElement(nsIAtom* aTag);
|
||||
~nsHTMLFontElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -75,35 +75,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFont(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLFontElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLFont(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLFontElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLFont::nsHTMLFont(nsIAtom* aTag)
|
||||
nsHTMLFontElement::nsHTMLFontElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLFont::~nsHTMLFont()
|
||||
nsHTMLFontElement::~nsHTMLFontElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLFont)
|
||||
NS_IMPL_ADDREF(nsHTMLFontElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLFont)
|
||||
NS_IMPL_RELEASE(nsHTMLFontElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLFont::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLFontElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLFontElementIID)) {
|
||||
@@ -116,9 +116,9 @@ nsHTMLFont::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLFont::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLFontElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLFont* it = new nsHTMLFont(mInner.mTag);
|
||||
nsHTMLFontElement* it = new nsHTMLFontElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -126,12 +126,12 @@ nsHTMLFont::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFont, Color, face, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFont, Face, face, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFont, Size, size, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFontElement, Color, face, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFontElement, Face, face, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFontElement, Size, size, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFont::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLFontElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ nsHTMLFont::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFont::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLFontElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -149,7 +149,7 @@ nsHTMLFont::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFont::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLFontElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -157,7 +157,7 @@ nsHTMLFont::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFont::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLFontElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
206
mozilla/content/html/content/src/nsHTMLFormElement.cpp
Normal file
206
mozilla/content/html/content/src/nsHTMLFormElement.cpp
Normal file
@@ -0,0 +1,206 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
|
||||
class nsHTMLFormElement : public nsIDOMHTMLFormElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLFormElement(nsIAtom* aTag);
|
||||
~nsHTMLFormElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLFormElement
|
||||
NS_IMETHOD GetElements(nsIDOMHTMLCollection** aElements);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD GetAcceptCharset(nsString& aAcceptCharset);
|
||||
NS_IMETHOD SetAcceptCharset(const nsString& aAcceptCharset);
|
||||
NS_IMETHOD GetAction(nsString& aAction);
|
||||
NS_IMETHOD SetAction(const nsString& aAction);
|
||||
NS_IMETHOD GetEnctype(nsString& aEnctype);
|
||||
NS_IMETHOD SetEnctype(const nsString& aEnctype);
|
||||
NS_IMETHOD GetMethod(nsString& aMethod);
|
||||
NS_IMETHOD SetMethod(const nsString& aMethod);
|
||||
NS_IMETHOD GetTarget(nsString& aTarget);
|
||||
NS_IMETHOD SetTarget(const nsString& aTarget);
|
||||
NS_IMETHOD Reset();
|
||||
NS_IMETHOD Submit();
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFormElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLFormElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLFormElement::nsHTMLFormElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLFormElement::~nsHTMLFormElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLFormElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLFormElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLFormElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLFormElementIID)) {
|
||||
nsIDOMHTMLFormElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLFormElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLFormElement* it = new nsHTMLFormElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::GetElements(nsIDOMHTMLCollection** aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::GetName(nsString& aValue)
|
||||
{
|
||||
return mInner.GetAttribute(nsHTMLAtoms::name, aValue);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, AcceptCharset, acceptcharset, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Action, action, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Enctype, enctype, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Method, method, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Target, target, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::Reset()
|
||||
{
|
||||
// XXX
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::Submit()
|
||||
{
|
||||
// XXX
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHRElementIID, NS_IDOMHTMLHRELEMENT_IID);
|
||||
|
||||
class nsHTMLHR : public nsIDOMHTMLHRElement,
|
||||
class nsHTMLHRElement : public nsIDOMHTMLHRElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLHR(nsIAtom* aTag);
|
||||
~nsHTMLHR();
|
||||
nsHTMLHRElement(nsIAtom* aTag);
|
||||
~nsHTMLHRElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -77,35 +77,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLHR(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLHRElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLHR(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLHRElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLHR::nsHTMLHR(nsIAtom* aTag)
|
||||
nsHTMLHRElement::nsHTMLHRElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLHR::~nsHTMLHR()
|
||||
nsHTMLHRElement::~nsHTMLHRElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLHR)
|
||||
NS_IMPL_ADDREF(nsHTMLHRElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLHR)
|
||||
NS_IMPL_RELEASE(nsHTMLHRElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLHR::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLHRElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHRElementIID)) {
|
||||
@@ -118,9 +118,9 @@ nsHTMLHR::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLHR::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLHRElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLHR* it = new nsHTMLHR(mInner.mTag);
|
||||
nsHTMLHRElement* it = new nsHTMLHRElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -128,10 +128,10 @@ nsHTMLHR::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHR, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLHR, NoShade, noshade, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHR, Size, size, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHR, Width, width, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHRElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLHRElement, NoShade, noshade, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHRElement, Size, size, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHRElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
static nsHTMLGenericContent::EnumTable kAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
@@ -141,7 +141,7 @@ static nsHTMLGenericContent::EnumTable kAlignTable[] = {
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHR::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLHRElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -167,7 +167,7 @@ nsHTMLHR::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHR::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLHRElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -181,7 +181,7 @@ nsHTMLHR::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHR::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLHRElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
if (nsnull != mInner.mAttributes) {
|
||||
@@ -211,7 +211,7 @@ nsHTMLHR::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHR::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLHRElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
159
mozilla/content/html/content/src/nsHTMLHeadElement.cpp
Normal file
159
mozilla/content/html/content/src/nsHTMLHeadElement.cpp
Normal file
@@ -0,0 +1,159 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLHeadElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHeadElementIID, NS_IDOMHTMLHEADELEMENT_IID);
|
||||
|
||||
class nsHTMLHeadElement : public nsIDOMHTMLHeadElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLHeadElement(nsIAtom* aTag);
|
||||
~nsHTMLHeadElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLHeadElement
|
||||
NS_IMETHOD GetProfile(nsString& aProfile);
|
||||
NS_IMETHOD SetProfile(const nsString& aProfile);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLHeadElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLHeadElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLHeadElement::nsHTMLHeadElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLHeadElement::~nsHTMLHeadElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLHeadElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLHeadElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLHeadElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHeadElementIID)) {
|
||||
nsIDOMHTMLHeadElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLHeadElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLHeadElement* it = new nsHTMLHeadElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHeadElement, Profile, profile, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHeadingElementIID, NS_IDOMHTMLHEADINGELEMENT_IID);
|
||||
|
||||
class nsHTMLHeading : public nsIDOMHTMLHeadingElement,
|
||||
class nsHTMLHeadingElement : public nsIDOMHTMLHeadingElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLHeading(nsIAtom* aTag);
|
||||
~nsHTMLHeading();
|
||||
nsHTMLHeadingElement(nsIAtom* aTag);
|
||||
~nsHTMLHeadingElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -71,35 +71,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLHeading(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLHeadingElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLHeading(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLHeadingElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLHeading::nsHTMLHeading(nsIAtom* aTag)
|
||||
nsHTMLHeadingElement::nsHTMLHeadingElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLHeading::~nsHTMLHeading()
|
||||
nsHTMLHeadingElement::~nsHTMLHeadingElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLHeading)
|
||||
NS_IMPL_ADDREF(nsHTMLHeadingElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLHeading)
|
||||
NS_IMPL_RELEASE(nsHTMLHeadingElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLHeading::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLHeadingElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHeadingElementIID)) {
|
||||
@@ -112,9 +112,9 @@ nsHTMLHeading::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLHeading::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLHeadingElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLHeading* it = new nsHTMLHeading(mInner.mTag);
|
||||
nsHTMLHeadingElement* it = new nsHTMLHeadingElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ nsHTMLHeading::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHeading, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHeadingElement, Align, align, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeading::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLHeadingElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ nsHTMLHeading::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeading::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLHeadingElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -143,7 +143,7 @@ nsHTMLHeading::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeading::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLHeadingElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -151,7 +151,7 @@ nsHTMLHeading::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeading::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLHeadingElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHtmlElementIID, NS_IDOMHTMLHTMLELEMENT_IID);
|
||||
|
||||
class nsHTMLHtml : public nsIDOMHTMLHtmlElement,
|
||||
class nsHTMLHtmlElement : public nsIDOMHTMLHtmlElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLHtml(nsIAtom* aTag);
|
||||
~nsHTMLHtml();
|
||||
nsHTMLHtmlElement(nsIAtom* aTag);
|
||||
~nsHTMLHtmlElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -71,35 +71,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLHtml(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLHtmlElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLHtml(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLHtmlElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLHtml::nsHTMLHtml(nsIAtom* aTag)
|
||||
nsHTMLHtmlElement::nsHTMLHtmlElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLHtml::~nsHTMLHtml()
|
||||
nsHTMLHtmlElement::~nsHTMLHtmlElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLHtml)
|
||||
NS_IMPL_ADDREF(nsHTMLHtmlElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLHtml)
|
||||
NS_IMPL_RELEASE(nsHTMLHtmlElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLHtml::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLHtmlElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHtmlElementIID)) {
|
||||
@@ -112,9 +112,9 @@ nsHTMLHtml::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLHtml::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLHtmlElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLHtml* it = new nsHTMLHtml(mInner.mTag);
|
||||
nsHTMLHtmlElement* it = new nsHTMLHtmlElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ nsHTMLHtml::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHtml, Version, version, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHtmlElement, Version, version, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHtml::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLHtmlElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -133,7 +133,7 @@ nsHTMLHtml::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHtml::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLHtmlElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -141,14 +141,14 @@ nsHTMLHtml::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHtml::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLHtmlElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHtml::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLHtmlElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -31,14 +31,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
|
||||
|
||||
class nsHTMLInput : public nsIDOMHTMLInputElement,
|
||||
class nsHTMLInputElement : public nsIDOMHTMLInputElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLInput(nsIAtom* aTag);
|
||||
~nsHTMLInput();
|
||||
nsHTMLInputElement(nsIAtom* aTag);
|
||||
~nsHTMLInputElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -109,35 +109,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLInput(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLInputElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLInput(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLInputElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLInput::nsHTMLInput(nsIAtom* aTag)
|
||||
nsHTMLInputElement::nsHTMLInputElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLInput::~nsHTMLInput()
|
||||
nsHTMLInputElement::~nsHTMLInputElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLInput)
|
||||
NS_IMPL_ADDREF(nsHTMLInputElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLInput)
|
||||
NS_IMPL_RELEASE(nsHTMLInputElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLInput::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLInputElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLInputElementIID)) {
|
||||
@@ -150,9 +150,9 @@ nsHTMLInput::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLInput::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLInputElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLInput* it = new nsHTMLInput(mInner.mTag);
|
||||
nsHTMLInputElement* it = new nsHTMLInputElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -161,66 +161,66 @@ nsHTMLInput::CloneNode(nsIDOMNode** aReturn)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
nsHTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, DefaultValue, defaultvalue, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInput, DefaultChecked, defaultchecked, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, Accept, accept, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, AccessKey, accesskey, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, Alt, alt, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInput, Checked, checked, eSetAttrNotify_Render)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInput, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLInput, MaxLength, maxlength, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInput, ReadOnly, readonly, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, Size, size, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, Src, src, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLInput, TabIndex, tabindex, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, UseMap, usemap, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInput, Value, value, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, DefaultValue, defaultvalue, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, DefaultChecked, defaultchecked, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Accept, accept, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, AccessKey, accesskey, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Alt, alt, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Checked, checked, eSetAttrNotify_Render)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLInputElement, MaxLength, maxlength, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, ReadOnly, readonly, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Size, size, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Src, src, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLInputElement, TabIndex, tabindex, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, UseMap, usemap, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Value, value, eSetAttrNotify_Render)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::GetType(nsString& aValue)
|
||||
nsHTMLInputElement::GetType(nsString& aValue)
|
||||
{
|
||||
mInner.GetAttribute(nsHTMLAtoms::type, aValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::Blur()
|
||||
nsHTMLInputElement::Blur()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::Focus()
|
||||
nsHTMLInputElement::Focus()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::Select()
|
||||
nsHTMLInputElement::Select()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::Click()
|
||||
nsHTMLInputElement::Click()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLInputElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -229,7 +229,7 @@ nsHTMLInput::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLInputElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -238,7 +238,7 @@ nsHTMLInput::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLInputElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX align
|
||||
@@ -246,7 +246,7 @@ nsHTMLInput::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInput::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLInputElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLInsElementIID, NS_IDOMHTMLINSELEMENT_IID);
|
||||
|
||||
class nsHTMLIns : public nsIDOMHTMLInsElement,
|
||||
class nsHTMLInsElement : public nsIDOMHTMLInsElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLIns(nsIAtom* aTag);
|
||||
~nsHTMLIns();
|
||||
nsHTMLInsElement(nsIAtom* aTag);
|
||||
~nsHTMLInsElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -73,35 +73,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLIns(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLInsElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLIns(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLInsElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLIns::nsHTMLIns(nsIAtom* aTag)
|
||||
nsHTMLInsElement::nsHTMLInsElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLIns::~nsHTMLIns()
|
||||
nsHTMLInsElement::~nsHTMLInsElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLIns)
|
||||
NS_IMPL_ADDREF(nsHTMLInsElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLIns)
|
||||
NS_IMPL_RELEASE(nsHTMLInsElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLIns::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLInsElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLInsElementIID)) {
|
||||
@@ -114,9 +114,9 @@ nsHTMLIns::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLIns::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLInsElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLIns* it = new nsHTMLIns(mInner.mTag);
|
||||
nsHTMLInsElement* it = new nsHTMLInsElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -124,11 +124,11 @@ nsHTMLIns::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLIns, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLIns, DateTime, datetime, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInsElement, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInsElement, DateTime, datetime, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLIns::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLInsElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ nsHTMLIns::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLIns::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLInsElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -146,7 +146,7 @@ nsHTMLIns::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLIns::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLInsElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -154,7 +154,7 @@ nsHTMLIns::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLIns::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLInsElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLLIElementIID, NS_IDOMHTMLLIELEMENT_IID);
|
||||
|
||||
class nsHTMLLI : public nsIDOMHTMLLIElement,
|
||||
class nsHTMLLIElement : public nsIDOMHTMLLIElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLLI(nsIAtom* aTag);
|
||||
~nsHTMLLI();
|
||||
nsHTMLLIElement(nsIAtom* aTag);
|
||||
~nsHTMLLIElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -73,35 +73,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLLI(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLLIElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLLI(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLLIElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLLI::nsHTMLLI(nsIAtom* aTag)
|
||||
nsHTMLLIElement::nsHTMLLIElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLLI::~nsHTMLLI()
|
||||
nsHTMLLIElement::~nsHTMLLIElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLLI)
|
||||
NS_IMPL_ADDREF(nsHTMLLIElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLLI)
|
||||
NS_IMPL_RELEASE(nsHTMLLIElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLLI::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLLIElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLLIElementIID)) {
|
||||
@@ -114,9 +114,9 @@ nsHTMLLI::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLLI::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLLIElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLLI* it = new nsHTMLLI(mInner.mTag);
|
||||
nsHTMLLIElement* it = new nsHTMLLIElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -124,11 +124,11 @@ nsHTMLLI::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLI, Type, type, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLLI, Value, value, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLIElement, Type, type, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLLIElement, Value, value, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLI::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLLIElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ nsHTMLLI::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLI::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLLIElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -146,7 +146,7 @@ nsHTMLLI::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLI::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLLIElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -154,7 +154,7 @@ nsHTMLLI::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLI::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLLIElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLLinkElementIID, NS_IDOMHTMLLINKELEMENT_IID);
|
||||
|
||||
class nsHTMLLink : public nsIDOMHTMLLinkElement,
|
||||
class nsHTMLLinkElement : public nsIDOMHTMLLinkElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLLink(nsIAtom* aTag);
|
||||
~nsHTMLLink();
|
||||
nsHTMLLinkElement(nsIAtom* aTag);
|
||||
~nsHTMLLinkElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -87,35 +87,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLLink(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLLinkElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLLink(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLLinkElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLLink::nsHTMLLink(nsIAtom* aTag)
|
||||
nsHTMLLinkElement::nsHTMLLinkElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLLink::~nsHTMLLink()
|
||||
nsHTMLLinkElement::~nsHTMLLinkElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLLink)
|
||||
NS_IMPL_ADDREF(nsHTMLLinkElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLLink)
|
||||
NS_IMPL_RELEASE(nsHTMLLinkElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLLink::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLLinkElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLLinkElementIID)) {
|
||||
@@ -128,9 +128,9 @@ nsHTMLLink::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLLink::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLLinkElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLLink* it = new nsHTMLLink(mInner.mTag);
|
||||
nsHTMLLinkElement* it = new nsHTMLLinkElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -138,18 +138,18 @@ nsHTMLLink::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLLink, Disabled, disabled, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLink, Charset, charset, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLink, Href, href, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLink, Hreflang, hreflang, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLink, Media, media, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLink, Rel, rel, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLink, Rev, rev, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLink, Target, target, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLink, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLLinkElement, Disabled, disabled, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Charset, charset, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Href, href, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Hreflang, hreflang, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Media, media, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Rel, rel, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Rev, rev, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Target, target, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Type, type, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLink::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLLinkElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ nsHTMLLink::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLink::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLLinkElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -165,14 +165,14 @@ nsHTMLLink::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLink::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLLinkElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLink::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLLinkElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLMapElementIID, NS_IDOMHTMLMAPELEMENT_IID);
|
||||
|
||||
class nsHTMLMap : public nsIDOMHTMLMapElement,
|
||||
class nsHTMLMapElement : public nsIDOMHTMLMapElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLMap(nsIAtom* aTag);
|
||||
~nsHTMLMap();
|
||||
nsHTMLMapElement(nsIAtom* aTag);
|
||||
~nsHTMLMapElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -73,35 +73,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLMap(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLMapElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLMap(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLMapElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLMap::nsHTMLMap(nsIAtom* aTag)
|
||||
nsHTMLMapElement::nsHTMLMapElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLMap::~nsHTMLMap()
|
||||
nsHTMLMapElement::~nsHTMLMapElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLMap)
|
||||
NS_IMPL_ADDREF(nsHTMLMapElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLMap)
|
||||
NS_IMPL_RELEASE(nsHTMLMapElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLMap::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLMapElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLMapElementIID)) {
|
||||
@@ -114,9 +114,9 @@ nsHTMLMap::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLMap::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLMapElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLMap* it = new nsHTMLMap(mInner.mTag);
|
||||
nsHTMLMapElement* it = new nsHTMLMapElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -125,23 +125,23 @@ nsHTMLMap::CloneNode(nsIDOMNode** aReturn)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMap::GetAreas(nsIDOMHTMLCollection** aAreas)
|
||||
nsHTMLMapElement::GetAreas(nsIDOMHTMLCollection** aAreas)
|
||||
{
|
||||
*aAreas = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;/* XXX */
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMap::SetAreas(nsIDOMHTMLCollection* aAreas)
|
||||
nsHTMLMapElement::SetAreas(nsIDOMHTMLCollection* aAreas)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMap, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMapElement, Name, name, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMap::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLMapElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -150,7 +150,7 @@ nsHTMLMap::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMap::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLMapElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -159,7 +159,7 @@ nsHTMLMap::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMap::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLMapElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -167,7 +167,7 @@ nsHTMLMap::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMap::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLMapElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLMenuElementIID, NS_IDOMHTMLMENUELEMENT_IID);
|
||||
|
||||
class nsHTMLMenu : public nsIDOMHTMLMenuElement,
|
||||
class nsHTMLMenuElement : public nsIDOMHTMLMenuElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLMenu(nsIAtom* aTag);
|
||||
~nsHTMLMenu();
|
||||
nsHTMLMenuElement(nsIAtom* aTag);
|
||||
~nsHTMLMenuElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -71,35 +71,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLMenu(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLMenuElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLMenu(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLMenuElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLMenu::nsHTMLMenu(nsIAtom* aTag)
|
||||
nsHTMLMenuElement::nsHTMLMenuElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLMenu::~nsHTMLMenu()
|
||||
nsHTMLMenuElement::~nsHTMLMenuElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLMenu)
|
||||
NS_IMPL_ADDREF(nsHTMLMenuElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLMenu)
|
||||
NS_IMPL_RELEASE(nsHTMLMenuElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLMenu::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLMenuElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLMenuElementIID)) {
|
||||
@@ -112,9 +112,9 @@ nsHTMLMenu::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLMenu::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLMenuElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLMenu* it = new nsHTMLMenu(mInner.mTag);
|
||||
nsHTMLMenuElement* it = new nsHTMLMenuElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ nsHTMLMenu::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLMenu, Compact, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLMenuElement, Compact, compact, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenu::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLMenuElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ nsHTMLMenu::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenu::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLMenuElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -143,7 +143,7 @@ nsHTMLMenu::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenu::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLMenuElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -151,7 +151,7 @@ nsHTMLMenu::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenu::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLMenuElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
168
mozilla/content/html/content/src/nsHTMLMetaElement.cpp
Normal file
168
mozilla/content/html/content/src/nsHTMLMetaElement.cpp
Normal file
@@ -0,0 +1,168 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLMetaElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLMetaElementIID, NS_IDOMHTMLMETAELEMENT_IID);
|
||||
|
||||
class nsHTMLMetaElement : public nsIDOMHTMLMetaElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLMetaElement(nsIAtom* aTag);
|
||||
~nsHTMLMetaElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLMetaElement
|
||||
NS_IMETHOD GetContent(nsString& aContent);
|
||||
NS_IMETHOD SetContent(const nsString& aContent);
|
||||
NS_IMETHOD GetHttpEquiv(nsString& aHttpEquiv);
|
||||
NS_IMETHOD SetHttpEquiv(const nsString& aHttpEquiv);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetScheme(nsString& aScheme);
|
||||
NS_IMETHOD SetScheme(const nsString& aScheme);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLMetaElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLMetaElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLMetaElement::nsHTMLMetaElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLMetaElement::~nsHTMLMetaElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLMetaElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLMetaElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLMetaElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLMetaElementIID)) {
|
||||
nsIDOMHTMLMetaElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLMetaElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLMetaElement* it = new nsHTMLMetaElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Content, content, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, HttpEquiv, httpEquiv, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Name, name, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Scheme, scheme, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMetaElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMetaElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMetaElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMetaElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLModElementIID, NS_IDOMHTMLMODELEMENT_IID);
|
||||
|
||||
class nsHTMLMod : public nsIDOMHTMLModElement,
|
||||
class nsHTMLModElement : public nsIDOMHTMLModElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLMod(nsIAtom* aTag);
|
||||
~nsHTMLMod();
|
||||
nsHTMLModElement(nsIAtom* aTag);
|
||||
~nsHTMLModElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -73,35 +73,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLMod(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLModElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLMod(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLModElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLMod::nsHTMLMod(nsIAtom* aTag)
|
||||
nsHTMLModElement::nsHTMLModElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLMod::~nsHTMLMod()
|
||||
nsHTMLModElement::~nsHTMLModElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLMod)
|
||||
NS_IMPL_ADDREF(nsHTMLModElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLMod)
|
||||
NS_IMPL_RELEASE(nsHTMLModElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLMod::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLModElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLModElementIID)) {
|
||||
@@ -114,9 +114,9 @@ nsHTMLMod::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLMod::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLModElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLMod* it = new nsHTMLMod(mInner.mTag);
|
||||
nsHTMLModElement* it = new nsHTMLModElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -124,11 +124,11 @@ nsHTMLMod::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMod, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMod, DateTime, datetime, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLModElement, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLModElement, DateTime, datetime, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMod::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLModElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ nsHTMLMod::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMod::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLModElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -146,7 +146,7 @@ nsHTMLMod::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMod::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLModElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -154,7 +154,7 @@ nsHTMLMod::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMod::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLModElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLOListElementIID, NS_IDOMHTMLOLISTELEMENT_IID);
|
||||
|
||||
class nsHTMLOList : public nsIDOMHTMLOListElement,
|
||||
class nsHTMLOListElement : public nsIDOMHTMLOListElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLOList(nsIAtom* aTag);
|
||||
~nsHTMLOList();
|
||||
nsHTMLOListElement(nsIAtom* aTag);
|
||||
~nsHTMLOListElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -75,35 +75,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLOList(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLOListElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLOList(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLOListElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLOList::nsHTMLOList(nsIAtom* aTag)
|
||||
nsHTMLOListElement::nsHTMLOListElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLOList::~nsHTMLOList()
|
||||
nsHTMLOListElement::~nsHTMLOListElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLOList)
|
||||
NS_IMPL_ADDREF(nsHTMLOListElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLOList)
|
||||
NS_IMPL_RELEASE(nsHTMLOListElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLOList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLOListElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLOListElementIID)) {
|
||||
@@ -116,9 +116,9 @@ nsHTMLOList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLOList::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLOListElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLOList* it = new nsHTMLOList(mInner.mTag);
|
||||
nsHTMLOListElement* it = new nsHTMLOListElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -126,12 +126,12 @@ nsHTMLOList::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOList, Compact, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLOList, Start, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOList, Type, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOListElement, Compact, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLOListElement, Start, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOListElement, Type, compact, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOList::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLOListElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ nsHTMLOList::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOList::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLOListElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -149,7 +149,7 @@ nsHTMLOList::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOList::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLOListElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -157,7 +157,7 @@ nsHTMLOList::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOList::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLOListElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
244
mozilla/content/html/content/src/nsHTMLObjectElement.cpp
Normal file
244
mozilla/content/html/content/src/nsHTMLObjectElement.cpp
Normal file
@@ -0,0 +1,244 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLObjectElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLObjectElementIID, NS_IDOMHTMLOBJECTELEMENT_IID);
|
||||
|
||||
class nsHTMLObjectElement : public nsIDOMHTMLObjectElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLObjectElement(nsIAtom* aTag);
|
||||
~nsHTMLObjectElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLObjectElement
|
||||
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
|
||||
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm);
|
||||
NS_IMETHOD GetCode(nsString& aCode);
|
||||
NS_IMETHOD SetCode(const nsString& aCode);
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetArchive(nsString& aArchive);
|
||||
NS_IMETHOD SetArchive(const nsString& aArchive);
|
||||
NS_IMETHOD GetBorder(nsString& aBorder);
|
||||
NS_IMETHOD SetBorder(const nsString& aBorder);
|
||||
NS_IMETHOD GetCodeBase(nsString& aCodeBase);
|
||||
NS_IMETHOD SetCodeBase(const nsString& aCodeBase);
|
||||
NS_IMETHOD GetCodeType(nsString& aCodeType);
|
||||
NS_IMETHOD SetCodeType(const nsString& aCodeType);
|
||||
NS_IMETHOD GetData(nsString& aData);
|
||||
NS_IMETHOD SetData(const nsString& aData);
|
||||
NS_IMETHOD GetDeclare(PRBool* aDeclare);
|
||||
NS_IMETHOD SetDeclare(PRBool aDeclare);
|
||||
NS_IMETHOD GetHeight(nsString& aHeight);
|
||||
NS_IMETHOD SetHeight(const nsString& aHeight);
|
||||
NS_IMETHOD GetHspace(nsString& aHspace);
|
||||
NS_IMETHOD SetHspace(const nsString& aHspace);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetStandby(nsString& aStandby);
|
||||
NS_IMETHOD SetStandby(const nsString& aStandby);
|
||||
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
||||
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
NS_IMETHOD GetUseMap(nsString& aUseMap);
|
||||
NS_IMETHOD SetUseMap(const nsString& aUseMap);
|
||||
NS_IMETHOD GetVspace(nsString& aVspace);
|
||||
NS_IMETHOD SetVspace(const nsString& aVspace);
|
||||
NS_IMETHOD GetWidth(nsString& aWidth);
|
||||
NS_IMETHOD SetWidth(const nsString& aWidth);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLObjectElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLObjectElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLObjectElement::nsHTMLObjectElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLObjectElement::~nsHTMLObjectElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLObjectElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLObjectElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLObjectElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLObjectElementIID)) {
|
||||
nsIDOMHTMLObjectElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLObjectElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLObjectElement* it = new nsHTMLObjectElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Code, code, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Archive, archive, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Border, border, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, CodeBase, codebase, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, CodeType, codetype, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Data, data, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLObjectElement, Declare, declare, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Height, height, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Hspace, hspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Standby, standby, eSetAttrNotify_None)
|
||||
NS_IMPL_INT_ATTR(nsHTMLObjectElement, TabIndex, tabindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, UseMap, usemap, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Vspace, vspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ParseImageAttribute(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ImageAttributeToString(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
mInner.MapImageAlignAttributeInto(aContext, aPresContext);
|
||||
mInner.MapImageAttributesInto(aContext, aPresContext);
|
||||
mInner.MapImageBorderAttributesInto(aContext, aPresContext, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLOptionElementIID, NS_IDOMHTMLOPTIONELEMENT_IID);
|
||||
|
||||
class nsHTMLOption : public nsIDOMHTMLOptionElement,
|
||||
class nsHTMLOptionElement : public nsIDOMHTMLOptionElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLOption(nsIAtom* aTag);
|
||||
~nsHTMLOption();
|
||||
nsHTMLOptionElement(nsIAtom* aTag);
|
||||
~nsHTMLOptionElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -85,35 +85,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLOption(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLOptionElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLOption(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLOptionElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLOption::nsHTMLOption(nsIAtom* aTag)
|
||||
nsHTMLOptionElement::nsHTMLOptionElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLOption::~nsHTMLOption()
|
||||
nsHTMLOptionElement::~nsHTMLOptionElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLOption)
|
||||
NS_IMPL_ADDREF(nsHTMLOptionElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLOption)
|
||||
NS_IMPL_RELEASE(nsHTMLOptionElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLOption::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLOptionElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLOptionElementIID)) {
|
||||
@@ -126,9 +126,9 @@ nsHTMLOption::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLOption::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLOptionElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLOption* it = new nsHTMLOption(mInner.mTag);
|
||||
nsHTMLOptionElement* it = new nsHTMLOptionElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -137,22 +137,22 @@ nsHTMLOption::CloneNode(nsIDOMNode** aReturn)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOption::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
nsHTMLOptionElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOption, DefaultSelected, defaultselected, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOption, Text, text, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLOption, Index, index, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOption, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOption, Label, label, eSetAttrNotify_Render)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOption, Selected, selected, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOption, Value, value, eSetAttrNotify_Render)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOptionElement, DefaultSelected, defaultselected, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOptionElement, Text, text, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLOptionElement, Index, index, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOptionElement, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOptionElement, Label, label, eSetAttrNotify_Render)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOptionElement, Selected, selected, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOptionElement, Value, value, eSetAttrNotify_Render)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOption::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLOptionElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -161,7 +161,7 @@ nsHTMLOption::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOption::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLOptionElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -170,7 +170,7 @@ nsHTMLOption::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOption::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLOptionElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -178,7 +178,7 @@ nsHTMLOption::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOption::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLOptionElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -31,14 +31,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLParagraphElementIID, NS_IDOMHTMLPARAGRAPHELEMENT_IID);
|
||||
|
||||
class nsHTMLParagraph : public nsIDOMHTMLParagraphElement,
|
||||
class nsHTMLParagraphElement : public nsIDOMHTMLParagraphElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLParagraph(nsIAtom* aTag);
|
||||
~nsHTMLParagraph();
|
||||
nsHTMLParagraphElement(nsIAtom* aTag);
|
||||
~nsHTMLParagraphElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -73,35 +73,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLParagraph(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLParagraphElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLParagraph(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLParagraphElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLParagraph::nsHTMLParagraph(nsIAtom* aTag)
|
||||
nsHTMLParagraphElement::nsHTMLParagraphElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLParagraph::~nsHTMLParagraph()
|
||||
nsHTMLParagraphElement::~nsHTMLParagraphElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLParagraph)
|
||||
NS_IMPL_ADDREF(nsHTMLParagraphElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLParagraph)
|
||||
NS_IMPL_RELEASE(nsHTMLParagraphElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLParagraph::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLParagraphElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLParagraphElementIID)) {
|
||||
@@ -114,9 +114,9 @@ nsHTMLParagraph::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLParagraph::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLParagraphElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLParagraph* it = new nsHTMLParagraph(mInner.mTag);
|
||||
nsHTMLParagraphElement* it = new nsHTMLParagraphElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -124,10 +124,10 @@ nsHTMLParagraph::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParagraph, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParagraphElement, Align, align, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParagraph::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLParagraphElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ nsHTMLParagraph::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParagraph::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLParagraphElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -154,7 +154,7 @@ nsHTMLParagraph::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParagraph::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLParagraphElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -162,7 +162,7 @@ nsHTMLParagraph::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParagraph::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLParagraphElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLParamElementIID, NS_IDOMHTMLPARAMELEMENT_IID);
|
||||
|
||||
class nsHTMLParam : public nsIDOMHTMLParamElement,
|
||||
class nsHTMLParamElement : public nsIDOMHTMLParamElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLParam(nsIAtom* aTag);
|
||||
~nsHTMLParam();
|
||||
nsHTMLParamElement(nsIAtom* aTag);
|
||||
~nsHTMLParamElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -77,35 +77,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLParam(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLParamElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLParam(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLParamElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLParam::nsHTMLParam(nsIAtom* aTag)
|
||||
nsHTMLParamElement::nsHTMLParamElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLParam::~nsHTMLParam()
|
||||
nsHTMLParamElement::~nsHTMLParamElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLParam)
|
||||
NS_IMPL_ADDREF(nsHTMLParamElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLParam)
|
||||
NS_IMPL_RELEASE(nsHTMLParamElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLParam::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLParamElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLParamElementIID)) {
|
||||
@@ -118,9 +118,9 @@ nsHTMLParam::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLParam::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLParamElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLParam* it = new nsHTMLParam(mInner.mTag);
|
||||
nsHTMLParamElement* it = new nsHTMLParamElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -128,13 +128,13 @@ nsHTMLParam::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParam, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParam, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParam, Value, value, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParam, ValueType, valuetype, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParamElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParamElement, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParamElement, Value, value, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParamElement, ValueType, valuetype, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParam::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLParamElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -143,7 +143,7 @@ nsHTMLParam::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParam::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLParamElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -152,7 +152,7 @@ nsHTMLParam::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParam::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLParamElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -160,7 +160,7 @@ nsHTMLParam::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParam::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLParamElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -31,14 +31,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLPreElementIID, NS_IDOMHTMLPREELEMENT_IID);
|
||||
|
||||
class nsHTMLPre : public nsIDOMHTMLPreElement,
|
||||
class nsHTMLPreElement : public nsIDOMHTMLPreElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLPre(nsIAtom* aTag);
|
||||
~nsHTMLPre();
|
||||
nsHTMLPreElement(nsIAtom* aTag);
|
||||
~nsHTMLPreElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -73,35 +73,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLPre(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLPreElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLPre(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLPreElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLPre::nsHTMLPre(nsIAtom* aTag)
|
||||
nsHTMLPreElement::nsHTMLPreElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLPre::~nsHTMLPre()
|
||||
nsHTMLPreElement::~nsHTMLPreElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLPre)
|
||||
NS_IMPL_ADDREF(nsHTMLPreElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLPre)
|
||||
NS_IMPL_RELEASE(nsHTMLPreElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLPre::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLPreElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLPreElementIID)) {
|
||||
@@ -114,9 +114,9 @@ nsHTMLPre::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLPre::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLPreElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLPre* it = new nsHTMLPre(mInner.mTag);
|
||||
nsHTMLPreElement* it = new nsHTMLPreElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -124,10 +124,10 @@ nsHTMLPre::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_INT_ATTR(nsHTMLPre, Width, width, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLPreElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLPre::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLPreElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ nsHTMLPre::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLPre::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLPreElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -154,7 +154,7 @@ nsHTMLPre::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLPre::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLPreElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -162,7 +162,7 @@ nsHTMLPre::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLPre::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLPreElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLQuoteElementIID, NS_IDOMHTMLQUOTEELEMENT_IID);
|
||||
|
||||
class nsHTMLQuote : public nsIDOMHTMLQuoteElement,
|
||||
class nsHTMLQuoteElement : public nsIDOMHTMLQuoteElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLQuote(nsIAtom* aTag);
|
||||
~nsHTMLQuote();
|
||||
nsHTMLQuoteElement(nsIAtom* aTag);
|
||||
~nsHTMLQuoteElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -71,35 +71,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLQuote(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLQuoteElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLQuote(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLQuoteElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLQuote::nsHTMLQuote(nsIAtom* aTag)
|
||||
nsHTMLQuoteElement::nsHTMLQuoteElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLQuote::~nsHTMLQuote()
|
||||
nsHTMLQuoteElement::~nsHTMLQuoteElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLQuote)
|
||||
NS_IMPL_ADDREF(nsHTMLQuoteElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLQuote)
|
||||
NS_IMPL_RELEASE(nsHTMLQuoteElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLQuote::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLQuoteElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLQuoteElementIID)) {
|
||||
@@ -112,9 +112,9 @@ nsHTMLQuote::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLQuote::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLQuoteElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLQuote* it = new nsHTMLQuote(mInner.mTag);
|
||||
nsHTMLQuoteElement* it = new nsHTMLQuoteElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ nsHTMLQuote::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLQuote, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLQuoteElement, Cite, cite, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLQuote::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLQuoteElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ nsHTMLQuote::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLQuote::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLQuoteElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -143,7 +143,7 @@ nsHTMLQuote::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLQuote::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLQuoteElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -151,7 +151,7 @@ nsHTMLQuote::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLQuote::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLQuoteElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLScriptElementIID, NS_IDOMHTMLSCRIPTELEMENT_IID);
|
||||
|
||||
class nsHTMLScript : public nsIDOMHTMLScriptElement,
|
||||
class nsHTMLScriptElement : public nsIDOMHTMLScriptElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLScript(nsIAtom* aTag);
|
||||
~nsHTMLScript();
|
||||
nsHTMLScriptElement(nsIAtom* aTag);
|
||||
~nsHTMLScriptElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -84,35 +84,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLScript(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLScriptElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLScript(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLScriptElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLScript::nsHTMLScript(nsIAtom* aTag)
|
||||
nsHTMLScriptElement::nsHTMLScriptElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLScript::~nsHTMLScript()
|
||||
nsHTMLScriptElement::~nsHTMLScriptElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLScript)
|
||||
NS_IMPL_ADDREF(nsHTMLScriptElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLScript)
|
||||
NS_IMPL_RELEASE(nsHTMLScriptElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLScript::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLScriptElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLScriptElementIID)) {
|
||||
@@ -125,9 +125,9 @@ nsHTMLScript::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLScript::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLScriptElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLScript* it = new nsHTMLScript(mInner.mTag);
|
||||
nsHTMLScriptElement* it = new nsHTMLScriptElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ nsHTMLScript::CloneNode(nsIDOMNode** aReturn)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::GetText(nsString& aValue)
|
||||
nsHTMLScriptElement::GetText(nsString& aValue)
|
||||
{
|
||||
// XXX out of memory errors
|
||||
aValue = mText;
|
||||
@@ -144,7 +144,7 @@ nsHTMLScript::GetText(nsString& aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::SetText(const nsString& aValue)
|
||||
nsHTMLScriptElement::SetText(const nsString& aValue)
|
||||
{
|
||||
// XXX out of memory errors
|
||||
mText = aValue;
|
||||
@@ -152,7 +152,7 @@ nsHTMLScript::SetText(const nsString& aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::GetHtmlFor(nsString& aValue)
|
||||
nsHTMLScriptElement::GetHtmlFor(nsString& aValue)
|
||||
{
|
||||
// XXX write me
|
||||
// mInner.GetAttribute(nsHTMLAtoms::charset, aValue);
|
||||
@@ -160,7 +160,7 @@ nsHTMLScript::GetHtmlFor(nsString& aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::SetHtmlFor(const nsString& aValue)
|
||||
nsHTMLScriptElement::SetHtmlFor(const nsString& aValue)
|
||||
{
|
||||
// XXX write me
|
||||
// return mInner.SetAttr(nsHTMLAtoms::charset, aValue, eSetAttrNotify_None);
|
||||
@@ -168,7 +168,7 @@ nsHTMLScript::SetHtmlFor(const nsString& aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::GetEvent(nsString& aValue)
|
||||
nsHTMLScriptElement::GetEvent(nsString& aValue)
|
||||
{
|
||||
// XXX write me
|
||||
// mInner.GetAttribute(nsHTMLAtoms::charset, aValue);
|
||||
@@ -176,20 +176,20 @@ nsHTMLScript::GetEvent(nsString& aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::SetEvent(const nsString& aValue)
|
||||
nsHTMLScriptElement::SetEvent(const nsString& aValue)
|
||||
{
|
||||
// XXX write me
|
||||
// return mInner.SetAttr(nsHTMLAtoms::charset, aValue, eSetAttrNotify_None);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLScript, Charset, charset, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLScript, Defer, defer, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLScript, Src, src, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLScript, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLScriptElement, Charset, charset, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLScriptElement, Defer, defer, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLScriptElement, Src, src, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLScriptElement, Type, type, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLScriptElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -197,7 +197,7 @@ nsHTMLScript::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLScriptElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -205,14 +205,14 @@ nsHTMLScript::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLScriptElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScript::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLScriptElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
234
mozilla/content/html/content/src/nsHTMLSelectElement.cpp
Normal file
234
mozilla/content/html/content/src/nsHTMLSelectElement.cpp
Normal file
@@ -0,0 +1,234 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLSelectElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLSelectElementIID, NS_IDOMHTMLSELECTELEMENT_IID);
|
||||
|
||||
class nsHTMLSelectElement : public nsIDOMHTMLSelectElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLSelectElement(nsIAtom* aTag);
|
||||
~nsHTMLSelectElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLSelectElement
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
NS_IMETHOD GetSelectedIndex(PRInt32* aSelectedIndex);
|
||||
NS_IMETHOD SetSelectedIndex(PRInt32 aSelectedIndex);
|
||||
NS_IMETHOD GetValue(nsString& aValue);
|
||||
NS_IMETHOD SetValue(const nsString& aValue);
|
||||
NS_IMETHOD GetLength(PRInt32* aLength);
|
||||
NS_IMETHOD SetLength(PRInt32 aLength);
|
||||
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
|
||||
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm);
|
||||
NS_IMETHOD GetOptions(nsIDOMHTMLCollection** aOptions);
|
||||
NS_IMETHOD SetOptions(nsIDOMHTMLCollection* aOptions);
|
||||
NS_IMETHOD GetDisabled(PRBool* aDisabled);
|
||||
NS_IMETHOD SetDisabled(PRBool aDisabled);
|
||||
NS_IMETHOD GetMultiple(PRBool* aMultiple);
|
||||
NS_IMETHOD SetMultiple(PRBool aMultiple);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetSize(PRInt32* aSize);
|
||||
NS_IMETHOD SetSize(PRInt32 aSize);
|
||||
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
||||
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
||||
NS_IMETHOD Add(nsIDOMHTMLElement* aElement, nsIDOMHTMLElement* aBefore);
|
||||
NS_IMETHOD Remove(PRInt32 aIndex);
|
||||
NS_IMETHOD Blur();
|
||||
NS_IMETHOD Focus();
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLSelectElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLSelectElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLSelectElement::nsHTMLSelectElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLSelectElement::~nsHTMLSelectElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLSelectElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLSelectElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLSelectElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLSelectElementIID)) {
|
||||
nsIDOMHTMLSelectElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLSelectElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLSelectElement* it = new nsHTMLSelectElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::GetOptions(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::SetOptions(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, SelectedIndex, selectedindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Value, value, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, Length, length, eSetAttrNotify_Restart)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, Multiple, multiple, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, Size, size, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, TabIndex, tabindex, eSetAttrNotify_Render)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::Blur()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::Focus()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
244
mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp
Normal file
244
mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp
Normal file
@@ -0,0 +1,244 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLObjectElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLObjectElementIID, NS_IDOMHTMLOBJECTELEMENT_IID);
|
||||
|
||||
class nsHTMLObjectElement : public nsIDOMHTMLObjectElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLObjectElement(nsIAtom* aTag);
|
||||
~nsHTMLObjectElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLObjectElement
|
||||
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
|
||||
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm);
|
||||
NS_IMETHOD GetCode(nsString& aCode);
|
||||
NS_IMETHOD SetCode(const nsString& aCode);
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetArchive(nsString& aArchive);
|
||||
NS_IMETHOD SetArchive(const nsString& aArchive);
|
||||
NS_IMETHOD GetBorder(nsString& aBorder);
|
||||
NS_IMETHOD SetBorder(const nsString& aBorder);
|
||||
NS_IMETHOD GetCodeBase(nsString& aCodeBase);
|
||||
NS_IMETHOD SetCodeBase(const nsString& aCodeBase);
|
||||
NS_IMETHOD GetCodeType(nsString& aCodeType);
|
||||
NS_IMETHOD SetCodeType(const nsString& aCodeType);
|
||||
NS_IMETHOD GetData(nsString& aData);
|
||||
NS_IMETHOD SetData(const nsString& aData);
|
||||
NS_IMETHOD GetDeclare(PRBool* aDeclare);
|
||||
NS_IMETHOD SetDeclare(PRBool aDeclare);
|
||||
NS_IMETHOD GetHeight(nsString& aHeight);
|
||||
NS_IMETHOD SetHeight(const nsString& aHeight);
|
||||
NS_IMETHOD GetHspace(nsString& aHspace);
|
||||
NS_IMETHOD SetHspace(const nsString& aHspace);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetStandby(nsString& aStandby);
|
||||
NS_IMETHOD SetStandby(const nsString& aStandby);
|
||||
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
||||
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
NS_IMETHOD GetUseMap(nsString& aUseMap);
|
||||
NS_IMETHOD SetUseMap(const nsString& aUseMap);
|
||||
NS_IMETHOD GetVspace(nsString& aVspace);
|
||||
NS_IMETHOD SetVspace(const nsString& aVspace);
|
||||
NS_IMETHOD GetWidth(nsString& aWidth);
|
||||
NS_IMETHOD SetWidth(const nsString& aWidth);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLObjectElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLObjectElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLObjectElement::nsHTMLObjectElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLObjectElement::~nsHTMLObjectElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLObjectElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLObjectElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLObjectElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLObjectElementIID)) {
|
||||
nsIDOMHTMLObjectElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLObjectElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLObjectElement* it = new nsHTMLObjectElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Code, code, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Archive, archive, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Border, border, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, CodeBase, codebase, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, CodeType, codetype, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Data, data, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLObjectElement, Declare, declare, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Height, height, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Hspace, hspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Standby, standby, eSetAttrNotify_None)
|
||||
NS_IMPL_INT_ATTR(nsHTMLObjectElement, TabIndex, tabindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, UseMap, usemap, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Vspace, vspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ParseImageAttribute(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ImageAttributeToString(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
mInner.MapImageAlignAttributeInto(aContext, aPresContext);
|
||||
mInner.MapImageAttributesInto(aContext, aPresContext);
|
||||
mInner.MapImageBorderAttributesInto(aContext, aPresContext, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -31,14 +31,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLStyleElementIID, NS_IDOMHTMLSTYLEELEMENT_IID);
|
||||
|
||||
class nsHTMLStyle : public nsIDOMHTMLStyleElement,
|
||||
class nsHTMLStyleElement : public nsIDOMHTMLStyleElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLStyle(nsIAtom* aTag);
|
||||
~nsHTMLStyle();
|
||||
nsHTMLStyleElement(nsIAtom* aTag);
|
||||
~nsHTMLStyleElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -77,35 +77,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLStyle(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLStyleElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLStyle(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLStyleElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLStyle::nsHTMLStyle(nsIAtom* aTag)
|
||||
nsHTMLStyleElement::nsHTMLStyleElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLStyle::~nsHTMLStyle()
|
||||
nsHTMLStyleElement::~nsHTMLStyleElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLStyle)
|
||||
NS_IMPL_ADDREF(nsHTMLStyleElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLStyle)
|
||||
NS_IMPL_RELEASE(nsHTMLStyleElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLStyle::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLStyleElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLStyleElementIID)) {
|
||||
@@ -118,9 +118,9 @@ nsHTMLStyle::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLStyle::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLStyleElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLStyle* it = new nsHTMLStyle(mInner.mTag);
|
||||
nsHTMLStyleElement* it = new nsHTMLStyleElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -128,12 +128,12 @@ nsHTMLStyle::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLStyle, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLStyle, Media, media, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLStyle, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLStyleElement, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLStyleElement, Media, media, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLStyleElement, Type, type, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLStyle::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLStyleElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -141,7 +141,7 @@ nsHTMLStyle::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLStyle::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLStyleElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -149,14 +149,14 @@ nsHTMLStyle::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLStyle::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLStyleElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLStyle::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLStyleElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableCaptionElementIID, NS_IDOMHTMLTABLECAPTIONELEMENT_IID);
|
||||
|
||||
class nsHTMLTableCaption : public nsIDOMHTMLTableCaptionElement,
|
||||
class nsHTMLTableCaptionElement : public nsIDOMHTMLTableCaptionElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableCaption(nsIAtom* aTag);
|
||||
~nsHTMLTableCaption();
|
||||
nsHTMLTableCaptionElement(nsIAtom* aTag);
|
||||
~nsHTMLTableCaptionElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -71,35 +71,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableCaption(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLTableCaptionElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableCaption(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLTableCaptionElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableCaption::nsHTMLTableCaption(nsIAtom* aTag)
|
||||
nsHTMLTableCaptionElement::nsHTMLTableCaptionElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableCaption::~nsHTMLTableCaption()
|
||||
nsHTMLTableCaptionElement::~nsHTMLTableCaptionElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableCaption)
|
||||
NS_IMPL_ADDREF(nsHTMLTableCaptionElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableCaption)
|
||||
NS_IMPL_RELEASE(nsHTMLTableCaptionElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCaption::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLTableCaptionElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableCaptionElementIID)) {
|
||||
@@ -112,9 +112,9 @@ nsHTMLTableCaption::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCaption::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLTableCaptionElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableCaption* it = new nsHTMLTableCaption(mInner.mTag);
|
||||
nsHTMLTableCaptionElement* it = new nsHTMLTableCaptionElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ nsHTMLTableCaption::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCaption, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCaptionElement, Align, align, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCaption::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLTableCaptionElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ nsHTMLTableCaption::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCaption::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLTableCaptionElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -143,7 +143,7 @@ nsHTMLTableCaption::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCaption::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLTableCaptionElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -151,7 +151,7 @@ nsHTMLTableCaption::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCaption::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLTableCaptionElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableCellElementIID, NS_IDOMHTMLTABLECELLELEMENT_IID);
|
||||
|
||||
class nsHTMLTableCell : public nsIDOMHTMLTableCellElement,
|
||||
class nsHTMLTableCellElement : public nsIDOMHTMLTableCellElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableCell(nsIAtom* aTag);
|
||||
~nsHTMLTableCell();
|
||||
nsHTMLTableCellElement(nsIAtom* aTag);
|
||||
~nsHTMLTableCellElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -99,35 +99,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableCell(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLTableCellElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableCell(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLTableCellElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableCell::nsHTMLTableCell(nsIAtom* aTag)
|
||||
nsHTMLTableCellElement::nsHTMLTableCellElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableCell::~nsHTMLTableCell()
|
||||
nsHTMLTableCellElement::~nsHTMLTableCellElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableCell)
|
||||
NS_IMPL_ADDREF(nsHTMLTableCellElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableCell)
|
||||
NS_IMPL_RELEASE(nsHTMLTableCellElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLTableCellElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableCellElementIID)) {
|
||||
@@ -140,9 +140,9 @@ nsHTMLTableCell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCell::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLTableCellElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableCell* it = new nsHTMLTableCell(mInner.mTag);
|
||||
nsHTMLTableCellElement* it = new nsHTMLTableCellElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -151,36 +151,36 @@ nsHTMLTableCell::CloneNode(nsIDOMNode** aReturn)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCell::GetCellIndex(PRInt32* aCellIndex)
|
||||
nsHTMLTableCellElement::GetCellIndex(PRInt32* aCellIndex)
|
||||
{
|
||||
*aCellIndex = 0;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCell::SetCellIndex(PRInt32 aCellIndex)
|
||||
nsHTMLTableCellElement::SetCellIndex(PRInt32 aCellIndex)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, Abbr, abbr, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, Axis, axis, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, Ch, ch, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, ChOff, choff, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLTableCell, ColSpan, colspan, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, Headers, headers, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, Height, height, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLTableCell, NoWrap, nowrap, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLTableCell, RowSpan, rowspan, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, Scope, scope, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCell, Width, width, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Abbr, abbr, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Axis, axis, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Ch, ch, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, ChOff, choff, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLTableCellElement, ColSpan, colspan, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Headers, headers, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Height, height, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLTableCellElement, NoWrap, nowrap, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLTableCellElement, RowSpan, rowspan, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Scope, scope, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCell::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLTableCellElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ nsHTMLTableCell::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCell::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLTableCellElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -198,7 +198,7 @@ nsHTMLTableCell::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCell::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLTableCellElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -206,7 +206,7 @@ nsHTMLTableCell::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCell::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLTableCellElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableColElementIID, NS_IDOMHTMLTABLECOLELEMENT_IID);
|
||||
|
||||
class nsHTMLTableCol : public nsIDOMHTMLTableColElement,
|
||||
class nsHTMLTableColElement : public nsIDOMHTMLTableColElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableCol(nsIAtom* aTag);
|
||||
~nsHTMLTableCol();
|
||||
nsHTMLTableColElement(nsIAtom* aTag);
|
||||
~nsHTMLTableColElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -81,35 +81,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableCol(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLTableColElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableCol(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLTableColElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableCol::nsHTMLTableCol(nsIAtom* aTag)
|
||||
nsHTMLTableColElement::nsHTMLTableColElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableCol::~nsHTMLTableCol()
|
||||
nsHTMLTableColElement::~nsHTMLTableColElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableCol)
|
||||
NS_IMPL_ADDREF(nsHTMLTableColElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableCol)
|
||||
NS_IMPL_RELEASE(nsHTMLTableColElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCol::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLTableColElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableColElementIID)) {
|
||||
@@ -122,9 +122,9 @@ nsHTMLTableCol::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCol::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLTableColElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableCol* it = new nsHTMLTableCol(mInner.mTag);
|
||||
nsHTMLTableColElement* it = new nsHTMLTableColElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -132,15 +132,15 @@ nsHTMLTableCol::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCol, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCol, Ch, ch, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCol, ChOff, choff, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLTableCol, Span, span, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCol, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCol, Width, width, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Ch, ch, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, ChOff, choff, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLTableColElement, Span, span, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCol::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLTableColElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -149,7 +149,7 @@ nsHTMLTableCol::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCol::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLTableColElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -158,7 +158,7 @@ nsHTMLTableCol::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCol::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLTableColElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -166,7 +166,7 @@ nsHTMLTableCol::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCol::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLTableColElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableElementIID, NS_IDOMHTMLTABLEELEMENT_IID);
|
||||
|
||||
class nsHTMLTable : public nsIDOMHTMLTableElement,
|
||||
class nsHTMLTableElement : public nsIDOMHTMLTableElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTable(nsIAtom* aTag);
|
||||
~nsHTMLTable();
|
||||
nsHTMLTableElement(nsIAtom* aTag);
|
||||
~nsHTMLTableElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -105,35 +105,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTable(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLTableElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTable(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLTableElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTable::nsHTMLTable(nsIAtom* aTag)
|
||||
nsHTMLTableElement::nsHTMLTableElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTable::~nsHTMLTable()
|
||||
nsHTMLTableElement::~nsHTMLTableElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTable)
|
||||
NS_IMPL_ADDREF(nsHTMLTableElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTable)
|
||||
NS_IMPL_RELEASE(nsHTMLTableElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTable::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLTableElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableElementIID)) {
|
||||
@@ -146,9 +146,9 @@ nsHTMLTable::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTable::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLTableElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTable* it = new nsHTMLTable(mInner.mTag);
|
||||
nsHTMLTableElement* it = new nsHTMLTableElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -156,135 +156,135 @@ nsHTMLTable::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTable, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTable, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTable, Border, border, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTable, CellPadding, cellpadding, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTable, CellSpacing, cellspacing, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTable, Frame, frame, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTable, Rules, rules, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTable, Summary, summary, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTable, Width, width, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Border, border, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, CellPadding, cellpadding, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, CellSpacing, cellspacing, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Frame, frame, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Rules, rules, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Summary, summary, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Width, width, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::GetCaption(nsIDOMHTMLTableCaptionElement** aValue)
|
||||
nsHTMLTableElement::GetCaption(nsIDOMHTMLTableCaptionElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::SetCaption(nsIDOMHTMLTableCaptionElement* aValue)
|
||||
nsHTMLTableElement::SetCaption(nsIDOMHTMLTableCaptionElement* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::GetTHead(nsIDOMHTMLTableSectionElement** aValue)
|
||||
nsHTMLTableElement::GetTHead(nsIDOMHTMLTableSectionElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::SetTHead(nsIDOMHTMLTableSectionElement* aValue)
|
||||
nsHTMLTableElement::SetTHead(nsIDOMHTMLTableSectionElement* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::GetTFoot(nsIDOMHTMLTableSectionElement** aValue)
|
||||
nsHTMLTableElement::GetTFoot(nsIDOMHTMLTableSectionElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::SetTFoot(nsIDOMHTMLTableSectionElement* aValue)
|
||||
nsHTMLTableElement::SetTFoot(nsIDOMHTMLTableSectionElement* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::GetRows(nsIDOMHTMLCollection** aValue)
|
||||
nsHTMLTableElement::GetRows(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::SetRows(nsIDOMHTMLCollection* aValue)
|
||||
nsHTMLTableElement::SetRows(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::GetTBodies(nsIDOMHTMLCollection** aValue)
|
||||
nsHTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::SetTBodies(nsIDOMHTMLCollection* aValue)
|
||||
nsHTMLTableElement::SetTBodies(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::CreateTHead(nsIDOMHTMLElement** aValue)
|
||||
nsHTMLTableElement::CreateTHead(nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::DeleteTHead()
|
||||
nsHTMLTableElement::DeleteTHead()
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::CreateTFoot(nsIDOMHTMLElement** aValue)
|
||||
nsHTMLTableElement::CreateTFoot(nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::DeleteTFoot()
|
||||
nsHTMLTableElement::DeleteTFoot()
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::CreateCaption(nsIDOMHTMLElement** aValue)
|
||||
nsHTMLTableElement::CreateCaption(nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::DeleteCaption()
|
||||
nsHTMLTableElement::DeleteCaption()
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
nsHTMLTableElement::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::DeleteRow(PRInt32 aValue)
|
||||
nsHTMLTableElement::DeleteRow(PRInt32 aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLTableElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -293,7 +293,7 @@ nsHTMLTable::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLTableElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -302,7 +302,7 @@ nsHTMLTable::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLTableElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -310,7 +310,7 @@ nsHTMLTable::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTable::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLTableElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableRowElementIID, NS_IDOMHTMLTABLEROWELEMENT_IID);
|
||||
|
||||
class nsHTMLTableRow : public nsIDOMHTMLTableRowElement,
|
||||
class nsHTMLTableRowElement : public nsIDOMHTMLTableRowElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableRow(nsIAtom* aTag);
|
||||
~nsHTMLTableRow();
|
||||
nsHTMLTableRowElement(nsIAtom* aTag);
|
||||
~nsHTMLTableRowElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -87,35 +87,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableRow(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLTableRowElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableRow(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLTableRowElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableRow::nsHTMLTableRow(nsIAtom* aTag)
|
||||
nsHTMLTableRowElement::nsHTMLTableRowElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableRow::~nsHTMLTableRow()
|
||||
nsHTMLTableRowElement::~nsHTMLTableRowElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableRow)
|
||||
NS_IMPL_ADDREF(nsHTMLTableRowElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableRow)
|
||||
NS_IMPL_RELEASE(nsHTMLTableRowElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableRow::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLTableRowElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableRowElementIID)) {
|
||||
@@ -128,9 +128,9 @@ nsHTMLTableRow::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableRow::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLTableRowElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableRow* it = new nsHTMLTableRow(mInner.mTag);
|
||||
nsHTMLTableRowElement* it = new nsHTMLTableRowElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -139,7 +139,7 @@ nsHTMLTableRow::CloneNode(nsIDOMNode** aReturn)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::GetRowIndex(PRInt32* aValue)
|
||||
nsHTMLTableRowElement::GetRowIndex(PRInt32* aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
@@ -147,14 +147,14 @@ nsHTMLTableRow::GetRowIndex(PRInt32* aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::SetRowIndex(PRInt32 aValue)
|
||||
nsHTMLTableRowElement::SetRowIndex(PRInt32 aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::GetSectionRowIndex(PRInt32* aValue)
|
||||
nsHTMLTableRowElement::GetSectionRowIndex(PRInt32* aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
@@ -162,14 +162,14 @@ nsHTMLTableRow::GetSectionRowIndex(PRInt32* aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::SetSectionRowIndex(PRInt32 aValue)
|
||||
nsHTMLTableRowElement::SetSectionRowIndex(PRInt32 aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::GetCells(nsIDOMHTMLCollection** aValue)
|
||||
nsHTMLTableRowElement::GetCells(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
@@ -177,14 +177,14 @@ nsHTMLTableRow::GetCells(nsIDOMHTMLCollection** aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::SetCells(nsIDOMHTMLCollection* aValue)
|
||||
nsHTMLTableRowElement::SetCells(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::InsertCell(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
nsHTMLTableRowElement::InsertCell(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
@@ -192,20 +192,20 @@ nsHTMLTableRow::InsertCell(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::DeleteCell(PRInt32 aValue)
|
||||
nsHTMLTableRowElement::DeleteCell(PRInt32 aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRow, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRow, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRow, Ch, ch, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRow, ChOff, choff, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRow, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, Ch, ch, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, ChOff, choff, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLTableRowElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -214,7 +214,7 @@ nsHTMLTableRow::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLTableRowElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -223,7 +223,7 @@ nsHTMLTableRow::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLTableRowElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -231,7 +231,7 @@ nsHTMLTableRow::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRow::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLTableRowElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableSectionElementIID, NS_IDOMHTMLTABLESECTIONELEMENT_IID);
|
||||
|
||||
class nsHTMLTableSection : public nsIDOMHTMLTableSectionElement,
|
||||
class nsHTMLTableSectionElement : public nsIDOMHTMLTableSectionElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableSection(nsIAtom* aTag);
|
||||
~nsHTMLTableSection();
|
||||
nsHTMLTableSectionElement(nsIAtom* aTag);
|
||||
~nsHTMLTableSectionElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -77,35 +77,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableSection(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLTableSectionElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableSection(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLTableSectionElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableSection::nsHTMLTableSection(nsIAtom* aTag)
|
||||
nsHTMLTableSectionElement::nsHTMLTableSectionElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableSection::~nsHTMLTableSection()
|
||||
nsHTMLTableSectionElement::~nsHTMLTableSectionElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableSection)
|
||||
NS_IMPL_ADDREF(nsHTMLTableSectionElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableSection)
|
||||
NS_IMPL_RELEASE(nsHTMLTableSectionElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableSection::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLTableSectionElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableSectionElementIID)) {
|
||||
@@ -118,9 +118,9 @@ nsHTMLTableSection::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableSection::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLTableSectionElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableSection* it = new nsHTMLTableSection(mInner.mTag);
|
||||
nsHTMLTableSectionElement* it = new nsHTMLTableSectionElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -128,11 +128,11 @@ nsHTMLTableSection::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableSection, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableSection, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSection::GetRows(nsIDOMHTMLCollection** aValue)
|
||||
nsHTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
@@ -140,14 +140,14 @@ nsHTMLTableSection::GetRows(nsIDOMHTMLCollection** aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSection::SetRows(nsIDOMHTMLCollection* aValue)
|
||||
nsHTMLTableSectionElement::SetRows(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSection::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
nsHTMLTableSectionElement::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
@@ -155,14 +155,14 @@ nsHTMLTableSection::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSection::DeleteRow(PRInt32 aIndex)
|
||||
nsHTMLTableSectionElement::DeleteRow(PRInt32 aIndex)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSection::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLTableSectionElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -171,7 +171,7 @@ nsHTMLTableSection::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSection::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLTableSectionElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -180,7 +180,7 @@ nsHTMLTableSection::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSection::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLTableSectionElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -188,7 +188,7 @@ nsHTMLTableSection::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSection::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLTableSectionElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -21,11 +21,11 @@
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsXIFConverter.h"
|
||||
|
||||
#define nsHTMLTitleSuper nsHTMLTagContent
|
||||
#define nsHTMLTitleElementSuper nsHTMLTagContent
|
||||
|
||||
class nsHTMLTitle : public nsHTMLTitleSuper {
|
||||
class nsHTMLTitleElement : public nsHTMLTitleElementSuper {
|
||||
public:
|
||||
nsHTMLTitle(nsIAtom* aTag, const nsString& aTitle);
|
||||
nsHTMLTitleElement(nsIAtom* aTag, const nsString& aTitle);
|
||||
|
||||
NS_IMETHOD CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
NS_IMETHOD FinishConvertToXIF(nsXIFConverter& aConverter) const;
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLTitle();
|
||||
virtual ~nsHTMLTitleElement();
|
||||
nsString mTitle;
|
||||
};
|
||||
|
||||
@@ -52,24 +52,24 @@ NS_NewHTMLTitle(nsIHTMLContent** aInstancePtrResult,
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTitle(aTag, aTitle);
|
||||
nsIHTMLContent* it = new nsHTMLTitleElement(aTag, aTitle);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTitle::nsHTMLTitle(nsIAtom* aTag, const nsString& aTitle)
|
||||
: nsHTMLTitleSuper(aTag), mTitle(aTitle)
|
||||
nsHTMLTitleElement::nsHTMLTitleElement(nsIAtom* aTag, const nsString& aTitle)
|
||||
: nsHTMLTitleElementSuper(aTag), mTitle(aTitle)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLTitle::~nsHTMLTitle()
|
||||
nsHTMLTitleElement::~nsHTMLTitleElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitle::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsHTMLTitleElement::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult)
|
||||
@@ -85,7 +85,7 @@ nsHTMLTitle::CreateFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitle::List(FILE* out, PRInt32 aIndent) const
|
||||
nsHTMLTitleElement::List(FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
NS_PRECONDITION(nsnull != mDocument, "bad content");
|
||||
|
||||
@@ -121,7 +121,7 @@ nsHTMLTitle::List(FILE* out, PRInt32 aIndent) const
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitle::BeginConvertToXIF(nsXIFConverter& aConverter) const
|
||||
nsHTMLTitleElement::BeginConvertToXIF(nsXIFConverter& aConverter) const
|
||||
{
|
||||
if (nsnull != mTag)
|
||||
{
|
||||
@@ -133,14 +133,14 @@ nsHTMLTitle::BeginConvertToXIF(nsXIFConverter& aConverter) const
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitle::ConvertContentToXIF(nsXIFConverter& aConverter) const
|
||||
nsHTMLTitleElement::ConvertContentToXIF(nsXIFConverter& aConverter) const
|
||||
{
|
||||
aConverter.AddContent(mTitle);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitle::FinishConvertToXIF(nsXIFConverter& aConverter) const
|
||||
nsHTMLTitleElement::FinishConvertToXIF(nsXIFConverter& aConverter) const
|
||||
{
|
||||
if (nsnull != mTag)
|
||||
{
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLUListElementIID, NS_IDOMHTMLULISTELEMENT_IID);
|
||||
|
||||
class nsHTMLUList : public nsIDOMHTMLUListElement,
|
||||
class nsHTMLUListElement : public nsIDOMHTMLUListElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLUList(nsIAtom* aTag);
|
||||
~nsHTMLUList();
|
||||
nsHTMLUListElement(nsIAtom* aTag);
|
||||
~nsHTMLUListElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -73,35 +73,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLUList(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLUListElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLUList(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLUListElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLUList::nsHTMLUList(nsIAtom* aTag)
|
||||
nsHTMLUListElement::nsHTMLUListElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLUList::~nsHTMLUList()
|
||||
nsHTMLUListElement::~nsHTMLUListElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLUList)
|
||||
NS_IMPL_ADDREF(nsHTMLUListElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLUList)
|
||||
NS_IMPL_RELEASE(nsHTMLUListElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLUList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLUListElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLUListElementIID)) {
|
||||
@@ -114,9 +114,9 @@ nsHTMLUList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLUList::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLUListElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLUList* it = new nsHTMLUList(mInner.mTag);
|
||||
nsHTMLUListElement* it = new nsHTMLUListElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -124,11 +124,11 @@ nsHTMLUList::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLUList, Compact, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLUList, Type, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLUListElement, Compact, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLUListElement, Type, compact, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLUList::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLUListElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ nsHTMLUList::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLUList::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLUListElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -146,7 +146,7 @@ nsHTMLUList::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLUList::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLUListElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -154,7 +154,7 @@ nsHTMLUList::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLUList::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLUListElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
@@ -23,101 +23,103 @@ REQUIRES=xpcom raptor js
|
||||
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
CPPSRCS= \
|
||||
nsHTMLAnchor.cpp \
|
||||
nsHTMLApplet.cpp \
|
||||
nsHTMLArea.cpp \
|
||||
nsHTMLBR.cpp \
|
||||
nsHTMLBase.cpp \
|
||||
nsHTMLBaseFont.cpp \
|
||||
nsHTMLBody.cpp \
|
||||
nsHTMLComment.cpp \
|
||||
nsHTMLDList.cpp \
|
||||
nsHTMLDel.cpp \
|
||||
nsHTMLDirectory.cpp \
|
||||
nsHTMLDiv.cpp \
|
||||
nsHTMLEmbed.cpp \
|
||||
nsHTMLFont.cpp \
|
||||
nsHTMLGenericContent.cpp \
|
||||
nsHTMLHR.cpp \
|
||||
nsHTMLHead.cpp \
|
||||
nsHTMLHeading.cpp \
|
||||
nsHTMLHtml.cpp \
|
||||
nsHTMLInput.cpp \
|
||||
nsHTMLIns.cpp \
|
||||
nsHTMLLI.cpp \
|
||||
nsHTMLLayer.cpp \
|
||||
nsHTMLLink.cpp \
|
||||
nsHTMLMap.cpp \
|
||||
nsHTMLMenu.cpp \
|
||||
nsHTMLMeta.cpp \
|
||||
nsHTMLMod.cpp \
|
||||
nsHTMLOList.cpp \
|
||||
nsHTMLObject.cpp \
|
||||
nsHTMLOption.cpp \
|
||||
nsHTMLParagraph.cpp \
|
||||
nsHTMLParam.cpp \
|
||||
nsHTMLPre.cpp \
|
||||
nsHTMLQuote.cpp \
|
||||
nsHTMLScript.cpp \
|
||||
nsHTMLStyle.cpp \
|
||||
nsHTMLTable.cpp \
|
||||
nsHTMLTableCaption.cpp \
|
||||
nsHTMLTableCell.cpp \
|
||||
nsHTMLTableCol.cpp \
|
||||
nsHTMLTableRow.cpp \
|
||||
nsHTMLTableSection.cpp \
|
||||
nsHTMLTitle.cpp \
|
||||
nsHTMLUList.cpp \
|
||||
nsObjectContent.cpp \
|
||||
nsCommentNode.cpp \
|
||||
nsGenericHTMLElement.cpp \
|
||||
nsHTMLAnchorElement.cpp \
|
||||
nsHTMLAppletElement.cpp \
|
||||
nsHTMLAreaElement.cpp \
|
||||
nsHTMLBRElement.cpp \
|
||||
nsHTMLBaseElement.cpp \
|
||||
nsHTMLBaseFontElement.cpp \
|
||||
nsHTMLBodyElement.cpp \
|
||||
nsHTMLDListElement.cpp \
|
||||
nsHTMLDelElement.cpp \
|
||||
nsHTMLDirectoryElement.cpp \
|
||||
nsHTMLDivElement.cpp \
|
||||
nsHTMLEmbedElement.cpp \
|
||||
nsHTMLFontElement.cpp \
|
||||
nsHTMLFormElement.cpp \
|
||||
nsHTMLHRElement.cpp \
|
||||
nsHTMLHeadElement.cpp \
|
||||
nsHTMLHeadingElement.cpp \
|
||||
nsHTMLHtmlElement.cpp \
|
||||
nsHTMLInputElement.cpp \
|
||||
nsHTMLInsElement.cpp \
|
||||
nsHTMLLIElement.cpp \
|
||||
nsHTMLLayerElement.cpp \
|
||||
nsHTMLLinkElement.cpp \
|
||||
nsHTMLMapElement.cpp \
|
||||
nsHTMLMenuElement.cpp \
|
||||
nsHTMLMetaElement.cpp \
|
||||
nsHTMLModElement.cpp \
|
||||
nsHTMLOListElement.cpp \
|
||||
nsHTMLObjectElement.cpp \
|
||||
nsHTMLOptionElement.cpp \
|
||||
nsHTMLParagraphElement.cpp \
|
||||
nsHTMLParamElement.cpp \
|
||||
nsHTMLPreElement.cpp \
|
||||
nsHTMLQuoteElement.cpp \
|
||||
nsHTMLScriptElement.cpp \
|
||||
nsHTMLSelectElement.cpp \
|
||||
nsHTMLStyleElement.cpp \
|
||||
nsHTMLTableElement.cpp \
|
||||
nsHTMLTableCaptionElement.cpp \
|
||||
nsHTMLTableCellElement.cpp \
|
||||
nsHTMLTableColElement.cpp \
|
||||
nsHTMLTableRowElement.cpp \
|
||||
nsHTMLTableSectionElement.cpp \
|
||||
nsHTMLTitleElement.cpp \
|
||||
nsHTMLUListElement.cpp \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsHTMLAnchor.obj \
|
||||
.\$(OBJDIR)\nsHTMLApplet.obj \
|
||||
.\$(OBJDIR)\nsHTMLArea.obj \
|
||||
.\$(OBJDIR)\nsHTMLBR.obj \
|
||||
.\$(OBJDIR)\nsHTMLBase.obj \
|
||||
.\$(OBJDIR)\nsHTMLBaseFont.obj \
|
||||
.\$(OBJDIR)\nsHTMLBody.obj \
|
||||
.\$(OBJDIR)\nsHTMLComment.obj \
|
||||
.\$(OBJDIR)\nsHTMLDList.obj \
|
||||
.\$(OBJDIR)\nsHTMLDel.obj \
|
||||
.\$(OBJDIR)\nsHTMLDirectory.obj \
|
||||
.\$(OBJDIR)\nsHTMLDiv.obj \
|
||||
.\$(OBJDIR)\nsHTMLEmbed.obj \
|
||||
.\$(OBJDIR)\nsHTMLFont.obj \
|
||||
.\$(OBJDIR)\nsHTMLGenericContent.obj \
|
||||
.\$(OBJDIR)\nsHTMLHR.obj \
|
||||
.\$(OBJDIR)\nsHTMLHead.obj \
|
||||
.\$(OBJDIR)\nsHTMLHeading.obj \
|
||||
.\$(OBJDIR)\nsHTMLHtml.obj \
|
||||
.\$(OBJDIR)\nsHTMLInput.obj \
|
||||
.\$(OBJDIR)\nsHTMLIns.obj \
|
||||
.\$(OBJDIR)\nsHTMLLI.obj \
|
||||
.\$(OBJDIR)\nsHTMLLayer.obj \
|
||||
.\$(OBJDIR)\nsHTMLLink.obj \
|
||||
.\$(OBJDIR)\nsHTMLMap.obj \
|
||||
.\$(OBJDIR)\nsHTMLMenu.obj \
|
||||
.\$(OBJDIR)\nsHTMLMeta.obj \
|
||||
.\$(OBJDIR)\nsHTMLMod.obj \
|
||||
.\$(OBJDIR)\nsHTMLOList.obj \
|
||||
.\$(OBJDIR)\nsHTMLObject.obj \
|
||||
.\$(OBJDIR)\nsHTMLOption.obj \
|
||||
.\$(OBJDIR)\nsHTMLParagraph.obj \
|
||||
.\$(OBJDIR)\nsHTMLParam.obj \
|
||||
.\$(OBJDIR)\nsHTMLPre.obj \
|
||||
.\$(OBJDIR)\nsHTMLQuote.obj \
|
||||
.\$(OBJDIR)\nsHTMLScript.obj \
|
||||
.\$(OBJDIR)\nsHTMLStyle.obj \
|
||||
.\$(OBJDIR)\nsHTMLTable.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCaption.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCell.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCol.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableRow.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableSection.obj \
|
||||
.\$(OBJDIR)\nsHTMLTitle.obj \
|
||||
.\$(OBJDIR)\nsHTMLUList.obj \
|
||||
.\$(OBJDIR)\nsObjectContent.obj \
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsCommentNode.obj \
|
||||
.\$(OBJDIR)\nsGenericHTMLElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLAnchorElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLAppletElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLAreaElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLBRElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLBaseElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLBaseFontElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLBodyElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLDListElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLDelElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLDirectoryElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLDivElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLEmbedElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLFontElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLFormElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLHRElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLHeadElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLHeadingElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLHtmlElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLInputElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLInsElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLLIElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLLayerElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLLinkElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLMapElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLMenuElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLMetaElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLModElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLOListElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLObjectElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLOptionElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLParagraphElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLParamElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLPreElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLQuoteElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLScriptElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLSelectElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLStyleElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCaptionElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableCellElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableColElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableRowElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTableSectionElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLTitleElement.obj \
|
||||
.\$(OBJDIR)\nsHTMLUListElement.obj \
|
||||
$(NULL)
|
||||
|
||||
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
#include "nsFrame.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
||||
#define nsHTMLCommentSuper nsHTMLTagContent
|
||||
// XXX rework this
|
||||
|
||||
class nsHTMLComment : public nsHTMLCommentSuper {
|
||||
#define nsCommentNodeSuper nsHTMLTagContent
|
||||
|
||||
class nsCommentNode : public nsCommentNodeSuper {
|
||||
public:
|
||||
nsHTMLComment(nsIAtom* aTag, const nsString& aComment);
|
||||
nsCommentNode(nsIAtom* aTag, const nsString& aComment);
|
||||
|
||||
NS_IMETHOD CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
@@ -34,22 +36,22 @@ public:
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLComment();
|
||||
virtual ~nsCommentNode();
|
||||
nsString mComment;
|
||||
};
|
||||
|
||||
nsHTMLComment::nsHTMLComment(nsIAtom* aTag, const nsString& aComment)
|
||||
: nsHTMLCommentSuper(aTag),
|
||||
nsCommentNode::nsCommentNode(nsIAtom* aTag, const nsString& aComment)
|
||||
: nsCommentNodeSuper(aTag),
|
||||
mComment(aComment)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLComment::~nsHTMLComment()
|
||||
nsCommentNode::~nsCommentNode()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLComment::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsCommentNode::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult)
|
||||
@@ -65,7 +67,7 @@ nsHTMLComment::CreateFrame(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLComment::List(FILE* out, PRInt32 aIndent) const
|
||||
nsCommentNode::List(FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
NS_PRECONDITION(nsnull != mDocument, "bad content");
|
||||
|
||||
@@ -90,14 +92,14 @@ nsHTMLComment::List(FILE* out, PRInt32 aIndent) const
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLComment(nsIHTMLContent** aInstancePtrResult,
|
||||
NS_NewCommentNode(nsIHTMLContent** aInstancePtrResult,
|
||||
nsIAtom* aTag, const nsString& aComment)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLComment(aTag, aComment);
|
||||
nsIHTMLContent* it = new nsCommentNode(aTag, aComment);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
2738
mozilla/layout/html/content/src/nsGenericHTMLElement.cpp
Normal file
2738
mozilla/layout/html/content/src/nsGenericHTMLElement.cpp
Normal file
File diff suppressed because it is too large
Load Diff
814
mozilla/layout/html/content/src/nsGenericHTMLElement.h
Normal file
814
mozilla/layout/html/content/src/nsGenericHTMLElement.h
Normal file
@@ -0,0 +1,814 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#ifndef nsHTMLGenericContent_h___
|
||||
#define nsHTMLGenericContent_h___
|
||||
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
extern const nsIID kIDOMNodeIID;
|
||||
extern const nsIID kIDOMElementIID;
|
||||
extern const nsIID kIDOMHTMLElementIID;
|
||||
extern const nsIID kIDOMEventReceiverIID;
|
||||
extern const nsIID kIScriptObjectOwnerIID;
|
||||
extern const nsIID kISupportsIID;
|
||||
extern const nsIID kIContentIID;
|
||||
extern const nsIID kIHTMLContentIID;
|
||||
|
||||
class nsIDOMAttribute;
|
||||
class nsIDOMEventListener;
|
||||
class nsIDOMNodeList;
|
||||
class nsIEventListenerManager;
|
||||
class nsIFrame;
|
||||
class nsIHTMLAttributes;
|
||||
class nsIHTMLContent;
|
||||
class nsIStyleContext;
|
||||
class nsIStyleRule;
|
||||
class nsISupportsArray;
|
||||
|
||||
enum nsSetAttrNotify {
|
||||
eSetAttrNotify_None = 0,
|
||||
eSetAttrNotify_Render = 1,
|
||||
eSetAttrNotify_Reflow = 2,
|
||||
eSetAttrNotify_Restart = 3
|
||||
};
|
||||
|
||||
struct nsHTMLGenericContent {
|
||||
nsHTMLGenericContent();
|
||||
~nsHTMLGenericContent();
|
||||
|
||||
void Init(nsIHTMLContent* aOuterContentObject, nsIAtom* aTag);
|
||||
|
||||
// Implementation for nsIDOMNode
|
||||
nsresult GetNodeName(nsString& aNodeName);
|
||||
nsresult GetNodeValue(nsString& aNodeValue);
|
||||
nsresult SetNodeValue(const nsString& aNodeValue);
|
||||
nsresult GetNodeType(PRInt32* aNodeType);
|
||||
nsresult GetParentNode(nsIDOMNode** aParentNode);
|
||||
nsresult GetAttributes(nsIDOMNamedNodeMap** aAttributes);
|
||||
nsresult GetPreviousSibling(nsIDOMNode** aPreviousSibling);
|
||||
nsresult GetNextSibling(nsIDOMNode** aNextSibling);
|
||||
|
||||
// Implementation for nsIDOMElement
|
||||
nsresult GetTagName(nsString& aTagName);
|
||||
nsresult GetDOMAttribute(const nsString& aName, nsString& aReturn);
|
||||
nsresult SetDOMAttribute(const nsString& aName, const nsString& aValue);
|
||||
nsresult RemoveAttribute(const nsString& aName);
|
||||
nsresult GetAttributeNode(const nsString& aName,
|
||||
nsIDOMAttribute** aReturn);
|
||||
nsresult SetAttributeNode(nsIDOMAttribute* aNewAttr);
|
||||
nsresult RemoveAttributeNode(nsIDOMAttribute* aOldAttr);
|
||||
nsresult GetElementsByTagName(const nsString& aTagname,
|
||||
nsIDOMNodeList** aReturn);
|
||||
nsresult Normalize();
|
||||
|
||||
// Implementation for nsIDOMHTMLElement
|
||||
nsresult GetId(nsString& aId);
|
||||
nsresult SetId(const nsString& aId);
|
||||
nsresult GetTitle(nsString& aTitle);
|
||||
nsresult SetTitle(const nsString& aTitle);
|
||||
nsresult GetLang(nsString& aLang);
|
||||
nsresult SetLang(const nsString& aLang);
|
||||
nsresult GetDir(nsString& aDir);
|
||||
nsresult SetDir(const nsString& aDir);
|
||||
nsresult GetClassName(nsString& aClassName);
|
||||
nsresult SetClassName(const nsString& aClassName);
|
||||
|
||||
// nsIDOMEventReceiver interface
|
||||
nsresult AddEventListener(nsIDOMEventListener *aListener, const nsIID& aIID);
|
||||
nsresult RemoveEventListener(nsIDOMEventListener* aListener,
|
||||
const nsIID& aIID);
|
||||
nsresult GetListenerManager(nsIEventListenerManager** aInstancePtrResult);
|
||||
nsresult GetNewListenerManager(nsIEventListenerManager** aInstancePtrResult);
|
||||
|
||||
// nsIScriptObjectOwner interface
|
||||
nsresult GetScriptObject(nsIScriptContext* aContext, void** aScriptObject);
|
||||
nsresult ResetScriptObject();
|
||||
|
||||
// Implementation for nsIContent
|
||||
nsresult GetDocument(nsIDocument*& aResult) const;
|
||||
nsresult SetDocument(nsIDocument* aDocument);
|
||||
nsresult GetParent(nsIContent*& aResult) const;
|
||||
nsresult SetParent(nsIContent* aParent);
|
||||
nsresult IsSynthetic(PRBool& aResult);
|
||||
nsresult GetTag(nsIAtom*& aResult) const;
|
||||
nsresult SetAttribute(const nsString& aName, const nsString& aValue,
|
||||
PRBool aNotify);
|
||||
nsresult GetAttribute(const nsString& aName, nsString& aResult) const;
|
||||
nsIContentDelegate* GetDelegate(nsIPresContext* aCX);
|
||||
nsresult List(FILE* out, PRInt32 aIndent) const;
|
||||
nsresult HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus);
|
||||
|
||||
// Implementation for nsIHTMLContent
|
||||
nsresult Compact();
|
||||
nsresult SetAttribute(nsIAtom* aAttribute, const nsString& aValue,
|
||||
PRBool aNotify);
|
||||
nsresult SetAttribute(nsIAtom* aAttribute, const nsHTMLValue& aValue,
|
||||
PRBool aNotify);
|
||||
nsresult UnsetAttribute(nsIAtom* aAttribute);
|
||||
nsresult GetAttribute(nsIAtom *aAttribute, nsString &aResult) const;
|
||||
nsresult GetAttribute(nsIAtom* aAttribute, nsHTMLValue& aValue) const;
|
||||
nsresult GetAllAttributeNames(nsISupportsArray* aArray,
|
||||
PRInt32& aCount) const;
|
||||
nsresult GetAttributeCount(PRInt32& aResult) const;
|
||||
nsresult SetID(nsIAtom* aID);
|
||||
nsresult GetID(nsIAtom*& aResult) const;
|
||||
nsresult SetClass(nsIAtom* aClass);
|
||||
nsresult GetClass(nsIAtom*& aResult) const;
|
||||
nsresult GetStyleRule(nsIStyleRule*& aResult);
|
||||
nsresult MapAttributesInto(nsIStyleContext* aStyleContext,
|
||||
nsIPresContext* aPresContext);
|
||||
nsresult ToHTMLString(nsString& aResult) const;
|
||||
nsresult ToHTML(FILE* out) const;
|
||||
nsresult CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
nsresult SetAttr(nsIAtom* aAttribute, const nsString& aValue,
|
||||
nsSetAttrNotify aNotify);
|
||||
|
||||
nsresult SetAttr(nsIAtom* aAttribute, const nsHTMLValue& aValue,
|
||||
nsSetAttrNotify aNotify);
|
||||
|
||||
nsresult AddScriptEventListener(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
REFNSIID aIID);
|
||||
|
||||
nsresult AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const;
|
||||
|
||||
void ListAttributes(FILE* out) const;
|
||||
|
||||
void TriggerLink(nsIPresContext& aPresContext,
|
||||
const nsString& aBase,
|
||||
const nsString& aURLSpec,
|
||||
const nsString& aTargetSpec,
|
||||
PRBool aClick);
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
// Attribute parsing utilities
|
||||
|
||||
struct EnumTable {
|
||||
const char* tag;
|
||||
PRInt32 value;
|
||||
};
|
||||
|
||||
static PRBool ParseEnumValue(const nsString& aValue,
|
||||
EnumTable* aTable,
|
||||
nsHTMLValue& aResult);
|
||||
|
||||
static PRBool EnumValueToString(const nsHTMLValue& aValue,
|
||||
EnumTable* aTable,
|
||||
nsString& aResult);
|
||||
|
||||
static PRBool ParseValueOrPercent(const nsString& aString,
|
||||
nsHTMLValue& aResult,
|
||||
nsHTMLUnit aValueUnit);
|
||||
|
||||
static void ParseValueOrPercentOrProportional(const nsString& aString,
|
||||
nsHTMLValue& aResult,
|
||||
nsHTMLUnit aValueUnit);
|
||||
|
||||
static PRBool ValueOrPercentToString(const nsHTMLValue& aValue,
|
||||
nsString& aResult);
|
||||
|
||||
static PRBool ParseValue(const nsString& aString, PRInt32 aMin,
|
||||
nsHTMLValue& aResult, nsHTMLUnit aValueUnit);
|
||||
|
||||
static PRBool ParseValue(const nsString& aString, PRInt32 aMin, PRInt32 aMax,
|
||||
nsHTMLValue& aResult, nsHTMLUnit aValueUnit);
|
||||
|
||||
static PRBool ParseColor(const nsString& aString, nsHTMLValue& aResult);
|
||||
|
||||
static PRBool ColorToString(const nsHTMLValue& aValue,
|
||||
nsString& aResult);
|
||||
|
||||
static PRBool ParseAlignValue(const nsString& aString, nsHTMLValue& aResult);
|
||||
|
||||
static PRBool AlignValueToString(const nsHTMLValue& aValue,
|
||||
nsString& aResult);
|
||||
|
||||
static PRBool ParseImageAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aString,
|
||||
nsHTMLValue& aResult);
|
||||
|
||||
static PRBool ImageAttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsString& aResult);
|
||||
|
||||
void MapImageAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext);
|
||||
|
||||
void MapImageAlignAttributeInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext);
|
||||
|
||||
void MapImageBorderAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext,
|
||||
nscolor aBorderColors[4]);
|
||||
|
||||
// Up pointer to the real content object that we are
|
||||
// supporting. Sometimes there is work that we just can't do
|
||||
// ourselves, so this is needed to ask the real object to do the
|
||||
// work.
|
||||
nsIHTMLContent* mContent;
|
||||
|
||||
nsIDocument* mDocument;
|
||||
nsIContent* mParent;
|
||||
nsIHTMLAttributes* mAttributes;
|
||||
nsIAtom* mTag;
|
||||
void* mScriptObject;
|
||||
nsIEventListenerManager* mListenerManager;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
struct nsHTMLGenericLeafContent : public nsHTMLGenericContent {
|
||||
nsHTMLGenericLeafContent();
|
||||
~nsHTMLGenericLeafContent();
|
||||
|
||||
nsresult CopyInnerTo(nsIHTMLContent* aSrcContent,
|
||||
nsHTMLGenericLeafContent* aDest);
|
||||
|
||||
// Remainder of nsIDOMHTMLElement (and nsIDOMNode)
|
||||
nsresult Equals(nsIDOMNode* aNode, PRBool aDeep, PRBool* aReturn);
|
||||
nsresult GetChildNodes(nsIDOMNodeList** aChildNodes) {
|
||||
*aChildNodes = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult GetHasChildNodes(PRBool* aHasChildNodes) {
|
||||
*aHasChildNodes = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult GetFirstChild(nsIDOMNode** aFirstChild) {
|
||||
*aFirstChild = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult GetLastChild(nsIDOMNode** aLastChild) {
|
||||
*aLastChild = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
|
||||
nsIDOMNode** aReturn) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsresult ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild,
|
||||
nsIDOMNode** aReturn) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsresult RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsresult AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Remainder of nsIHTMLContent (and nsIContent)
|
||||
nsresult SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
nsresult BeginConvertToXIF(nsXIFConverter& aConverter) const;
|
||||
nsresult ConvertContentToXIF(nsXIFConverter& aConverter) const;
|
||||
nsresult FinishConvertToXIF(nsXIFConverter& aConverter) const;
|
||||
nsresult Compact() {
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult CanContainChildren(PRBool& aResult) const {
|
||||
aResult = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult ChildCount(PRInt32& aResult) const {
|
||||
aResult = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult ChildAt(PRInt32 aIndex, nsIContent*& aResult) const {
|
||||
aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult IndexOf(nsIContent* aPossibleChild, PRInt32& aResult) const {
|
||||
aResult = -1;
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult InsertChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult RemoveChildAt(PRInt32 aIndex, PRBool aNotify) {
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
struct nsHTMLGenericContainerContent : public nsHTMLGenericContent {
|
||||
nsHTMLGenericContainerContent();
|
||||
~nsHTMLGenericContainerContent();
|
||||
|
||||
nsresult CopyInnerTo(nsIHTMLContent* aSrcContent,
|
||||
nsHTMLGenericContainerContent* aDest);
|
||||
|
||||
// Remainder of nsIDOMHTMLElement (and nsIDOMNode)
|
||||
nsresult Equals(nsIDOMNode* aNode, PRBool aDeep, PRBool* aReturn);
|
||||
nsresult GetChildNodes(nsIDOMNodeList** aChildNodes);
|
||||
nsresult GetHasChildNodes(PRBool* aHasChildNodes);
|
||||
nsresult GetFirstChild(nsIDOMNode** aFirstChild);
|
||||
nsresult GetLastChild(nsIDOMNode** aLastChild);
|
||||
nsresult InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
|
||||
nsIDOMNode** aReturn);
|
||||
nsresult ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild,
|
||||
nsIDOMNode** aReturn);
|
||||
nsresult RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn);
|
||||
nsresult AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn);
|
||||
|
||||
// Remainder of nsIHTMLContent (and nsIContent)
|
||||
nsresult SizeOf(nsISizeOfHandler* aHandler) const;
|
||||
nsresult BeginConvertToXIF(nsXIFConverter& aConverter) const;
|
||||
nsresult ConvertContentToXIF(nsXIFConverter& aConverter) const;
|
||||
nsresult FinishConvertToXIF(nsXIFConverter& aConverter) const;
|
||||
nsresult Compact();
|
||||
nsresult CanContainChildren(PRBool& aResult) const;
|
||||
nsresult ChildCount(PRInt32& aResult) const;
|
||||
nsresult ChildAt(PRInt32 aIndex, nsIContent*& aResult) const;
|
||||
nsresult IndexOf(nsIContent* aPossibleChild, PRInt32& aResult) const;
|
||||
nsresult InsertChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify);
|
||||
nsresult ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify);
|
||||
nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify);
|
||||
nsresult RemoveChildAt(PRInt32 aIndex, PRBool aNotify);
|
||||
|
||||
nsVoidArray mChildren;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Mostly implement the nsIDOMNode API by forwarding the methods to a
|
||||
* generic content object (either nsHTMLGenericLeafContent or
|
||||
* nsHTMLGenericContainerContent)
|
||||
*
|
||||
* Note that classes using this macro will need to implement:
|
||||
* NS_IMETHOD CloneNode(nsIDOMNode** aReturn);
|
||||
*/
|
||||
#define NS_IMPL_IDOMNODE_USING_GENERIC(_g) \
|
||||
NS_IMETHOD GetNodeName(nsString& aNodeName) { \
|
||||
return _g.GetNodeName(aNodeName); \
|
||||
} \
|
||||
NS_IMETHOD GetNodeValue(nsString& aNodeValue) { \
|
||||
return _g.GetNodeValue(aNodeValue); \
|
||||
} \
|
||||
NS_IMETHOD SetNodeValue(const nsString& aNodeValue) { \
|
||||
return _g.SetNodeValue(aNodeValue); \
|
||||
} \
|
||||
NS_IMETHOD GetNodeType(PRInt32* aNodeType) { \
|
||||
return _g.GetNodeType(aNodeType); \
|
||||
} \
|
||||
NS_IMETHOD GetParentNode(nsIDOMNode** aParentNode) { \
|
||||
return _g.GetParentNode(aParentNode); \
|
||||
} \
|
||||
NS_IMETHOD GetChildNodes(nsIDOMNodeList** aChildNodes) { \
|
||||
return _g.GetChildNodes(aChildNodes); \
|
||||
} \
|
||||
NS_IMETHOD GetHasChildNodes(PRBool* aHasChildNodes) { \
|
||||
return _g.GetHasChildNodes(aHasChildNodes); \
|
||||
} \
|
||||
NS_IMETHOD GetFirstChild(nsIDOMNode** aFirstChild) { \
|
||||
return _g.GetFirstChild(aFirstChild); \
|
||||
} \
|
||||
NS_IMETHOD GetLastChild(nsIDOMNode** aLastChild) { \
|
||||
return _g.GetLastChild(aLastChild); \
|
||||
} \
|
||||
NS_IMETHOD GetPreviousSibling(nsIDOMNode** aPreviousSibling) { \
|
||||
return _g.GetPreviousSibling(aPreviousSibling); \
|
||||
} \
|
||||
NS_IMETHOD GetNextSibling(nsIDOMNode** aNextSibling) { \
|
||||
return _g.GetNextSibling(aNextSibling); \
|
||||
} \
|
||||
NS_IMETHOD GetAttributes(nsIDOMNamedNodeMap** aAttributes) { \
|
||||
return _g.GetAttributes(aAttributes); \
|
||||
} \
|
||||
NS_IMETHOD InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild, \
|
||||
nsIDOMNode** aReturn) { \
|
||||
return _g.InsertBefore(aNewChild, aRefChild, aReturn); \
|
||||
} \
|
||||
NS_IMETHOD AppendChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn) { \
|
||||
return _g.AppendChild(aOldChild, aReturn); \
|
||||
} \
|
||||
NS_IMETHOD ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild, \
|
||||
nsIDOMNode** aReturn) { \
|
||||
return _g.ReplaceChild(aNewChild, aOldChild, aReturn); \
|
||||
} \
|
||||
NS_IMETHOD RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn) { \
|
||||
return _g.RemoveChild(aOldChild, aReturn); \
|
||||
} \
|
||||
NS_IMETHOD Equals(nsIDOMNode* aNode, PRBool aDeep, PRBool* aReturn) { \
|
||||
return _g.Equals(aNode, aDeep, aReturn); \
|
||||
} \
|
||||
NS_IMETHOD CloneNode(nsIDOMNode** aReturn);
|
||||
|
||||
/**
|
||||
* Implement the nsIDOMElement API by forwarding the methods to a
|
||||
* generic content object (either nsHTMLGenericLeafContent or
|
||||
* nsHTMLGenericContainerContent)
|
||||
*/
|
||||
#define NS_IMPL_IDOMELEMENT_USING_GENERIC(_g) \
|
||||
NS_IMETHOD GetTagName(nsString& aTagName) { \
|
||||
return _g.GetTagName(aTagName); \
|
||||
} \
|
||||
NS_IMETHOD GetDOMAttribute(const nsString& aName, nsString& aReturn) { \
|
||||
return _g.GetDOMAttribute(aName, aReturn); \
|
||||
} \
|
||||
NS_IMETHOD SetDOMAttribute(const nsString& aName, const nsString& aValue) { \
|
||||
return _g.SetDOMAttribute(aName, aValue); \
|
||||
} \
|
||||
NS_IMETHOD RemoveAttribute(const nsString& aName) { \
|
||||
return _g.RemoveAttribute(aName); \
|
||||
} \
|
||||
NS_IMETHOD GetAttributeNode(const nsString& aName, \
|
||||
nsIDOMAttribute** aReturn) { \
|
||||
return _g.GetAttributeNode(aName, aReturn); \
|
||||
} \
|
||||
NS_IMETHOD SetAttributeNode(nsIDOMAttribute* aNewAttr) { \
|
||||
return _g.SetAttributeNode(aNewAttr); \
|
||||
} \
|
||||
NS_IMETHOD RemoveAttributeNode(nsIDOMAttribute* aOldAttr) { \
|
||||
return _g.RemoveAttributeNode(aOldAttr); \
|
||||
} \
|
||||
NS_IMETHOD GetElementsByTagName(const nsString& aTagname, \
|
||||
nsIDOMNodeList** aReturn) { \
|
||||
return _g.GetElementsByTagName(aTagname, aReturn); \
|
||||
} \
|
||||
NS_IMETHOD Normalize() { \
|
||||
return _g.Normalize(); \
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement the nsIDOMHTMLElement API by forwarding the methods to a
|
||||
* generic content object (either nsHTMLGenericLeafContent or
|
||||
* nsHTMLGenericContainerContent)
|
||||
*/
|
||||
#define NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(_g) \
|
||||
NS_IMETHOD GetId(nsString& aId) { \
|
||||
return _g.GetId(aId); \
|
||||
} \
|
||||
NS_IMETHOD SetId(const nsString& aId) { \
|
||||
return _g.SetId(aId); \
|
||||
} \
|
||||
NS_IMETHOD GetTitle(nsString& aTitle) { \
|
||||
return _g.GetTitle(aTitle); \
|
||||
} \
|
||||
NS_IMETHOD SetTitle(const nsString& aTitle) { \
|
||||
return _g.SetTitle(aTitle); \
|
||||
} \
|
||||
NS_IMETHOD GetLang(nsString& aLang) { \
|
||||
return _g.GetLang(aLang); \
|
||||
} \
|
||||
NS_IMETHOD SetLang(const nsString& aLang) { \
|
||||
return _g.SetLang(aLang); \
|
||||
} \
|
||||
NS_IMETHOD GetDir(nsString& aDir) { \
|
||||
return _g.GetDir(aDir); \
|
||||
} \
|
||||
NS_IMETHOD SetDir(const nsString& aDir) { \
|
||||
return _g.SetDir(aDir); \
|
||||
} \
|
||||
NS_IMETHOD GetClassName(nsString& aClassName) { \
|
||||
return _g.GetClassName(aClassName); \
|
||||
} \
|
||||
NS_IMETHOD SetClassName(const nsString& aClassName) { \
|
||||
return _g.SetClassName(aClassName); \
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement the nsIDOMEventReceiver API by forwarding the methods to a
|
||||
* generic content object (either nsHTMLGenericLeafContent or
|
||||
* nsHTMLGenericContainerContent)
|
||||
*/
|
||||
#define NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(_g) \
|
||||
NS_IMETHOD AddEventListener(nsIDOMEventListener *aListener, \
|
||||
const nsIID& aIID) { \
|
||||
return _g.AddEventListener(aListener, aIID); \
|
||||
} \
|
||||
NS_IMETHOD RemoveEventListener(nsIDOMEventListener *aListener, \
|
||||
const nsIID& aIID) { \
|
||||
return _g.RemoveEventListener(aListener, aIID); \
|
||||
} \
|
||||
NS_IMETHOD GetListenerManager(nsIEventListenerManager** aResult) { \
|
||||
return _g.GetListenerManager(aResult); \
|
||||
} \
|
||||
NS_IMETHOD GetNewListenerManager(nsIEventListenerManager** aResult) { \
|
||||
return _g.GetNewListenerManager(aResult); \
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement the nsIScriptObjectOwner API by forwarding the methods to a
|
||||
* generic content object (either nsHTMLGenericLeafContent or
|
||||
* nsHTMLGenericContainerContent)
|
||||
*/
|
||||
#define NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(_g) \
|
||||
NS_IMETHOD GetScriptObject(nsIScriptContext* aContext, \
|
||||
void** aScriptObject) { \
|
||||
return _g.GetScriptObject(aContext, aScriptObject); \
|
||||
} \
|
||||
NS_IMETHOD ResetScriptObject() { \
|
||||
return _g.ResetScriptObject(); \
|
||||
}
|
||||
|
||||
#define NS_IMPL_ICONTENT_USING_GENERIC(_g) \
|
||||
NS_IMETHOD GetDocument(nsIDocument*& aResult) const { \
|
||||
return _g.GetDocument(aResult); \
|
||||
} \
|
||||
NS_IMETHOD SetDocument(nsIDocument* aDocument) { \
|
||||
return _g.SetDocument(aDocument); \
|
||||
} \
|
||||
NS_IMETHOD GetParent(nsIContent*& aResult) const { \
|
||||
return _g.GetParent(aResult); \
|
||||
} \
|
||||
NS_IMETHOD SetParent(nsIContent* aParent) { \
|
||||
return _g.SetParent(aParent); \
|
||||
} \
|
||||
NS_IMETHOD CanContainChildren(PRBool& aResult) const { \
|
||||
return _g.CanContainChildren(aResult); \
|
||||
} \
|
||||
NS_IMETHOD ChildCount(PRInt32& aResult) const { \
|
||||
return _g.ChildCount(aResult); \
|
||||
} \
|
||||
NS_IMETHOD ChildAt(PRInt32 aIndex, nsIContent*& aResult) const { \
|
||||
return _g.ChildAt(aIndex, aResult); \
|
||||
} \
|
||||
NS_IMETHOD IndexOf(nsIContent* aPossibleChild, PRInt32& aResult) const { \
|
||||
return _g.IndexOf(aPossibleChild, aResult); \
|
||||
} \
|
||||
NS_IMETHOD InsertChildAt(nsIContent* aKid, PRInt32 aIndex, \
|
||||
PRBool aNotify) { \
|
||||
return _g.InsertChildAt(aKid, aIndex, aNotify); \
|
||||
} \
|
||||
NS_IMETHOD ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex, \
|
||||
PRBool aNotify) { \
|
||||
return _g.ReplaceChildAt(aKid, aIndex, aNotify); \
|
||||
} \
|
||||
NS_IMETHOD AppendChildTo(nsIContent* aKid, PRBool aNotify) { \
|
||||
return _g.AppendChildTo(aKid, aNotify); \
|
||||
} \
|
||||
NS_IMETHOD RemoveChildAt(PRInt32 aIndex, PRBool aNotify) { \
|
||||
return _g.RemoveChildAt(aIndex, aNotify); \
|
||||
} \
|
||||
NS_IMETHOD IsSynthetic(PRBool& aResult) { \
|
||||
return _g.IsSynthetic(aResult); \
|
||||
} \
|
||||
NS_IMETHOD GetTag(nsIAtom*& aResult) const { \
|
||||
return _g.GetTag(aResult); \
|
||||
} \
|
||||
NS_IMETHOD SetAttribute(const nsString& aName, const nsString& aValue, \
|
||||
PRBool aNotify) { \
|
||||
return _g.SetAttribute(aName, aValue, aNotify); \
|
||||
} \
|
||||
NS_IMETHOD GetAttribute(const nsString& aName, \
|
||||
nsString& aResult) const { \
|
||||
return _g.GetAttribute(aName, aResult); \
|
||||
} \
|
||||
virtual nsIContentDelegate* GetDelegate(nsIPresContext* aCX) { \
|
||||
return _g.GetDelegate(aCX); \
|
||||
} \
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const { \
|
||||
return _g.List(out, aIndent); \
|
||||
} \
|
||||
NS_IMETHOD BeginConvertToXIF(nsXIFConverter& aConverter) const { \
|
||||
return _g.BeginConvertToXIF(aConverter); \
|
||||
} \
|
||||
NS_IMETHOD ConvertContentToXIF(nsXIFConverter& aConverter) const { \
|
||||
return _g.ConvertContentToXIF(aConverter); \
|
||||
} \
|
||||
NS_IMETHOD FinishConvertToXIF(nsXIFConverter& aConverter) const { \
|
||||
return _g.FinishConvertToXIF(aConverter); \
|
||||
} \
|
||||
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler) const { \
|
||||
return _g.SizeOf(aHandler); \
|
||||
} \
|
||||
NS_IMETHOD HandleDOMEvent(nsIPresContext& aPresContext, \
|
||||
nsEvent* aEvent, \
|
||||
nsIDOMEvent** aDOMEvent, \
|
||||
PRUint32 aFlags, \
|
||||
nsEventStatus& aEventStatus);
|
||||
|
||||
#define NS_IMPL_IHTMLCONTENT_USING_GENERIC(_g) \
|
||||
NS_IMETHOD Compact() { \
|
||||
return _g.Compact(); \
|
||||
} \
|
||||
NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aValue, \
|
||||
PRBool aNotify) { \
|
||||
return _g.SetAttribute(aAttribute, aValue, aNotify); \
|
||||
} \
|
||||
NS_IMETHOD SetAttribute(nsIAtom* aAttribute, \
|
||||
const nsHTMLValue& aValue, PRBool aNotify) { \
|
||||
return _g.SetAttribute(aAttribute, aValue, aNotify); \
|
||||
} \
|
||||
NS_IMETHOD UnsetAttribute(nsIAtom* aAttribute) { \
|
||||
return _g.UnsetAttribute(aAttribute); \
|
||||
} \
|
||||
NS_IMETHOD GetAttribute(nsIAtom *aAttribute, \
|
||||
nsString &aResult) const { \
|
||||
return _g.GetAttribute(aAttribute, aResult); \
|
||||
} \
|
||||
NS_IMETHOD GetAttribute(nsIAtom* aAttribute, \
|
||||
nsHTMLValue& aValue) const { \
|
||||
return _g.GetAttribute(aAttribute, aValue); \
|
||||
} \
|
||||
NS_IMETHOD GetAllAttributeNames(nsISupportsArray* aArray, \
|
||||
PRInt32& aResult) const { \
|
||||
return _g.GetAllAttributeNames(aArray, aResult); \
|
||||
} \
|
||||
NS_IMETHOD GetAttributeCount(PRInt32& aResult) const { \
|
||||
return _g.GetAttributeCount(aResult); \
|
||||
} \
|
||||
NS_IMETHOD SetID(nsIAtom* aID) { \
|
||||
return _g.SetID(aID); \
|
||||
} \
|
||||
NS_IMETHOD GetID(nsIAtom*& aResult) const { \
|
||||
return _g.GetID(aResult); \
|
||||
} \
|
||||
NS_IMETHOD SetClass(nsIAtom* aClass) { \
|
||||
return _g.SetClass(aClass); \
|
||||
} \
|
||||
NS_IMETHOD GetClass(nsIAtom*& aResult) const { \
|
||||
return _g.GetClass(aResult); \
|
||||
} \
|
||||
NS_IMETHOD GetStyleRule(nsIStyleRule*& aResult) { \
|
||||
return _g.GetStyleRule(aResult); \
|
||||
} \
|
||||
NS_IMETHOD ToHTMLString(nsString& aResult) const { \
|
||||
return _g.ToHTMLString(aResult); \
|
||||
} \
|
||||
NS_IMETHOD ToHTML(FILE* out) const { \
|
||||
return _g.ToHTML(out); \
|
||||
} \
|
||||
NS_IMETHOD CreateFrame(nsIPresContext* aPresContext, \
|
||||
nsIFrame* aParentFrame, \
|
||||
nsIStyleContext* aStyleContext, \
|
||||
nsIFrame*& aResult) { \
|
||||
return _g.CreateFrame(aPresContext, aParentFrame, aStyleContext, \
|
||||
aResult); \
|
||||
} \
|
||||
NS_IMETHOD StringToAttribute(nsIAtom* aAttribute, \
|
||||
const nsString& aValue, \
|
||||
nsHTMLValue& aResult); \
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute, \
|
||||
nsHTMLValue& aValue, \
|
||||
nsString& aResult) const; \
|
||||
NS_IMETHOD MapAttributesInto(nsIStyleContext* aContext, \
|
||||
nsIPresContext* aPresContext);
|
||||
|
||||
/**
|
||||
* This macro implements the portion of query interface that is
|
||||
* generic to all html content objects.
|
||||
*/
|
||||
#define NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(_id, _iptr, _this) \
|
||||
if (_id.Equals(kISupportsIID)) { \
|
||||
nsIHTMLContent* tmp = _this; \
|
||||
nsISupports* tmp2 = tmp; \
|
||||
*_iptr = (void*) tmp2; \
|
||||
AddRef(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMNodeIID)) { \
|
||||
nsIDOMNode* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
AddRef(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMElementIID)) { \
|
||||
nsIDOMElement* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
AddRef(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMHTMLElementIID)) { \
|
||||
nsIDOMHTMLElement* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
AddRef(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIDOMEventReceiverIID)) { \
|
||||
nsIDOMEventReceiver* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
AddRef(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIScriptObjectOwnerIID)) { \
|
||||
nsIScriptObjectOwner* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
AddRef(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIContentIID)) { \
|
||||
nsIContent* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
AddRef(); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
if (_id.Equals(kIHTMLContentIID)) { \
|
||||
nsIHTMLContent* tmp = _this; \
|
||||
*_iptr = (void*) tmp; \
|
||||
AddRef(); \
|
||||
return NS_OK; \
|
||||
}
|
||||
|
||||
/**
|
||||
* A macro to implement the getter and setter for a given string
|
||||
* valued content property. The method uses the generic SetAttr and
|
||||
* GetAttribute methods.
|
||||
*/
|
||||
#define NS_IMPL_STRING_ATTR(_class, _method, _atom, _notify) \
|
||||
NS_IMETHODIMP \
|
||||
_class::Get##_method(nsString& aValue) \
|
||||
{ \
|
||||
mInner.GetAttribute(nsHTMLAtoms::_atom, aValue); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHODIMP \
|
||||
_class::Set##_method(const nsString& aValue) \
|
||||
{ \
|
||||
return mInner.SetAttr(nsHTMLAtoms::_atom, aValue, _notify); \
|
||||
}
|
||||
|
||||
/**
|
||||
* A macro to implement the getter and setter for a given boolean
|
||||
* valued content property. The method uses the generic SetAttr and
|
||||
* GetAttribute methods.
|
||||
*/
|
||||
#define NS_IMPL_BOOL_ATTR(_class, _method, _atom, _notify) \
|
||||
NS_IMETHODIMP \
|
||||
_class::Get##_method(PRBool* aValue) \
|
||||
{ \
|
||||
nsHTMLValue val; \
|
||||
nsresult rv = mInner.GetAttribute(nsHTMLAtoms::_atom, val); \
|
||||
*aValue = NS_CONTENT_ATTR_NOT_THERE != rv; \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHODIMP \
|
||||
_class::Set##_method(PRBool aValue) \
|
||||
{ \
|
||||
nsAutoString empty; \
|
||||
if (aValue) { \
|
||||
return mInner.SetAttr(nsHTMLAtoms::_atom, empty, _notify); \
|
||||
} \
|
||||
else { \
|
||||
mInner.UnsetAttribute(nsHTMLAtoms::_atom); \
|
||||
return NS_OK; \
|
||||
} \
|
||||
}
|
||||
|
||||
/**
|
||||
* A macro to implement the getter and setter for a given integer
|
||||
* valued content property. The method uses the generic SetAttr and
|
||||
* GetAttribute methods.
|
||||
*/
|
||||
#define NS_IMPL_INT_ATTR(_class, _method, _atom, _notify) \
|
||||
NS_IMETHODIMP \
|
||||
_class::Get##_method(PRInt32* aValue) \
|
||||
{ \
|
||||
nsHTMLValue value; \
|
||||
*aValue = -1; \
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == \
|
||||
mInner.GetAttribute(nsHTMLAtoms::_atom, value)) { \
|
||||
if (value.GetUnit() == eHTMLUnit_Integer) { \
|
||||
*aValue = value.GetIntValue(); \
|
||||
} \
|
||||
} \
|
||||
return NS_OK; \
|
||||
} \
|
||||
NS_IMETHODIMP \
|
||||
_class::Set##_method(PRInt32 aValue) \
|
||||
{ \
|
||||
nsHTMLValue value(aValue, eHTMLUnit_Integer); \
|
||||
return mInner.SetAttr(nsHTMLAtoms::_atom, value, _notify); \
|
||||
}
|
||||
|
||||
#endif /* nsHTMLLeafContent_h___ */
|
||||
295
mozilla/layout/html/content/src/nsHTMLAnchorElement.cpp
Normal file
295
mozilla/layout/html/content/src/nsHTMLAnchorElement.cpp
Normal file
@@ -0,0 +1,295 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsDOMEvent.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLAnchorElementIID, NS_IDOMHTMLANCHORELEMENT_IID);
|
||||
|
||||
class nsHTMLAnchorElement : public nsIDOMHTMLAnchorElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLAnchorElement(nsIAtom* aTag);
|
||||
~nsHTMLAnchorElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLAnchorElement
|
||||
NS_IMETHOD GetAccessKey(nsString& aAccessKey);
|
||||
NS_IMETHOD SetAccessKey(const nsString& aAccessKey);
|
||||
NS_IMETHOD GetCharset(nsString& aCharset);
|
||||
NS_IMETHOD SetCharset(const nsString& aCharset);
|
||||
NS_IMETHOD GetCoords(nsString& aCoords);
|
||||
NS_IMETHOD SetCoords(const nsString& aCoords);
|
||||
NS_IMETHOD GetHref(nsString& aHref);
|
||||
NS_IMETHOD SetHref(const nsString& aHref);
|
||||
NS_IMETHOD GetHreflang(nsString& aHreflang);
|
||||
NS_IMETHOD SetHreflang(const nsString& aHreflang);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetRel(nsString& aRel);
|
||||
NS_IMETHOD SetRel(const nsString& aRel);
|
||||
NS_IMETHOD GetRev(nsString& aRev);
|
||||
NS_IMETHOD SetRev(const nsString& aRev);
|
||||
NS_IMETHOD GetShape(nsString& aShape);
|
||||
NS_IMETHOD SetShape(const nsString& aShape);
|
||||
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
||||
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
||||
NS_IMETHOD GetTarget(nsString& aTarget);
|
||||
NS_IMETHOD SetTarget(const nsString& aTarget);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
NS_IMETHOD Blur();
|
||||
NS_IMETHOD Focus();
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLAnchorElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLAnchorElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLAnchorElement::nsHTMLAnchorElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLAnchorElement::~nsHTMLAnchorElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLAnchorElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLAnchorElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLAnchorElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLAnchorElementIID)) {
|
||||
nsIDOMHTMLAnchorElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLAnchorElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLAnchorElement* it = new nsHTMLAnchorElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, AccessKey, accesskey, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Charset, charset, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Coords, coords, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Href, href, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Hreflang, hreflang, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Rel, rel, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Rev, rev, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Shape, shape, eSetAttrNotify_None)
|
||||
NS_IMPL_INT_ATTR(nsHTMLAnchorElement, TabIndex, tabindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Target, target, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Type, type, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchorElement::Blur()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchorElement::Focus()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchorElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::tabindex) {
|
||||
nsHTMLGenericContent::ParseValue(aValue, 0, 32767, aResult,
|
||||
eHTMLUnit_Integer);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchorElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchorElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAnchorElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
// Try script event handlers first
|
||||
nsresult ret = mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
|
||||
if ((NS_OK == ret) && (nsEventStatus_eIgnore == aEventStatus)) {
|
||||
switch (aEvent->message) {
|
||||
case NS_MOUSE_LEFT_BUTTON_DOWN:
|
||||
{
|
||||
nsIEventStateManager *stateManager;
|
||||
if (NS_OK == aPresContext.GetEventStateManager(&stateManager)) {
|
||||
stateManager->SetActiveLink(this);
|
||||
NS_RELEASE(stateManager);
|
||||
}
|
||||
aEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
break;
|
||||
|
||||
case NS_MOUSE_LEFT_BUTTON_UP:
|
||||
{
|
||||
nsIEventStateManager *stateManager;
|
||||
nsIContent *activeLink;
|
||||
if (NS_OK == aPresContext.GetEventStateManager(&stateManager)) {
|
||||
stateManager->GetActiveLink(&activeLink);
|
||||
NS_RELEASE(stateManager);
|
||||
}
|
||||
|
||||
if (activeLink == this) {
|
||||
nsEventStatus status;
|
||||
nsMouseEvent event;
|
||||
event.eventStructType = NS_MOUSE_EVENT;
|
||||
event.message = NS_MOUSE_LEFT_CLICK;
|
||||
HandleDOMEvent(aPresContext, &event, nsnull, DOM_EVENT_INIT, status);
|
||||
|
||||
if (nsEventStatus_eConsumeNoDefault != status) {
|
||||
nsAutoString base, href, target;
|
||||
GetAttribute(nsString(NS_HTML_BASE_HREF), base);
|
||||
GetAttribute(nsString("href"), href);
|
||||
GetAttribute(nsString("target"), target);
|
||||
if (target.Length() == 0) {
|
||||
GetAttribute(nsString(NS_HTML_BASE_TARGET), target);
|
||||
}
|
||||
mInner.TriggerLink(aPresContext, base, href, target, PR_TRUE);
|
||||
aEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case NS_MOUSE_RIGHT_BUTTON_DOWN:
|
||||
// XXX Bring up a contextual menu provided by the application
|
||||
break;
|
||||
|
||||
case NS_MOUSE_ENTER:
|
||||
//mouse enter doesn't work yet. Use move until then.
|
||||
{
|
||||
nsAutoString base, href, target;
|
||||
GetAttribute(nsString(NS_HTML_BASE_HREF), base);
|
||||
GetAttribute(nsString("href"), href);
|
||||
GetAttribute(nsString("target"), target);
|
||||
if (target.Length() == 0) {
|
||||
GetAttribute(nsString(NS_HTML_BASE_TARGET), target);
|
||||
}
|
||||
mInner.TriggerLink(aPresContext, base, href, target, PR_FALSE);
|
||||
aEventStatus = nsEventStatus_eConsumeDoDefault;
|
||||
}
|
||||
break;
|
||||
|
||||
// XXX this doesn't seem to do anything yet
|
||||
case NS_MOUSE_EXIT:
|
||||
{
|
||||
nsAutoString empty;
|
||||
mInner.TriggerLink(aPresContext, empty, empty, empty, PR_FALSE);
|
||||
aEventStatus = nsEventStatus_eConsumeDoDefault;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
211
mozilla/layout/html/content/src/nsHTMLAppletElement.cpp
Normal file
211
mozilla/layout/html/content/src/nsHTMLAppletElement.cpp
Normal file
@@ -0,0 +1,211 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLAppletElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLAppletElementIID, NS_IDOMHTMLAPPLETELEMENT_IID);
|
||||
|
||||
class nsHTMLAppletElement : public nsIDOMHTMLAppletElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLAppletElement(nsIAtom* aTag);
|
||||
~nsHTMLAppletElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLAppletElement
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetAlt(nsString& aAlt);
|
||||
NS_IMETHOD SetAlt(const nsString& aAlt);
|
||||
NS_IMETHOD GetArchive(nsString& aArchive);
|
||||
NS_IMETHOD SetArchive(const nsString& aArchive);
|
||||
NS_IMETHOD GetCode(nsString& aCode);
|
||||
NS_IMETHOD SetCode(const nsString& aCode);
|
||||
NS_IMETHOD GetCodeBase(nsString& aCodeBase);
|
||||
NS_IMETHOD SetCodeBase(const nsString& aCodeBase);
|
||||
NS_IMETHOD GetHeight(nsString& aHeight);
|
||||
NS_IMETHOD SetHeight(const nsString& aHeight);
|
||||
NS_IMETHOD GetHspace(nsString& aHspace);
|
||||
NS_IMETHOD SetHspace(const nsString& aHspace);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetObject(nsString& aObject);
|
||||
NS_IMETHOD SetObject(const nsString& aObject);
|
||||
NS_IMETHOD GetVspace(nsString& aVspace);
|
||||
NS_IMETHOD SetVspace(const nsString& aVspace);
|
||||
NS_IMETHOD GetWidth(nsString& aWidth);
|
||||
NS_IMETHOD SetWidth(const nsString& aWidth);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLAppletElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLAppletElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLAppletElement::nsHTMLAppletElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLAppletElement::~nsHTMLAppletElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLAppletElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLAppletElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLAppletElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLAppletElementIID)) {
|
||||
nsIDOMHTMLAppletElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLAppletElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLAppletElement* it = new nsHTMLAppletElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Alt, alt, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Archive, archive, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Code, code, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, CodeBase, codebase, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Height, height, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Hspace, hspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Object, object, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Vspace, vspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAppletElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ParseImageAttribute(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAppletElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ImageAttributeToString(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAppletElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
mInner.MapImageAlignAttributeInto(aContext, aPresContext);
|
||||
mInner.MapImageAttributesInto(aContext, aPresContext);
|
||||
mInner.MapImageBorderAttributesInto(aContext, aPresContext, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAppletElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
180
mozilla/layout/html/content/src/nsHTMLAreaElement.cpp
Normal file
180
mozilla/layout/html/content/src/nsHTMLAreaElement.cpp
Normal file
@@ -0,0 +1,180 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLAreaElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLAreaElementIID, NS_IDOMHTMLAREAELEMENT_IID);
|
||||
|
||||
class nsHTMLAreaElement : public nsIDOMHTMLAreaElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLAreaElement(nsIAtom* aTag);
|
||||
~nsHTMLAreaElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLAreaElement
|
||||
NS_IMETHOD GetAccessKey(nsString& aAccessKey);
|
||||
NS_IMETHOD SetAccessKey(const nsString& aAccessKey);
|
||||
NS_IMETHOD GetAlt(nsString& aAlt);
|
||||
NS_IMETHOD SetAlt(const nsString& aAlt);
|
||||
NS_IMETHOD GetCoords(nsString& aCoords);
|
||||
NS_IMETHOD SetCoords(const nsString& aCoords);
|
||||
NS_IMETHOD GetHref(nsString& aHref);
|
||||
NS_IMETHOD SetHref(const nsString& aHref);
|
||||
NS_IMETHOD GetNoHref(PRBool* aNoHref);
|
||||
NS_IMETHOD SetNoHref(PRBool aNoHref);
|
||||
NS_IMETHOD GetShape(nsString& aShape);
|
||||
NS_IMETHOD SetShape(const nsString& aShape);
|
||||
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
||||
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
||||
NS_IMETHOD GetTarget(nsString& aTarget);
|
||||
NS_IMETHOD SetTarget(const nsString& aTarget);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLAreaElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLAreaElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLAreaElement::nsHTMLAreaElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLAreaElement::~nsHTMLAreaElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLAreaElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLAreaElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLAreaElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLAreaElementIID)) {
|
||||
nsIDOMHTMLAreaElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLAreaElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLAreaElement* it = new nsHTMLAreaElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, AccessKey, accesskey, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Alt, alt, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Coords, coords, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Href, href, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLAreaElement, NoHref, nohref, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Shape, shape, eSetAttrNotify_None)
|
||||
NS_IMPL_INT_ATTR(nsHTMLAreaElement, TabIndex, tabindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLAreaElement, Target, target, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAreaElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAreaElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAreaElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAreaElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
187
mozilla/layout/html/content/src/nsHTMLBRElement.cpp
Normal file
187
mozilla/layout/html/content/src/nsHTMLBRElement.cpp
Normal file
@@ -0,0 +1,187 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLBRElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBRElementIID, NS_IDOMHTMLBRELEMENT_IID);
|
||||
|
||||
class nsHTMLBRElement : public nsIDOMHTMLBRElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLBRElement(nsIAtom* aTag);
|
||||
~nsHTMLBRElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLBRElement
|
||||
NS_IMETHOD GetClear(nsString& aClear);
|
||||
NS_IMETHOD SetClear(const nsString& aClear);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLBRElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLBRElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLBRElement::nsHTMLBRElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLBRElement::~nsHTMLBRElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLBRElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLBRElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLBRElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBRElementIID)) {
|
||||
nsIDOMHTMLBRElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLBRElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLBRElement* it = new nsHTMLBRElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBRElement, Clear, clear, eSetAttrNotify_Reflow)
|
||||
|
||||
static nsHTMLGenericContent::EnumTable kClearTable[] = {
|
||||
{ "left", NS_STYLE_CLEAR_LEFT },
|
||||
{ "right", NS_STYLE_CLEAR_RIGHT },
|
||||
{ "all", NS_STYLE_CLEAR_LEFT_AND_RIGHT },
|
||||
{ "both", NS_STYLE_CLEAR_LEFT_AND_RIGHT },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBRElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::clear) {
|
||||
if (nsHTMLGenericContent::ParseEnumValue(aValue, kClearTable, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBRElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::clear) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::EnumValueToString(aValue, kClearTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBRElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
if (nsnull != mInner.mAttributes) {
|
||||
nsStyleDisplay* display = (nsStyleDisplay*)
|
||||
aContext->GetMutableStyleData(eStyleStruct_Display);
|
||||
nsHTMLValue value;
|
||||
GetAttribute(nsHTMLAtoms::clear, value);
|
||||
if (value.GetUnit() == eHTMLUnit_Enumerated) {
|
||||
display->mBreakType = value.GetIntValue();
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBRElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
162
mozilla/layout/html/content/src/nsHTMLBaseElement.cpp
Normal file
162
mozilla/layout/html/content/src/nsHTMLBaseElement.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLBaseElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBaseElementIID, NS_IDOMHTMLBASEELEMENT_IID);
|
||||
|
||||
class nsHTMLBaseElement : public nsIDOMHTMLBaseElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLBaseElement(nsIAtom* aTag);
|
||||
~nsHTMLBaseElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLBaseElement
|
||||
NS_IMETHOD GetHref(nsString& aHref);
|
||||
NS_IMETHOD SetHref(const nsString& aHref);
|
||||
NS_IMETHOD GetTarget(nsString& aTarget);
|
||||
NS_IMETHOD SetTarget(const nsString& aTarget);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLBaseElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLBaseElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLBaseElement::nsHTMLBaseElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLBaseElement::~nsHTMLBaseElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLBaseElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLBaseElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLBaseElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBaseElementIID)) {
|
||||
nsIDOMHTMLBaseElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLBaseElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLBaseElement* it = new nsHTMLBaseElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseElement, Href, href, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseElement, Target, target, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
168
mozilla/layout/html/content/src/nsHTMLBaseFontElement.cpp
Normal file
168
mozilla/layout/html/content/src/nsHTMLBaseFontElement.cpp
Normal file
@@ -0,0 +1,168 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLBaseFontElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBaseFontElementIID, NS_IDOMHTMLBASEFONTELEMENT_IID);
|
||||
|
||||
class nsHTMLBaseFontElement : public nsIDOMHTMLBaseFontElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLBaseFontElement(nsIAtom* aTag);
|
||||
~nsHTMLBaseFontElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLBaseElement
|
||||
NS_IMETHOD GetColor(nsString& aColor);
|
||||
NS_IMETHOD SetColor(const nsString& aColor);
|
||||
NS_IMETHOD GetFace(nsString& aFace);
|
||||
NS_IMETHOD SetFace(const nsString& aFace);
|
||||
NS_IMETHOD GetSize(nsString& aSize);
|
||||
NS_IMETHOD SetSize(const nsString& aSize);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLBaseFontElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLBaseFontElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLBaseFontElement::nsHTMLBaseFontElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLBaseFontElement::~nsHTMLBaseFontElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLBaseFontElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLBaseFontElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLBaseFontElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBaseFontElementIID)) {
|
||||
nsIDOMHTMLBaseFontElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLBaseFontElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLBaseFontElement* it = new nsHTMLBaseFontElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFontElement, Color, color, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFontElement, Face, face, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBaseFontElement, Size, size, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseFontElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseFontElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseFontElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me?
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBaseFontElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
177
mozilla/layout/html/content/src/nsHTMLBodyElement.cpp
Normal file
177
mozilla/layout/html/content/src/nsHTMLBodyElement.cpp
Normal file
@@ -0,0 +1,177 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLBodyElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBodyElementIID, NS_IDOMHTMLBODYELEMENT_IID);
|
||||
|
||||
class nsHTMLBodyElement : public nsIDOMHTMLBodyElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLBodyElement(nsIAtom* aTag);
|
||||
~nsHTMLBodyElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLBodyElement
|
||||
NS_IMETHOD GetALink(nsString& aALink);
|
||||
NS_IMETHOD SetALink(const nsString& aALink);
|
||||
NS_IMETHOD GetBackground(nsString& aBackground);
|
||||
NS_IMETHOD SetBackground(const nsString& aBackground);
|
||||
NS_IMETHOD GetBgColor(nsString& aBgColor);
|
||||
NS_IMETHOD SetBgColor(const nsString& aBgColor);
|
||||
NS_IMETHOD GetLink(nsString& aLink);
|
||||
NS_IMETHOD SetLink(const nsString& aLink);
|
||||
NS_IMETHOD GetText(nsString& aText);
|
||||
NS_IMETHOD SetText(const nsString& aText);
|
||||
NS_IMETHOD GetVLink(nsString& aVLink);
|
||||
NS_IMETHOD SetVLink(const nsString& aVLink);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLBodyElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLBodyElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLBodyElement::nsHTMLBodyElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLBodyElement::~nsHTMLBodyElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLBodyElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLBodyElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLBodyElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBodyElementIID)) {
|
||||
nsIDOMHTMLBodyElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLBodyElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLBodyElement* it = new nsHTMLBodyElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, ALink, alink, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, Background, background, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, Link, link, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, Text, text, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBodyElement, VLink, vlink, eSetAttrNotify_Render)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBodyElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBodyElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBodyElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBodyElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
162
mozilla/layout/html/content/src/nsHTMLDListElement.cpp
Normal file
162
mozilla/layout/html/content/src/nsHTMLDListElement.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLDListElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDListElementIID, NS_IDOMHTMLDLISTELEMENT_IID);
|
||||
|
||||
class nsHTMLDListElement : public nsIDOMHTMLDListElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLDListElement(nsIAtom* aTag);
|
||||
~nsHTMLDListElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLDListElement
|
||||
NS_IMETHOD GetCompact(PRBool* aCompact);
|
||||
NS_IMETHOD SetCompact(PRBool aCompact);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLDListElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLDListElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLDListElement::nsHTMLDListElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLDListElement::~nsHTMLDListElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLDListElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLDListElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLDListElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDListElementIID)) {
|
||||
nsIDOMHTMLDListElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDListElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLDListElement* it = new nsHTMLDListElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLDListElement, Compact, compact, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDListElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDListElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDListElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDListElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
165
mozilla/layout/html/content/src/nsHTMLDelElement.cpp
Normal file
165
mozilla/layout/html/content/src/nsHTMLDelElement.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLDelElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDelElementIID, NS_IDOMHTMLDELELEMENT_IID);
|
||||
|
||||
class nsHTMLDelElement : public nsIDOMHTMLDelElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLDelElement(nsIAtom* aTag);
|
||||
~nsHTMLDelElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLDelElement
|
||||
NS_IMETHOD GetCite(nsString& aCite);
|
||||
NS_IMETHOD SetCite(const nsString& aCite);
|
||||
NS_IMETHOD GetDateTime(nsString& aDateTime);
|
||||
NS_IMETHOD SetDateTime(const nsString& aDateTime);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLDelElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLDelElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLDelElement::nsHTMLDelElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLDelElement::~nsHTMLDelElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLDelElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLDelElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLDelElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDelElementIID)) {
|
||||
nsIDOMHTMLDelElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDelElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLDelElement* it = new nsHTMLDelElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDelElement, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDelElement, DateTime, datetime, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDelElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDelElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDelElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDelElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
162
mozilla/layout/html/content/src/nsHTMLDirectoryElement.cpp
Normal file
162
mozilla/layout/html/content/src/nsHTMLDirectoryElement.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLDirectoryElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDirectoryElementIID, NS_IDOMHTMLDIRECTORYELEMENT_IID);
|
||||
|
||||
class nsHTMLDirectoryElement : public nsIDOMHTMLDirectoryElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLDirectoryElement(nsIAtom* aTag);
|
||||
~nsHTMLDirectoryElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLDirectoryElement
|
||||
NS_IMETHOD GetCompact(PRBool* aCompact);
|
||||
NS_IMETHOD SetCompact(PRBool aCompact);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLDirectoryElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLDirectoryElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLDirectoryElement::nsHTMLDirectoryElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLDirectoryElement::~nsHTMLDirectoryElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLDirectoryElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLDirectoryElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLDirectoryElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDirectoryElementIID)) {
|
||||
nsIDOMHTMLDirectoryElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDirectoryElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLDirectoryElement* it = new nsHTMLDirectoryElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLDirectoryElement, Compact, compact, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDirectoryElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDirectoryElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDirectoryElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDirectoryElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
173
mozilla/layout/html/content/src/nsHTMLDivElement.cpp
Normal file
173
mozilla/layout/html/content/src/nsHTMLDivElement.cpp
Normal file
@@ -0,0 +1,173 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLDivElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
// XXX missing nav attributes
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDivElementIID, NS_IDOMHTMLDIVELEMENT_IID);
|
||||
|
||||
class nsHTMLDivElement : public nsIDOMHTMLDivElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLDivElement(nsIAtom* aTag);
|
||||
~nsHTMLDivElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLDivElement
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLDivElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLDivElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLDivElement::nsHTMLDivElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLDivElement::~nsHTMLDivElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLDivElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLDivElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLDivElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDivElementIID)) {
|
||||
nsIDOMHTMLDivElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDivElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLDivElement* it = new nsHTMLDivElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLDivElement, Align, align, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDivElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDivElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDivElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDivElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsObjectContent.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
||||
#define nsHTMLEmbedSuper nsObjectContent
|
||||
|
||||
class nsHTMLEmbed : public nsHTMLEmbedSuper {
|
||||
public:
|
||||
nsHTMLEmbed(nsIAtom* aTag);
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLEmbed();
|
||||
};
|
||||
|
||||
nsHTMLEmbed::nsHTMLEmbed(nsIAtom* aTag)
|
||||
: nsHTMLEmbedSuper(aTag)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLEmbed::~nsHTMLEmbed()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLEmbed(nsIHTMLContent** aInstancePtrResult,
|
||||
nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLEmbed(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
181
mozilla/layout/html/content/src/nsHTMLEmbedElement.cpp
Normal file
181
mozilla/layout/html/content/src/nsHTMLEmbedElement.cpp
Normal file
@@ -0,0 +1,181 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
// XXX define nsIDOMHTMLEmbedElement; add in nav attrs
|
||||
|
||||
//static NS_DEFINE_IID(kIDOMHTMLEmbedElementIID, NS_IDOMHTMLEmbedELEMENT_IID);
|
||||
|
||||
class nsHTMLEmbedElement : public nsIDOMHTMLElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLEmbedElement(nsIAtom* aTag);
|
||||
~nsHTMLEmbedElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLEmbedElement
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLEmbedElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLEmbedElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLEmbedElement::nsHTMLEmbedElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLEmbedElement::~nsHTMLEmbedElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLEmbedElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLEmbedElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLEmbedElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
#if XXX
|
||||
if (aIID.Equals(kIDOMHTMLEmbedElementIID)) {
|
||||
nsIDOMHTMLEmbedElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLEmbedElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLEmbedElement* it = new nsHTMLEmbedElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLEmbedElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ParseImageAttribute(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLEmbedElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ImageAttributeToString(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLEmbedElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
mInner.MapImageAlignAttributeInto(aContext, aPresContext);
|
||||
mInner.MapImageAttributesInto(aContext, aPresContext);
|
||||
mInner.MapImageBorderAttributesInto(aContext, aPresContext, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLEmbedElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFontElementIID, NS_IDOMHTMLFONTELEMENT_IID);
|
||||
|
||||
class nsHTMLFont : public nsIDOMHTMLFontElement,
|
||||
class nsHTMLFontElement : public nsIDOMHTMLFontElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLFont(nsIAtom* aTag);
|
||||
~nsHTMLFont();
|
||||
nsHTMLFontElement(nsIAtom* aTag);
|
||||
~nsHTMLFontElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -75,35 +75,35 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFont(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLFontElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLFont(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLFontElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLFont::nsHTMLFont(nsIAtom* aTag)
|
||||
nsHTMLFontElement::nsHTMLFontElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLFont::~nsHTMLFont()
|
||||
nsHTMLFontElement::~nsHTMLFontElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLFont)
|
||||
NS_IMPL_ADDREF(nsHTMLFontElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLFont)
|
||||
NS_IMPL_RELEASE(nsHTMLFontElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLFont::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLFontElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLFontElementIID)) {
|
||||
@@ -116,9 +116,9 @@ nsHTMLFont::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLFont::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLFontElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLFont* it = new nsHTMLFont(mInner.mTag);
|
||||
nsHTMLFontElement* it = new nsHTMLFontElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -126,12 +126,12 @@ nsHTMLFont::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFont, Color, face, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFont, Face, face, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFont, Size, size, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFontElement, Color, face, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFontElement, Face, face, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFontElement, Size, size, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFont::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLFontElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ nsHTMLFont::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFont::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLFontElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -149,7 +149,7 @@ nsHTMLFont::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFont::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLFontElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -157,7 +157,7 @@ nsHTMLFont::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFont::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLFontElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
206
mozilla/layout/html/content/src/nsHTMLFormElement.cpp
Normal file
206
mozilla/layout/html/content/src/nsHTMLFormElement.cpp
Normal file
@@ -0,0 +1,206 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLFormElementIID, NS_IDOMHTMLFORMELEMENT_IID);
|
||||
|
||||
class nsHTMLFormElement : public nsIDOMHTMLFormElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLFormElement(nsIAtom* aTag);
|
||||
~nsHTMLFormElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLFormElement
|
||||
NS_IMETHOD GetElements(nsIDOMHTMLCollection** aElements);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD GetAcceptCharset(nsString& aAcceptCharset);
|
||||
NS_IMETHOD SetAcceptCharset(const nsString& aAcceptCharset);
|
||||
NS_IMETHOD GetAction(nsString& aAction);
|
||||
NS_IMETHOD SetAction(const nsString& aAction);
|
||||
NS_IMETHOD GetEnctype(nsString& aEnctype);
|
||||
NS_IMETHOD SetEnctype(const nsString& aEnctype);
|
||||
NS_IMETHOD GetMethod(nsString& aMethod);
|
||||
NS_IMETHOD SetMethod(const nsString& aMethod);
|
||||
NS_IMETHOD GetTarget(nsString& aTarget);
|
||||
NS_IMETHOD SetTarget(const nsString& aTarget);
|
||||
NS_IMETHOD Reset();
|
||||
NS_IMETHOD Submit();
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLFormElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLFormElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLFormElement::nsHTMLFormElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLFormElement::~nsHTMLFormElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLFormElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLFormElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLFormElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLFormElementIID)) {
|
||||
nsIDOMHTMLFormElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLFormElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLFormElement* it = new nsHTMLFormElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::GetElements(nsIDOMHTMLCollection** aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::GetName(nsString& aValue)
|
||||
{
|
||||
return mInner.GetAttribute(nsHTMLAtoms::name, aValue);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, AcceptCharset, acceptcharset, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Action, action, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Enctype, enctype, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Method, method, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Target, target, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::Reset()
|
||||
{
|
||||
// XXX
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::Submit()
|
||||
{
|
||||
// XXX
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
222
mozilla/layout/html/content/src/nsHTMLHRElement.cpp
Normal file
222
mozilla/layout/html/content/src/nsHTMLHRElement.cpp
Normal file
@@ -0,0 +1,222 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLHRElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHRElementIID, NS_IDOMHTMLHRELEMENT_IID);
|
||||
|
||||
class nsHTMLHRElement : public nsIDOMHTMLHRElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLHRElement(nsIAtom* aTag);
|
||||
~nsHTMLHRElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLHRElement
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetNoShade(PRBool* aNoShade);
|
||||
NS_IMETHOD SetNoShade(PRBool aNoShade);
|
||||
NS_IMETHOD GetSize(nsString& aSize);
|
||||
NS_IMETHOD SetSize(const nsString& aSize);
|
||||
NS_IMETHOD GetWidth(nsString& aWidth);
|
||||
NS_IMETHOD SetWidth(const nsString& aWidth);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLHRElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLHRElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLHRElement::nsHTMLHRElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLHRElement::~nsHTMLHRElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLHRElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLHRElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLHRElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHRElementIID)) {
|
||||
nsIDOMHTMLHRElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLHRElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLHRElement* it = new nsHTMLHRElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHRElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLHRElement, NoShade, noshade, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHRElement, Size, size, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHRElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
static nsHTMLGenericContent::EnumTable kAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHRElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::width) {
|
||||
nsHTMLGenericContent::ParseValueOrPercent(aValue, aResult,
|
||||
eHTMLUnit_Pixel);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::size) {
|
||||
nsHTMLGenericContent::ParseValue(aValue, 1, 100, aResult, eHTMLUnit_Pixel);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::noshade) {
|
||||
aResult.SetEmptyValue();
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseEnumValue(aValue, kAlignTable, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHRElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::EnumValueToString(aValue, kAlignTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHRElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
if (nsnull != mInner.mAttributes) {
|
||||
nsHTMLValue value;
|
||||
// align: enum
|
||||
GetAttribute(nsHTMLAtoms::align, value);
|
||||
if (value.GetUnit() == eHTMLUnit_Enumerated) {
|
||||
nsStyleText* text = (nsStyleText*)
|
||||
aContext->GetMutableStyleData(eStyleStruct_Text);
|
||||
text->mTextAlign = value.GetIntValue();
|
||||
}
|
||||
|
||||
// width: pixel, percent
|
||||
float p2t = aPresContext->GetPixelsToTwips();
|
||||
nsStylePosition* pos = (nsStylePosition*)
|
||||
aContext->GetMutableStyleData(eStyleStruct_Position);
|
||||
GetAttribute(nsHTMLAtoms::width, value);
|
||||
if (value.GetUnit() == eHTMLUnit_Pixel) {
|
||||
nscoord twips = NSIntPixelsToTwips(value.GetPixelValue(), p2t);
|
||||
pos->mWidth.SetCoordValue(twips);
|
||||
}
|
||||
else if (value.GetUnit() == eHTMLUnit_Percent) {
|
||||
pos->mWidth.SetPercentValue(value.GetPercentValue());
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHRElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsHTMLContainer.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
||||
class nsHTMLHead : public nsHTMLContainer {
|
||||
public:
|
||||
nsHTMLHead(nsIAtom* aTag);
|
||||
|
||||
NS_IMETHOD CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLHead();
|
||||
};
|
||||
|
||||
nsHTMLHead::nsHTMLHead(nsIAtom* aTag)
|
||||
: nsHTMLContainer(aTag)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLHead::~nsHTMLHead()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHead::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame;
|
||||
nsFrame::NewFrame(&frame, this, aParentFrame);
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
frame->SetStyleContext(aPresContext, aStyleContext);
|
||||
aResult = frame;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLHead(nsIHTMLContent** aInstancePtrResult,
|
||||
nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLHead(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
159
mozilla/layout/html/content/src/nsHTMLHeadElement.cpp
Normal file
159
mozilla/layout/html/content/src/nsHTMLHeadElement.cpp
Normal file
@@ -0,0 +1,159 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLHeadElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHeadElementIID, NS_IDOMHTMLHEADELEMENT_IID);
|
||||
|
||||
class nsHTMLHeadElement : public nsIDOMHTMLHeadElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLHeadElement(nsIAtom* aTag);
|
||||
~nsHTMLHeadElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLHeadElement
|
||||
NS_IMETHOD GetProfile(nsString& aProfile);
|
||||
NS_IMETHOD SetProfile(const nsString& aProfile);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLHeadElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLHeadElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLHeadElement::nsHTMLHeadElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLHeadElement::~nsHTMLHeadElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLHeadElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLHeadElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLHeadElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHeadElementIID)) {
|
||||
nsIDOMHTMLHeadElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLHeadElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLHeadElement* it = new nsHTMLHeadElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHeadElement, Profile, profile, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
162
mozilla/layout/html/content/src/nsHTMLHeadingElement.cpp
Normal file
162
mozilla/layout/html/content/src/nsHTMLHeadingElement.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLHeadingElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLHeadingElementIID, NS_IDOMHTMLHEADINGELEMENT_IID);
|
||||
|
||||
class nsHTMLHeadingElement : public nsIDOMHTMLHeadingElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLHeadingElement(nsIAtom* aTag);
|
||||
~nsHTMLHeadingElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLHeadingElement
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLHeadingElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLHeadingElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLHeadingElement::nsHTMLHeadingElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLHeadingElement::~nsHTMLHeadingElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLHeadingElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLHeadingElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLHeadingElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLHeadingElementIID)) {
|
||||
nsIDOMHTMLHeadingElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLHeadingElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLHeadingElement* it = new nsHTMLHeadingElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHeadingElement, Align, align, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadingElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadingElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadingElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadingElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -16,27 +16,27 @@
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLBaseElement.h"
|
||||
#include "nsIDOMHTMLHtmlElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLBaseElementIID, NS_IDOMHTMLBASEELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLHtmlElementIID, NS_IDOMHTMLHTMLELEMENT_IID);
|
||||
|
||||
class nsHTMLBase : public nsIDOMHTMLBaseElement,
|
||||
class nsHTMLHtmlElement : public nsIDOMHTMLHtmlElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLBase(nsIAtom* aTag);
|
||||
~nsHTMLBase();
|
||||
nsHTMLHtmlElement(nsIAtom* aTag);
|
||||
~nsHTMLHtmlElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -50,11 +50,9 @@ public:
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLBaseElement
|
||||
NS_IMETHOD GetHref(nsString& aHref);
|
||||
NS_IMETHOD SetHref(const nsString& aHref);
|
||||
NS_IMETHOD GetTarget(nsString& aTarget);
|
||||
NS_IMETHOD SetTarget(const nsString& aTarget);
|
||||
// nsIDOMHTMLHtmlElement
|
||||
NS_IMETHOD GetVersion(nsString& aVersion);
|
||||
NS_IMETHOD SetVersion(const nsString& aVersion);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
@@ -69,54 +67,54 @@ public:
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLBase(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLHtmlElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLBase(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLHtmlElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLBase::nsHTMLBase(nsIAtom* aTag)
|
||||
nsHTMLHtmlElement::nsHTMLHtmlElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLBase::~nsHTMLBase()
|
||||
nsHTMLHtmlElement::~nsHTMLHtmlElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLBase)
|
||||
NS_IMPL_ADDREF(nsHTMLHtmlElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLBase)
|
||||
NS_IMPL_RELEASE(nsHTMLHtmlElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLBase::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLHtmlElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLBaseElementIID)) {
|
||||
nsIDOMHTMLBaseElement* tmp = this;
|
||||
if (aIID.Equals(kIDOMHTMLHtmlElementIID)) {
|
||||
nsIDOMHTMLHtmlElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLBase::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLHtmlElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLBase* it = new nsHTMLBase(mInner.mTag);
|
||||
nsHTMLHtmlElement* it = new nsHTMLHtmlElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -124,11 +122,10 @@ nsHTMLBase::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBase, Href, href, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBase, Target, target, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHtmlElement, Version, version, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBase::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLHtmlElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -136,7 +133,7 @@ nsHTMLBase::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBase::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLHtmlElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -144,14 +141,14 @@ nsHTMLBase::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBase::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLHtmlElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBase::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLHtmlElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
257
mozilla/layout/html/content/src/nsHTMLInputElement.cpp
Normal file
257
mozilla/layout/html/content/src/nsHTMLInputElement.cpp
Normal file
@@ -0,0 +1,257 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
// XXX align=left, hspace, vspace, border? other nav4 attrs
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
|
||||
|
||||
class nsHTMLInputElement : public nsIDOMHTMLInputElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLInputElement(nsIAtom* aTag);
|
||||
~nsHTMLInputElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLInputElement
|
||||
NS_IMETHOD GetDefaultValue(nsString& aDefaultValue);
|
||||
NS_IMETHOD SetDefaultValue(const nsString& aDefaultValue);
|
||||
NS_IMETHOD GetDefaultChecked(PRBool* aDefaultChecked);
|
||||
NS_IMETHOD SetDefaultChecked(PRBool aDefaultChecked);
|
||||
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
|
||||
NS_IMETHOD GetAccept(nsString& aAccept);
|
||||
NS_IMETHOD SetAccept(const nsString& aAccept);
|
||||
NS_IMETHOD GetAccessKey(nsString& aAccessKey);
|
||||
NS_IMETHOD SetAccessKey(const nsString& aAccessKey);
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetAlt(nsString& aAlt);
|
||||
NS_IMETHOD SetAlt(const nsString& aAlt);
|
||||
NS_IMETHOD GetChecked(PRBool* aChecked);
|
||||
NS_IMETHOD SetChecked(PRBool aChecked);
|
||||
NS_IMETHOD GetDisabled(PRBool* aDisabled);
|
||||
NS_IMETHOD SetDisabled(PRBool aDisabled);
|
||||
NS_IMETHOD GetMaxLength(PRInt32* aMaxLength);
|
||||
NS_IMETHOD SetMaxLength(PRInt32 aMaxLength);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetReadOnly(PRBool* aReadOnly);
|
||||
NS_IMETHOD SetReadOnly(PRBool aReadOnly);
|
||||
NS_IMETHOD GetSize(nsString& aSize);
|
||||
NS_IMETHOD SetSize(const nsString& aSize);
|
||||
NS_IMETHOD GetSrc(nsString& aSrc);
|
||||
NS_IMETHOD SetSrc(const nsString& aSrc);
|
||||
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
||||
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD GetUseMap(nsString& aUseMap);
|
||||
NS_IMETHOD SetUseMap(const nsString& aUseMap);
|
||||
NS_IMETHOD GetValue(nsString& aValue);
|
||||
NS_IMETHOD SetValue(const nsString& aValue);
|
||||
NS_IMETHOD Blur();
|
||||
NS_IMETHOD Focus();
|
||||
NS_IMETHOD Select();
|
||||
NS_IMETHOD Click();
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLInputElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLInputElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLInputElement::nsHTMLInputElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLInputElement::~nsHTMLInputElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLInputElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLInputElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLInputElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLInputElementIID)) {
|
||||
nsIDOMHTMLInputElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLInputElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLInputElement* it = new nsHTMLInputElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, DefaultValue, defaultvalue, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, DefaultChecked, defaultchecked, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Accept, accept, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, AccessKey, accesskey, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Alt, alt, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Checked, checked, eSetAttrNotify_Render)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLInputElement, MaxLength, maxlength, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLInputElement, ReadOnly, readonly, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Size, size, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Src, src, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLInputElement, TabIndex, tabindex, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, UseMap, usemap, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInputElement, Value, value, eSetAttrNotify_Render)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::GetType(nsString& aValue)
|
||||
{
|
||||
mInner.GetAttribute(nsHTMLAtoms::type, aValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::Blur()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::Focus()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::Select()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::Click()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX align
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX align
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX align
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
165
mozilla/layout/html/content/src/nsHTMLInsElement.cpp
Normal file
165
mozilla/layout/html/content/src/nsHTMLInsElement.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLInsElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLInsElementIID, NS_IDOMHTMLINSELEMENT_IID);
|
||||
|
||||
class nsHTMLInsElement : public nsIDOMHTMLInsElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLInsElement(nsIAtom* aTag);
|
||||
~nsHTMLInsElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLInsElement
|
||||
NS_IMETHOD GetCite(nsString& aCite);
|
||||
NS_IMETHOD SetCite(const nsString& aCite);
|
||||
NS_IMETHOD GetDateTime(nsString& aDateTime);
|
||||
NS_IMETHOD SetDateTime(const nsString& aDateTime);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLInsElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLInsElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLInsElement::nsHTMLInsElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLInsElement::~nsHTMLInsElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLInsElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLInsElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLInsElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLInsElementIID)) {
|
||||
nsIDOMHTMLInsElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLInsElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLInsElement* it = new nsHTMLInsElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInsElement, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLInsElement, DateTime, datetime, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInsElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInsElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInsElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInsElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
165
mozilla/layout/html/content/src/nsHTMLLIElement.cpp
Normal file
165
mozilla/layout/html/content/src/nsHTMLLIElement.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLLIElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLLIElementIID, NS_IDOMHTMLLIELEMENT_IID);
|
||||
|
||||
class nsHTMLLIElement : public nsIDOMHTMLLIElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLLIElement(nsIAtom* aTag);
|
||||
~nsHTMLLIElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLLIElement
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
NS_IMETHOD GetValue(PRInt32* aValue);
|
||||
NS_IMETHOD SetValue(PRInt32 aValue);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLLIElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLLIElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLLIElement::nsHTMLLIElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLLIElement::~nsHTMLLIElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLLIElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLLIElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLLIElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLLIElementIID)) {
|
||||
nsIDOMHTMLLIElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLLIElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLLIElement* it = new nsHTMLLIElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLIElement, Type, type, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLLIElement, Value, value, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLIElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLIElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLIElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLIElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -1,74 +1,143 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsHTMLContainer.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIStyleRule.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsBodyFrame.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include <limits.h>
|
||||
|
||||
#if !defined(_I32_MIN)
|
||||
#define _I32_MIN (-2147483647 - 1)
|
||||
#endif
|
||||
static NS_DEFINE_IID(kIDOMHTMLLayerElementIID, NS_IDOMHTMLELEMENT_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||
|
||||
class LayerPart : public nsHTMLContainer {
|
||||
class nsHTMLLayerElement : public nsIDOMHTMLElement,/* XXX need layer api */
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
LayerPart(nsIAtom* aTag);
|
||||
nsHTMLLayerElement(nsIAtom* aTag);
|
||||
~nsHTMLLayerElement();
|
||||
|
||||
NS_IMETHOD CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult);
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD SetAttribute(nsIAtom* aAttribute, const nsString& aString,
|
||||
PRBool aNotify);
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
NS_IMETHOD MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext);
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const;
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLLayerElement
|
||||
NS_IMETHOD GetCite(nsString& aCite);
|
||||
NS_IMETHOD SetCite(const nsString& aCite);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------
|
||||
nsresult
|
||||
NS_NewHTMLLayerElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLLayerElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
LayerPart::LayerPart(nsIAtom* aTag)
|
||||
: nsHTMLContainer(aTag)
|
||||
nsHTMLLayerElement::nsHTMLLayerElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLLayerElement::~nsHTMLLayerElement()
|
||||
{
|
||||
}
|
||||
|
||||
static nsHTMLTagContent::EnumTable kVisibilityTable[] = {
|
||||
NS_IMPL_ADDREF(nsHTMLLayerElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLLayerElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLLayerElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
#if XXX
|
||||
if (aIID.Equals(kIDOMHTMLLayerElementIID)) {
|
||||
nsIDOMHTMLLayerElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLLayerElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLLayerElement* it = new nsHTMLLayerElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLayerElement, Cite, cite, eSetAttrNotify_None)
|
||||
|
||||
static nsHTMLGenericContent::EnumTable kVisibilityTable[] = {
|
||||
{"hide", NS_STYLE_VISIBILITY_HIDDEN},
|
||||
{"visible", NS_STYLE_VISIBILITY_VISIBLE},
|
||||
{0}
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
LayerPart::SetAttribute(nsIAtom* aAttribute, const nsString& aString,
|
||||
PRBool aNotify)
|
||||
nsHTMLLayerElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
#if 0
|
||||
// XXX CLIP
|
||||
nsHTMLValue val;
|
||||
if (aAttribute == nsHTMLAtoms::src) {
|
||||
@@ -114,15 +183,31 @@ LayerPart::SetAttribute(nsIAtom* aAttribute, const nsString& aString,
|
||||
}
|
||||
|
||||
// ABOVE, BELOW, OnMouseOver, OnMouseOut, OnFocus, OnBlur, OnLoad
|
||||
return nsHTMLTagContent::SetAttribute(aAttribute, aString, aNotify);
|
||||
#endif
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LayerPart::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
nsHTMLLayerElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::visibility) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::EnumValueToString(aValue, kVisibilityTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLayerElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// Note: ua.css specifies that the 'position' is absolute
|
||||
if (nsnull != mAttributes) {
|
||||
if (nsnull != mInner.mAttributes) {
|
||||
nsHTMLValue value;
|
||||
float p2t = aPresContext->GetPixelsToTwips();
|
||||
nsStylePosition* position = (nsStylePosition*)
|
||||
@@ -178,65 +263,18 @@ LayerPart::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
// Background and bgcolor
|
||||
MapBackgroundAttributesInto(aContext, aPresContext);
|
||||
//XXX MapBackgroundAttributesInto(aContext, aPresContext);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LayerPart::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
nsHTMLLayerElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::visibility) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
EnumValueToString(aValue, kVisibilityTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LayerPart::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame = nsnull;
|
||||
nsresult rv;
|
||||
|
||||
// The type of frame depends on whether there is a SRC attribute
|
||||
nsAutoString url;
|
||||
#if 0
|
||||
if (GetAttribute("SRC", url) == eContentAttr_HasValue) {
|
||||
rv = new nsHTMLFrameOuterFrame(this, aParentFrame);
|
||||
}
|
||||
else {
|
||||
rv = nsBodyFrame::NewFrame(&frame, this, aParentFrame);
|
||||
}
|
||||
#else
|
||||
rv = nsBodyFrame::NewFrame(&frame, this, aParentFrame);
|
||||
#endif
|
||||
if (NS_OK != rv) {
|
||||
return rv;
|
||||
}
|
||||
frame->SetStyleContext(aPresContext, aStyleContext);
|
||||
aResult = frame;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLLayer(nsIHTMLContent** aInstancePtrResult,
|
||||
nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* body = new LayerPart(aTag);
|
||||
if (nsnull == body) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return body->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult);
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
183
mozilla/layout/html/content/src/nsHTMLLinkElement.cpp
Normal file
183
mozilla/layout/html/content/src/nsHTMLLinkElement.cpp
Normal file
@@ -0,0 +1,183 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLLinkElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLLinkElementIID, NS_IDOMHTMLLINKELEMENT_IID);
|
||||
|
||||
class nsHTMLLinkElement : public nsIDOMHTMLLinkElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLLinkElement(nsIAtom* aTag);
|
||||
~nsHTMLLinkElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLLinkElement
|
||||
NS_IMETHOD GetDisabled(PRBool* aDisabled);
|
||||
NS_IMETHOD SetDisabled(PRBool aDisabled);
|
||||
NS_IMETHOD GetCharset(nsString& aCharset);
|
||||
NS_IMETHOD SetCharset(const nsString& aCharset);
|
||||
NS_IMETHOD GetHref(nsString& aHref);
|
||||
NS_IMETHOD SetHref(const nsString& aHref);
|
||||
NS_IMETHOD GetHreflang(nsString& aHreflang);
|
||||
NS_IMETHOD SetHreflang(const nsString& aHreflang);
|
||||
NS_IMETHOD GetMedia(nsString& aMedia);
|
||||
NS_IMETHOD SetMedia(const nsString& aMedia);
|
||||
NS_IMETHOD GetRel(nsString& aRel);
|
||||
NS_IMETHOD SetRel(const nsString& aRel);
|
||||
NS_IMETHOD GetRev(nsString& aRev);
|
||||
NS_IMETHOD SetRev(const nsString& aRev);
|
||||
NS_IMETHOD GetTarget(nsString& aTarget);
|
||||
NS_IMETHOD SetTarget(const nsString& aTarget);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLLinkElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLLinkElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLLinkElement::nsHTMLLinkElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLLinkElement::~nsHTMLLinkElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLLinkElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLLinkElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLLinkElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLLinkElementIID)) {
|
||||
nsIDOMHTMLLinkElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLLinkElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLLinkElement* it = new nsHTMLLinkElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLLinkElement, Disabled, disabled, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Charset, charset, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Href, href, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Hreflang, hreflang, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Media, media, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Rel, rel, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Rev, rev, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Target, target, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLLinkElement, Type, type, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLinkElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLinkElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLinkElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLinkElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
178
mozilla/layout/html/content/src/nsHTMLMapElement.cpp
Normal file
178
mozilla/layout/html/content/src/nsHTMLMapElement.cpp
Normal file
@@ -0,0 +1,178 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLMapElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLMapElementIID, NS_IDOMHTMLMAPELEMENT_IID);
|
||||
|
||||
class nsHTMLMapElement : public nsIDOMHTMLMapElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLMapElement(nsIAtom* aTag);
|
||||
~nsHTMLMapElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLMapElement
|
||||
NS_IMETHOD GetAreas(nsIDOMHTMLCollection** aAreas);
|
||||
NS_IMETHOD SetAreas(nsIDOMHTMLCollection* aAreas);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLMapElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLMapElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLMapElement::nsHTMLMapElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLMapElement::~nsHTMLMapElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLMapElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLMapElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLMapElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLMapElementIID)) {
|
||||
nsIDOMHTMLMapElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLMapElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLMapElement* it = new nsHTMLMapElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMapElement::GetAreas(nsIDOMHTMLCollection** aAreas)
|
||||
{
|
||||
*aAreas = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;/* XXX */
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMapElement::SetAreas(nsIDOMHTMLCollection* aAreas)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMapElement, Name, name, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMapElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMapElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMapElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMapElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
162
mozilla/layout/html/content/src/nsHTMLMenuElement.cpp
Normal file
162
mozilla/layout/html/content/src/nsHTMLMenuElement.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLMenuElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLMenuElementIID, NS_IDOMHTMLMENUELEMENT_IID);
|
||||
|
||||
class nsHTMLMenuElement : public nsIDOMHTMLMenuElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLMenuElement(nsIAtom* aTag);
|
||||
~nsHTMLMenuElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLMenuElement
|
||||
NS_IMETHOD GetCompact(PRBool* aCompact);
|
||||
NS_IMETHOD SetCompact(PRBool aCompact);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLMenuElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLMenuElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLMenuElement::nsHTMLMenuElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLMenuElement::~nsHTMLMenuElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLMenuElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLMenuElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLMenuElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLMenuElementIID)) {
|
||||
nsIDOMHTMLMenuElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLMenuElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLMenuElement* it = new nsHTMLMenuElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLMenuElement, Compact, compact, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenuElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenuElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenuElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMenuElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsHTMLContainer.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
||||
#define nsHTMLMetaSuper nsHTMLTagContent
|
||||
|
||||
class nsHTMLMeta : public nsHTMLMetaSuper {
|
||||
public:
|
||||
nsHTMLMeta(nsIAtom* aTag);
|
||||
|
||||
NS_IMETHOD CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLMeta();
|
||||
};
|
||||
|
||||
nsHTMLMeta::nsHTMLMeta(nsIAtom* aTag)
|
||||
: nsHTMLMetaSuper(aTag)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLMeta::~nsHTMLMeta()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeta::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame;
|
||||
nsFrame::NewFrame(&frame, this, aParentFrame);
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
frame->SetStyleContext(aPresContext, aStyleContext);
|
||||
aResult = frame;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLMeta(nsIHTMLContent** aInstancePtrResult,
|
||||
nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLMeta(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
168
mozilla/layout/html/content/src/nsHTMLMetaElement.cpp
Normal file
168
mozilla/layout/html/content/src/nsHTMLMetaElement.cpp
Normal file
@@ -0,0 +1,168 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLMetaElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLMetaElementIID, NS_IDOMHTMLMETAELEMENT_IID);
|
||||
|
||||
class nsHTMLMetaElement : public nsIDOMHTMLMetaElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLMetaElement(nsIAtom* aTag);
|
||||
~nsHTMLMetaElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLMetaElement
|
||||
NS_IMETHOD GetContent(nsString& aContent);
|
||||
NS_IMETHOD SetContent(const nsString& aContent);
|
||||
NS_IMETHOD GetHttpEquiv(nsString& aHttpEquiv);
|
||||
NS_IMETHOD SetHttpEquiv(const nsString& aHttpEquiv);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetScheme(nsString& aScheme);
|
||||
NS_IMETHOD SetScheme(const nsString& aScheme);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLMetaElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLMetaElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLMetaElement::nsHTMLMetaElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLMetaElement::~nsHTMLMetaElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLMetaElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLMetaElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLMetaElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLMetaElementIID)) {
|
||||
nsIDOMHTMLMetaElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLMetaElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLMetaElement* it = new nsHTMLMetaElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Content, content, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, HttpEquiv, httpEquiv, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Name, name, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Scheme, scheme, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMetaElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMetaElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMetaElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMetaElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
165
mozilla/layout/html/content/src/nsHTMLModElement.cpp
Normal file
165
mozilla/layout/html/content/src/nsHTMLModElement.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLModElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLModElementIID, NS_IDOMHTMLMODELEMENT_IID);
|
||||
|
||||
class nsHTMLModElement : public nsIDOMHTMLModElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLModElement(nsIAtom* aTag);
|
||||
~nsHTMLModElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLModElement
|
||||
NS_IMETHOD GetCite(nsString& aCite);
|
||||
NS_IMETHOD SetCite(const nsString& aCite);
|
||||
NS_IMETHOD GetDateTime(nsString& aDateTime);
|
||||
NS_IMETHOD SetDateTime(const nsString& aDateTime);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLModElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLModElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLModElement::nsHTMLModElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLModElement::~nsHTMLModElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLModElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLModElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLModElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLModElementIID)) {
|
||||
nsIDOMHTMLModElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLModElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLModElement* it = new nsHTMLModElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLModElement, Cite, cite, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLModElement, DateTime, datetime, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLModElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLModElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLModElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLModElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
168
mozilla/layout/html/content/src/nsHTMLOListElement.cpp
Normal file
168
mozilla/layout/html/content/src/nsHTMLOListElement.cpp
Normal file
@@ -0,0 +1,168 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLOListElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLOListElementIID, NS_IDOMHTMLOLISTELEMENT_IID);
|
||||
|
||||
class nsHTMLOListElement : public nsIDOMHTMLOListElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLOListElement(nsIAtom* aTag);
|
||||
~nsHTMLOListElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLOListElement
|
||||
NS_IMETHOD GetCompact(PRBool* aCompact);
|
||||
NS_IMETHOD SetCompact(PRBool aCompact);
|
||||
NS_IMETHOD GetStart(PRInt32* aStart);
|
||||
NS_IMETHOD SetStart(PRInt32 aStart);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLOListElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLOListElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLOListElement::nsHTMLOListElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLOListElement::~nsHTMLOListElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLOListElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLOListElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLOListElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLOListElementIID)) {
|
||||
nsIDOMHTMLOListElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLOListElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLOListElement* it = new nsHTMLOListElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOListElement, Compact, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLOListElement, Start, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOListElement, Type, compact, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOListElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOListElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOListElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOListElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsObjectContent.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
|
||||
#define nsHTMLObjectSuper nsObjectContent
|
||||
|
||||
class nsHTMLObject : public nsHTMLObjectSuper {
|
||||
public:
|
||||
nsHTMLObject(nsIAtom* aTag);
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLObject();
|
||||
};
|
||||
|
||||
nsHTMLObject::nsHTMLObject(nsIAtom* aTag)
|
||||
: nsHTMLObjectSuper(aTag)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLObject::~nsHTMLObject()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLObject(nsIHTMLContent** aInstancePtrResult,
|
||||
nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLObject(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
244
mozilla/layout/html/content/src/nsHTMLObjectElement.cpp
Normal file
244
mozilla/layout/html/content/src/nsHTMLObjectElement.cpp
Normal file
@@ -0,0 +1,244 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLObjectElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLObjectElementIID, NS_IDOMHTMLOBJECTELEMENT_IID);
|
||||
|
||||
class nsHTMLObjectElement : public nsIDOMHTMLObjectElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLObjectElement(nsIAtom* aTag);
|
||||
~nsHTMLObjectElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLObjectElement
|
||||
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
|
||||
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm);
|
||||
NS_IMETHOD GetCode(nsString& aCode);
|
||||
NS_IMETHOD SetCode(const nsString& aCode);
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetArchive(nsString& aArchive);
|
||||
NS_IMETHOD SetArchive(const nsString& aArchive);
|
||||
NS_IMETHOD GetBorder(nsString& aBorder);
|
||||
NS_IMETHOD SetBorder(const nsString& aBorder);
|
||||
NS_IMETHOD GetCodeBase(nsString& aCodeBase);
|
||||
NS_IMETHOD SetCodeBase(const nsString& aCodeBase);
|
||||
NS_IMETHOD GetCodeType(nsString& aCodeType);
|
||||
NS_IMETHOD SetCodeType(const nsString& aCodeType);
|
||||
NS_IMETHOD GetData(nsString& aData);
|
||||
NS_IMETHOD SetData(const nsString& aData);
|
||||
NS_IMETHOD GetDeclare(PRBool* aDeclare);
|
||||
NS_IMETHOD SetDeclare(PRBool aDeclare);
|
||||
NS_IMETHOD GetHeight(nsString& aHeight);
|
||||
NS_IMETHOD SetHeight(const nsString& aHeight);
|
||||
NS_IMETHOD GetHspace(nsString& aHspace);
|
||||
NS_IMETHOD SetHspace(const nsString& aHspace);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetStandby(nsString& aStandby);
|
||||
NS_IMETHOD SetStandby(const nsString& aStandby);
|
||||
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
||||
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
NS_IMETHOD GetUseMap(nsString& aUseMap);
|
||||
NS_IMETHOD SetUseMap(const nsString& aUseMap);
|
||||
NS_IMETHOD GetVspace(nsString& aVspace);
|
||||
NS_IMETHOD SetVspace(const nsString& aVspace);
|
||||
NS_IMETHOD GetWidth(nsString& aWidth);
|
||||
NS_IMETHOD SetWidth(const nsString& aWidth);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLObjectElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLObjectElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLObjectElement::nsHTMLObjectElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLObjectElement::~nsHTMLObjectElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLObjectElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLObjectElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLObjectElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLObjectElementIID)) {
|
||||
nsIDOMHTMLObjectElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLObjectElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLObjectElement* it = new nsHTMLObjectElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Code, code, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Archive, archive, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Border, border, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, CodeBase, codebase, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, CodeType, codetype, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Data, data, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLObjectElement, Declare, declare, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Height, height, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Hspace, hspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Standby, standby, eSetAttrNotify_None)
|
||||
NS_IMPL_INT_ATTR(nsHTMLObjectElement, TabIndex, tabindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, UseMap, usemap, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Vspace, vspace, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLObjectElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ParseImageAttribute(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (nsHTMLGenericContent::ImageAttributeToString(aAttribute,
|
||||
aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
mInner.MapImageAlignAttributeInto(aContext, aPresContext);
|
||||
mInner.MapImageAttributesInto(aContext, aPresContext);
|
||||
mInner.MapImageBorderAttributesInto(aContext, aPresContext, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
189
mozilla/layout/html/content/src/nsHTMLOptionElement.cpp
Normal file
189
mozilla/layout/html/content/src/nsHTMLOptionElement.cpp
Normal file
@@ -0,0 +1,189 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLOptionElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLOptionElementIID, NS_IDOMHTMLOPTIONELEMENT_IID);
|
||||
|
||||
class nsHTMLOptionElement : public nsIDOMHTMLOptionElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLOptionElement(nsIAtom* aTag);
|
||||
~nsHTMLOptionElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLOptionElement
|
||||
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
|
||||
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm);
|
||||
NS_IMETHOD GetDefaultSelected(PRBool* aDefaultSelected);
|
||||
NS_IMETHOD SetDefaultSelected(PRBool aDefaultSelected);
|
||||
NS_IMETHOD GetText(nsString& aText);
|
||||
NS_IMETHOD SetText(const nsString& aText);
|
||||
NS_IMETHOD GetIndex(PRInt32* aIndex);
|
||||
NS_IMETHOD SetIndex(PRInt32 aIndex);
|
||||
NS_IMETHOD GetDisabled(PRBool* aDisabled);
|
||||
NS_IMETHOD SetDisabled(PRBool aDisabled);
|
||||
NS_IMETHOD GetLabel(nsString& aLabel);
|
||||
NS_IMETHOD SetLabel(const nsString& aLabel);
|
||||
NS_IMETHOD GetSelected(PRBool* aSelected);
|
||||
NS_IMETHOD SetSelected(PRBool aSelected);
|
||||
NS_IMETHOD GetValue(nsString& aValue);
|
||||
NS_IMETHOD SetValue(const nsString& aValue);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLOptionElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLOptionElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLOptionElement::nsHTMLOptionElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLOptionElement::~nsHTMLOptionElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLOptionElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLOptionElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLOptionElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLOptionElementIID)) {
|
||||
nsIDOMHTMLOptionElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLOptionElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLOptionElement* it = new nsHTMLOptionElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOptionElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOptionElement, DefaultSelected, defaultselected, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOptionElement, Text, text, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLOptionElement, Index, index, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOptionElement, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOptionElement, Label, label, eSetAttrNotify_Render)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLOptionElement, Selected, selected, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLOptionElement, Value, value, eSetAttrNotify_Render)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOptionElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOptionElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOptionElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOptionElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
173
mozilla/layout/html/content/src/nsHTMLParagraphElement.cpp
Normal file
173
mozilla/layout/html/content/src/nsHTMLParagraphElement.cpp
Normal file
@@ -0,0 +1,173 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLParagraphElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
// XXX missing nav attributes
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLParagraphElementIID, NS_IDOMHTMLPARAGRAPHELEMENT_IID);
|
||||
|
||||
class nsHTMLParagraphElement : public nsIDOMHTMLParagraphElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLParagraphElement(nsIAtom* aTag);
|
||||
~nsHTMLParagraphElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLParagraphElement
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLParagraphElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLParagraphElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLParagraphElement::nsHTMLParagraphElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLParagraphElement::~nsHTMLParagraphElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLParagraphElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLParagraphElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLParagraphElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLParagraphElementIID)) {
|
||||
nsIDOMHTMLParagraphElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLParagraphElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLParagraphElement* it = new nsHTMLParagraphElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParagraphElement, Align, align, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParagraphElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParagraphElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParagraphElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParagraphElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
171
mozilla/layout/html/content/src/nsHTMLParamElement.cpp
Normal file
171
mozilla/layout/html/content/src/nsHTMLParamElement.cpp
Normal file
@@ -0,0 +1,171 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLParamElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLParamElementIID, NS_IDOMHTMLPARAMELEMENT_IID);
|
||||
|
||||
class nsHTMLParamElement : public nsIDOMHTMLParamElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLParamElement(nsIAtom* aTag);
|
||||
~nsHTMLParamElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLParamElement
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
NS_IMETHOD GetValue(nsString& aValue);
|
||||
NS_IMETHOD SetValue(const nsString& aValue);
|
||||
NS_IMETHOD GetValueType(nsString& aValueType);
|
||||
NS_IMETHOD SetValueType(const nsString& aValueType);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLParamElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLParamElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLParamElement::nsHTMLParamElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLParamElement::~nsHTMLParamElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLParamElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLParamElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLParamElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLParamElementIID)) {
|
||||
nsIDOMHTMLParamElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLParamElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLParamElement* it = new nsHTMLParamElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParamElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParamElement, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParamElement, Value, value, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLParamElement, ValueType, valuetype, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParamElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParamElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParamElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParamElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
173
mozilla/layout/html/content/src/nsHTMLPreElement.cpp
Normal file
173
mozilla/layout/html/content/src/nsHTMLPreElement.cpp
Normal file
@@ -0,0 +1,173 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLPreElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
// XXX missing nav attributes
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLPreElementIID, NS_IDOMHTMLPREELEMENT_IID);
|
||||
|
||||
class nsHTMLPreElement : public nsIDOMHTMLPreElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLPreElement(nsIAtom* aTag);
|
||||
~nsHTMLPreElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLPreElement
|
||||
NS_IMETHOD GetWidth(PRInt32* aWidth);
|
||||
NS_IMETHOD SetWidth(PRInt32 aWidth);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLPreElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLPreElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLPreElement::nsHTMLPreElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLPreElement::~nsHTMLPreElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLPreElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLPreElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLPreElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLPreElementIID)) {
|
||||
nsIDOMHTMLPreElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLPreElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLPreElement* it = new nsHTMLPreElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_INT_ATTR(nsHTMLPreElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLPreElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (nsHTMLGenericContent::ParseAlignValue(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLPreElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsHTMLGenericContent::AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLPreElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLPreElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
@@ -16,27 +16,27 @@
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLDListElement.h"
|
||||
#include "nsIDOMHTMLQuoteElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsHTMLGenericContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLDListElementIID, NS_IDOMHTMLDLISTELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLQuoteElementIID, NS_IDOMHTMLQUOTEELEMENT_IID);
|
||||
|
||||
class nsHTMLDList : public nsIDOMHTMLDListElement,
|
||||
class nsHTMLQuoteElement : public nsIDOMHTMLQuoteElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLDList(nsIAtom* aTag);
|
||||
~nsHTMLDList();
|
||||
nsHTMLQuoteElement(nsIAtom* aTag);
|
||||
~nsHTMLQuoteElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@@ -50,9 +50,9 @@ public:
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLDListElement
|
||||
NS_IMETHOD GetCompact(PRBool* aCompact);
|
||||
NS_IMETHOD SetCompact(PRBool aCompact);
|
||||
// nsIDOMHTMLQuoteElement
|
||||
NS_IMETHOD GetCite(nsString& aCite);
|
||||
NS_IMETHOD SetCite(const nsString& aCite);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
@@ -71,39 +71,39 @@ protected:
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLDList(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
NS_NewHTMLQuoteElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLDList(aTag);
|
||||
nsIHTMLContent* it = new nsHTMLQuoteElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLDList::nsHTMLDList(nsIAtom* aTag)
|
||||
nsHTMLQuoteElement::nsHTMLQuoteElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLDList::~nsHTMLDList()
|
||||
nsHTMLQuoteElement::~nsHTMLQuoteElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLDList)
|
||||
NS_IMPL_ADDREF(nsHTMLQuoteElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLDList)
|
||||
NS_IMPL_RELEASE(nsHTMLQuoteElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLDList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
nsHTMLQuoteElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLDListElementIID)) {
|
||||
nsIDOMHTMLDListElement* tmp = this;
|
||||
if (aIID.Equals(kIDOMHTMLQuoteElementIID)) {
|
||||
nsIDOMHTMLQuoteElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
@@ -112,9 +112,9 @@ nsHTMLDList::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDList::CloneNode(nsIDOMNode** aReturn)
|
||||
nsHTMLQuoteElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLDList* it = new nsHTMLDList(mInner.mTag);
|
||||
nsHTMLQuoteElement* it = new nsHTMLQuoteElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ nsHTMLDList::CloneNode(nsIDOMNode** aReturn)
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLDList, Compact, compact, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLQuoteElement, Cite, cite, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDList::StringToAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLQuoteElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ nsHTMLDList::StringToAttribute(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDList::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLQuoteElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
@@ -143,7 +143,7 @@ nsHTMLDList::AttributeToString(nsIAtom* aAttribute,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDList::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsHTMLQuoteElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
@@ -151,7 +151,7 @@ nsHTMLDList::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDList::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsHTMLQuoteElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
223
mozilla/layout/html/content/src/nsHTMLScriptElement.cpp
Normal file
223
mozilla/layout/html/content/src/nsHTMLScriptElement.cpp
Normal file
@@ -0,0 +1,223 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLScriptElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLScriptElementIID, NS_IDOMHTMLSCRIPTELEMENT_IID);
|
||||
|
||||
class nsHTMLScriptElement : public nsIDOMHTMLScriptElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLScriptElement(nsIAtom* aTag);
|
||||
~nsHTMLScriptElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLScriptElement
|
||||
NS_IMETHOD GetText(nsString& aText);
|
||||
NS_IMETHOD SetText(const nsString& aText);
|
||||
NS_IMETHOD GetHtmlFor(nsString& aHtmlFor);
|
||||
NS_IMETHOD SetHtmlFor(const nsString& aHtmlFor);
|
||||
NS_IMETHOD GetEvent(nsString& aEvent);
|
||||
NS_IMETHOD SetEvent(const nsString& aEvent);
|
||||
NS_IMETHOD GetCharset(nsString& aCharset);
|
||||
NS_IMETHOD SetCharset(const nsString& aCharset);
|
||||
NS_IMETHOD GetDefer(PRBool* aDefer);
|
||||
NS_IMETHOD SetDefer(PRBool aDefer);
|
||||
NS_IMETHOD GetSrc(nsString& aSrc);
|
||||
NS_IMETHOD SetSrc(const nsString& aSrc);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
nsString mText;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLScriptElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLScriptElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLScriptElement::nsHTMLScriptElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLScriptElement::~nsHTMLScriptElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLScriptElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLScriptElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLScriptElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLScriptElementIID)) {
|
||||
nsIDOMHTMLScriptElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLScriptElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLScriptElement* it = new nsHTMLScriptElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::GetText(nsString& aValue)
|
||||
{
|
||||
// XXX out of memory errors
|
||||
aValue = mText;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::SetText(const nsString& aValue)
|
||||
{
|
||||
// XXX out of memory errors
|
||||
mText = aValue;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::GetHtmlFor(nsString& aValue)
|
||||
{
|
||||
// XXX write me
|
||||
// mInner.GetAttribute(nsHTMLAtoms::charset, aValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::SetHtmlFor(const nsString& aValue)
|
||||
{
|
||||
// XXX write me
|
||||
// return mInner.SetAttr(nsHTMLAtoms::charset, aValue, eSetAttrNotify_None);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::GetEvent(nsString& aValue)
|
||||
{
|
||||
// XXX write me
|
||||
// mInner.GetAttribute(nsHTMLAtoms::charset, aValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::SetEvent(const nsString& aValue)
|
||||
{
|
||||
// XXX write me
|
||||
// return mInner.SetAttr(nsHTMLAtoms::charset, aValue, eSetAttrNotify_None);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLScriptElement, Charset, charset, eSetAttrNotify_None)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLScriptElement, Defer, defer, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLScriptElement, Src, src, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLScriptElement, Type, type, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLScriptElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
234
mozilla/layout/html/content/src/nsHTMLSelectElement.cpp
Normal file
234
mozilla/layout/html/content/src/nsHTMLSelectElement.cpp
Normal file
@@ -0,0 +1,234 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLSelectElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLSelectElementIID, NS_IDOMHTMLSELECTELEMENT_IID);
|
||||
|
||||
class nsHTMLSelectElement : public nsIDOMHTMLSelectElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLSelectElement(nsIAtom* aTag);
|
||||
~nsHTMLSelectElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLSelectElement
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
NS_IMETHOD GetSelectedIndex(PRInt32* aSelectedIndex);
|
||||
NS_IMETHOD SetSelectedIndex(PRInt32 aSelectedIndex);
|
||||
NS_IMETHOD GetValue(nsString& aValue);
|
||||
NS_IMETHOD SetValue(const nsString& aValue);
|
||||
NS_IMETHOD GetLength(PRInt32* aLength);
|
||||
NS_IMETHOD SetLength(PRInt32 aLength);
|
||||
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
|
||||
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm);
|
||||
NS_IMETHOD GetOptions(nsIDOMHTMLCollection** aOptions);
|
||||
NS_IMETHOD SetOptions(nsIDOMHTMLCollection* aOptions);
|
||||
NS_IMETHOD GetDisabled(PRBool* aDisabled);
|
||||
NS_IMETHOD SetDisabled(PRBool aDisabled);
|
||||
NS_IMETHOD GetMultiple(PRBool* aMultiple);
|
||||
NS_IMETHOD SetMultiple(PRBool aMultiple);
|
||||
NS_IMETHOD GetName(nsString& aName);
|
||||
NS_IMETHOD SetName(const nsString& aName);
|
||||
NS_IMETHOD GetSize(PRInt32* aSize);
|
||||
NS_IMETHOD SetSize(PRInt32 aSize);
|
||||
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
||||
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
||||
NS_IMETHOD Add(nsIDOMHTMLElement* aElement, nsIDOMHTMLElement* aBefore);
|
||||
NS_IMETHOD Remove(PRInt32 aIndex);
|
||||
NS_IMETHOD Blur();
|
||||
NS_IMETHOD Focus();
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLSelectElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLSelectElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLSelectElement::nsHTMLSelectElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLSelectElement::~nsHTMLSelectElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLSelectElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLSelectElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLSelectElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLSelectElementIID)) {
|
||||
nsIDOMHTMLSelectElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLSelectElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLSelectElement* it = new nsHTMLSelectElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
*aForm = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::SetForm(nsIDOMHTMLFormElement* aForm)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::GetOptions(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = nsnull;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::SetOptions(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Type, type, eSetAttrNotify_Restart)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, SelectedIndex, selectedindex, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Value, value, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, Length, length, eSetAttrNotify_Restart)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLSelectElement, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, Multiple, multiple, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLSelectElement, Name, name, eSetAttrNotify_Restart)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, Size, size, eSetAttrNotify_Render)
|
||||
NS_IMPL_INT_ATTR(nsHTMLSelectElement, TabIndex, tabindex, eSetAttrNotify_Render)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::Blur()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::Focus()
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSelectElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
167
mozilla/layout/html/content/src/nsHTMLStyleElement.cpp
Normal file
167
mozilla/layout/html/content/src/nsHTMLStyleElement.cpp
Normal file
@@ -0,0 +1,167 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLStyleElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
// XXX no SRC attribute
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLStyleElementIID, NS_IDOMHTMLSTYLEELEMENT_IID);
|
||||
|
||||
class nsHTMLStyleElement : public nsIDOMHTMLStyleElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLStyleElement(nsIAtom* aTag);
|
||||
~nsHTMLStyleElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLStyleElement
|
||||
NS_IMETHOD GetDisabled(PRBool* aDisabled);
|
||||
NS_IMETHOD SetDisabled(PRBool aDisabled);
|
||||
NS_IMETHOD GetMedia(nsString& aMedia);
|
||||
NS_IMETHOD SetMedia(const nsString& aMedia);
|
||||
NS_IMETHOD GetType(nsString& aType);
|
||||
NS_IMETHOD SetType(const nsString& aType);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericLeafContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLStyleElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLStyleElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLStyleElement::nsHTMLStyleElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLStyleElement::~nsHTMLStyleElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLStyleElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLStyleElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLStyleElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLStyleElementIID)) {
|
||||
nsIDOMHTMLStyleElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLStyleElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLStyleElement* it = new nsHTMLStyleElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLStyleElement, Disabled, disabled, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLStyleElement, Media, media, eSetAttrNotify_Restart)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLStyleElement, Type, type, eSetAttrNotify_Restart)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLStyleElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLStyleElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLStyleElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLStyleElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
162
mozilla/layout/html/content/src/nsHTMLTableCaptionElement.cpp
Normal file
162
mozilla/layout/html/content/src/nsHTMLTableCaptionElement.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLTableCaptionElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableCaptionElementIID, NS_IDOMHTMLTABLECAPTIONELEMENT_IID);
|
||||
|
||||
class nsHTMLTableCaptionElement : public nsIDOMHTMLTableCaptionElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableCaptionElement(nsIAtom* aTag);
|
||||
~nsHTMLTableCaptionElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLTableCaptionElement
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableCaptionElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableCaptionElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableCaptionElement::nsHTMLTableCaptionElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableCaptionElement::~nsHTMLTableCaptionElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableCaptionElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableCaptionElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCaptionElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableCaptionElementIID)) {
|
||||
nsIDOMHTMLTableCaptionElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCaptionElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableCaptionElement* it = new nsHTMLTableCaptionElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCaptionElement, Align, align, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCaptionElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCaptionElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCaptionElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCaptionElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
217
mozilla/layout/html/content/src/nsHTMLTableCellElement.cpp
Normal file
217
mozilla/layout/html/content/src/nsHTMLTableCellElement.cpp
Normal file
@@ -0,0 +1,217 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLTableCellElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableCellElementIID, NS_IDOMHTMLTABLECELLELEMENT_IID);
|
||||
|
||||
class nsHTMLTableCellElement : public nsIDOMHTMLTableCellElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableCellElement(nsIAtom* aTag);
|
||||
~nsHTMLTableCellElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLTableCellElement
|
||||
NS_IMETHOD GetCellIndex(PRInt32* aCellIndex);
|
||||
NS_IMETHOD SetCellIndex(PRInt32 aCellIndex);
|
||||
NS_IMETHOD GetAbbr(nsString& aAbbr);
|
||||
NS_IMETHOD SetAbbr(const nsString& aAbbr);
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetAxis(nsString& aAxis);
|
||||
NS_IMETHOD SetAxis(const nsString& aAxis);
|
||||
NS_IMETHOD GetBgColor(nsString& aBgColor);
|
||||
NS_IMETHOD SetBgColor(const nsString& aBgColor);
|
||||
NS_IMETHOD GetCh(nsString& aCh);
|
||||
NS_IMETHOD SetCh(const nsString& aCh);
|
||||
NS_IMETHOD GetChOff(nsString& aChOff);
|
||||
NS_IMETHOD SetChOff(const nsString& aChOff);
|
||||
NS_IMETHOD GetColSpan(PRInt32* aColSpan);
|
||||
NS_IMETHOD SetColSpan(PRInt32 aColSpan);
|
||||
NS_IMETHOD GetHeaders(nsString& aHeaders);
|
||||
NS_IMETHOD SetHeaders(const nsString& aHeaders);
|
||||
NS_IMETHOD GetHeight(nsString& aHeight);
|
||||
NS_IMETHOD SetHeight(const nsString& aHeight);
|
||||
NS_IMETHOD GetNoWrap(PRBool* aNoWrap);
|
||||
NS_IMETHOD SetNoWrap(PRBool aNoWrap);
|
||||
NS_IMETHOD GetRowSpan(PRInt32* aRowSpan);
|
||||
NS_IMETHOD SetRowSpan(PRInt32 aRowSpan);
|
||||
NS_IMETHOD GetScope(nsString& aScope);
|
||||
NS_IMETHOD SetScope(const nsString& aScope);
|
||||
NS_IMETHOD GetVAlign(nsString& aVAlign);
|
||||
NS_IMETHOD SetVAlign(const nsString& aVAlign);
|
||||
NS_IMETHOD GetWidth(nsString& aWidth);
|
||||
NS_IMETHOD SetWidth(const nsString& aWidth);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableCellElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableCellElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableCellElement::nsHTMLTableCellElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableCellElement::~nsHTMLTableCellElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableCellElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableCellElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCellElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableCellElementIID)) {
|
||||
nsIDOMHTMLTableCellElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableCellElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableCellElement* it = new nsHTMLTableCellElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCellElement::GetCellIndex(PRInt32* aCellIndex)
|
||||
{
|
||||
*aCellIndex = 0;/* XXX */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCellElement::SetCellIndex(PRInt32 aCellIndex)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Abbr, abbr, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Axis, axis, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Ch, ch, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, ChOff, choff, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLTableCellElement, ColSpan, colspan, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Headers, headers, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Height, height, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_BOOL_ATTR(nsHTMLTableCellElement, NoWrap, nowrap, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLTableCellElement, RowSpan, rowspan, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Scope, scope, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCellElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCellElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCellElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCellElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
177
mozilla/layout/html/content/src/nsHTMLTableColElement.cpp
Normal file
177
mozilla/layout/html/content/src/nsHTMLTableColElement.cpp
Normal file
@@ -0,0 +1,177 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLTableColElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableColElementIID, NS_IDOMHTMLTABLECOLELEMENT_IID);
|
||||
|
||||
class nsHTMLTableColElement : public nsIDOMHTMLTableColElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableColElement(nsIAtom* aTag);
|
||||
~nsHTMLTableColElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLTableColElement
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetCh(nsString& aCh);
|
||||
NS_IMETHOD SetCh(const nsString& aCh);
|
||||
NS_IMETHOD GetChOff(nsString& aChOff);
|
||||
NS_IMETHOD SetChOff(const nsString& aChOff);
|
||||
NS_IMETHOD GetSpan(PRInt32* aSpan);
|
||||
NS_IMETHOD SetSpan(PRInt32 aSpan);
|
||||
NS_IMETHOD GetVAlign(nsString& aVAlign);
|
||||
NS_IMETHOD SetVAlign(const nsString& aVAlign);
|
||||
NS_IMETHOD GetWidth(nsString& aWidth);
|
||||
NS_IMETHOD SetWidth(const nsString& aWidth);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableColElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableColElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableColElement::nsHTMLTableColElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableColElement::~nsHTMLTableColElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableColElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableColElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableColElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableColElementIID)) {
|
||||
nsIDOMHTMLTableColElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableColElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableColElement* it = new nsHTMLTableColElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Ch, ch, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, ChOff, choff, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_INT_ATTR(nsHTMLTableColElement, Span, span, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Width, width, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableColElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableColElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableColElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableColElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
321
mozilla/layout/html/content/src/nsHTMLTableElement.cpp
Normal file
321
mozilla/layout/html/content/src/nsHTMLTableElement.cpp
Normal file
@@ -0,0 +1,321 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLTableElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableElementIID, NS_IDOMHTMLTABLEELEMENT_IID);
|
||||
|
||||
class nsHTMLTableElement : public nsIDOMHTMLTableElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableElement(nsIAtom* aTag);
|
||||
~nsHTMLTableElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLTableElement
|
||||
NS_IMETHOD GetCaption(nsIDOMHTMLTableCaptionElement** aCaption);
|
||||
NS_IMETHOD SetCaption(nsIDOMHTMLTableCaptionElement* aCaption);
|
||||
NS_IMETHOD GetTHead(nsIDOMHTMLTableSectionElement** aTHead);
|
||||
NS_IMETHOD SetTHead(nsIDOMHTMLTableSectionElement* aTHead);
|
||||
NS_IMETHOD GetTFoot(nsIDOMHTMLTableSectionElement** aTFoot);
|
||||
NS_IMETHOD SetTFoot(nsIDOMHTMLTableSectionElement* aTFoot);
|
||||
NS_IMETHOD GetRows(nsIDOMHTMLCollection** aRows);
|
||||
NS_IMETHOD SetRows(nsIDOMHTMLCollection* aRows);
|
||||
NS_IMETHOD GetTBodies(nsIDOMHTMLCollection** aTBodies);
|
||||
NS_IMETHOD SetTBodies(nsIDOMHTMLCollection* aTBodies);
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetBgColor(nsString& aBgColor);
|
||||
NS_IMETHOD SetBgColor(const nsString& aBgColor);
|
||||
NS_IMETHOD GetBorder(nsString& aBorder);
|
||||
NS_IMETHOD SetBorder(const nsString& aBorder);
|
||||
NS_IMETHOD GetCellPadding(nsString& aCellPadding);
|
||||
NS_IMETHOD SetCellPadding(const nsString& aCellPadding);
|
||||
NS_IMETHOD GetCellSpacing(nsString& aCellSpacing);
|
||||
NS_IMETHOD SetCellSpacing(const nsString& aCellSpacing);
|
||||
NS_IMETHOD GetFrame(nsString& aFrame);
|
||||
NS_IMETHOD SetFrame(const nsString& aFrame);
|
||||
NS_IMETHOD GetRules(nsString& aRules);
|
||||
NS_IMETHOD SetRules(const nsString& aRules);
|
||||
NS_IMETHOD GetSummary(nsString& aSummary);
|
||||
NS_IMETHOD SetSummary(const nsString& aSummary);
|
||||
NS_IMETHOD GetWidth(nsString& aWidth);
|
||||
NS_IMETHOD SetWidth(const nsString& aWidth);
|
||||
NS_IMETHOD CreateTHead(nsIDOMHTMLElement** aReturn);
|
||||
NS_IMETHOD DeleteTHead();
|
||||
NS_IMETHOD CreateTFoot(nsIDOMHTMLElement** aReturn);
|
||||
NS_IMETHOD DeleteTFoot();
|
||||
NS_IMETHOD CreateCaption(nsIDOMHTMLElement** aReturn);
|
||||
NS_IMETHOD DeleteCaption();
|
||||
NS_IMETHOD InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aReturn);
|
||||
NS_IMETHOD DeleteRow(PRInt32 aIndex);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableElement::nsHTMLTableElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableElement::~nsHTMLTableElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableElementIID)) {
|
||||
nsIDOMHTMLTableElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableElement* it = new nsHTMLTableElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Border, border, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, CellPadding, cellpadding, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, CellSpacing, cellspacing, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Frame, frame, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Rules, rules, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Summary, summary, eSetAttrNotify_None)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableElement, Width, width, eSetAttrNotify_None)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::GetCaption(nsIDOMHTMLTableCaptionElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::SetCaption(nsIDOMHTMLTableCaptionElement* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::GetTHead(nsIDOMHTMLTableSectionElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::SetTHead(nsIDOMHTMLTableSectionElement* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::GetTFoot(nsIDOMHTMLTableSectionElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::SetTFoot(nsIDOMHTMLTableSectionElement* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::GetRows(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::SetRows(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::SetTBodies(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::CreateTHead(nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::DeleteTHead()
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::CreateTFoot(nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::DeleteTFoot()
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::CreateCaption(nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::DeleteCaption()
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = nsnull;
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::DeleteRow(PRInt32 aValue)
|
||||
{
|
||||
return NS_OK; // XXX write me
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
242
mozilla/layout/html/content/src/nsHTMLTableRowElement.cpp
Normal file
242
mozilla/layout/html/content/src/nsHTMLTableRowElement.cpp
Normal file
@@ -0,0 +1,242 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLTableRowElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableRowElementIID, NS_IDOMHTMLTABLEROWELEMENT_IID);
|
||||
|
||||
class nsHTMLTableRowElement : public nsIDOMHTMLTableRowElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableRowElement(nsIAtom* aTag);
|
||||
~nsHTMLTableRowElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLTableRowElement
|
||||
NS_IMETHOD GetRowIndex(PRInt32* aRowIndex);
|
||||
NS_IMETHOD SetRowIndex(PRInt32 aRowIndex);
|
||||
NS_IMETHOD GetSectionRowIndex(PRInt32* aSectionRowIndex);
|
||||
NS_IMETHOD SetSectionRowIndex(PRInt32 aSectionRowIndex);
|
||||
NS_IMETHOD GetCells(nsIDOMHTMLCollection** aCells);
|
||||
NS_IMETHOD SetCells(nsIDOMHTMLCollection* aCells);
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetBgColor(nsString& aBgColor);
|
||||
NS_IMETHOD SetBgColor(const nsString& aBgColor);
|
||||
NS_IMETHOD GetCh(nsString& aCh);
|
||||
NS_IMETHOD SetCh(const nsString& aCh);
|
||||
NS_IMETHOD GetChOff(nsString& aChOff);
|
||||
NS_IMETHOD SetChOff(const nsString& aChOff);
|
||||
NS_IMETHOD GetVAlign(nsString& aVAlign);
|
||||
NS_IMETHOD SetVAlign(const nsString& aVAlign);
|
||||
NS_IMETHOD InsertCell(PRInt32 aIndex, nsIDOMHTMLElement** aReturn);
|
||||
NS_IMETHOD DeleteCell(PRInt32 aIndex);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableRowElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableRowElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableRowElement::nsHTMLTableRowElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableRowElement::~nsHTMLTableRowElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableRowElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableRowElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableRowElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableRowElementIID)) {
|
||||
nsIDOMHTMLTableRowElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableRowElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableRowElement* it = new nsHTMLTableRowElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::GetRowIndex(PRInt32* aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::SetRowIndex(PRInt32 aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::GetSectionRowIndex(PRInt32* aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::SetSectionRowIndex(PRInt32 aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::GetCells(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::SetCells(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::InsertCell(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::DeleteCell(PRInt32 aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, BgColor, bgcolor, eSetAttrNotify_Render)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, Ch, ch, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, ChOff, choff, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
199
mozilla/layout/html/content/src/nsHTMLTableSectionElement.cpp
Normal file
199
mozilla/layout/html/content/src/nsHTMLTableSectionElement.cpp
Normal file
@@ -0,0 +1,199 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications
|
||||
* Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
* Netscape Communications Corporation. All Rights Reserved.
|
||||
*/
|
||||
#include "nsIDOMHTMLTableSectionElement.h"
|
||||
#include "nsIScriptObjectOwner.h"
|
||||
#include "nsIDOMEventReceiver.h"
|
||||
#include "nsIHTMLContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIPresContext.h"
|
||||
|
||||
static NS_DEFINE_IID(kIDOMHTMLTableSectionElementIID, NS_IDOMHTMLTABLESECTIONELEMENT_IID);
|
||||
|
||||
class nsHTMLTableSectionElement : public nsIDOMHTMLTableSectionElement,
|
||||
public nsIScriptObjectOwner,
|
||||
public nsIDOMEventReceiver,
|
||||
public nsIHTMLContent
|
||||
{
|
||||
public:
|
||||
nsHTMLTableSectionElement(nsIAtom* aTag);
|
||||
~nsHTMLTableSectionElement();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDOMNode
|
||||
NS_IMPL_IDOMNODE_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_IMPL_IDOMELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_IMPL_IDOMHTMLELEMENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMHTMLTableSectionElement
|
||||
NS_IMETHOD GetAlign(nsString& aAlign);
|
||||
NS_IMETHOD SetAlign(const nsString& aAlign);
|
||||
NS_IMETHOD GetVAlign(nsString& aVAlign);
|
||||
NS_IMETHOD SetVAlign(const nsString& aVAlign);
|
||||
NS_IMETHOD GetRows(nsIDOMHTMLCollection** aRows);
|
||||
NS_IMETHOD SetRows(nsIDOMHTMLCollection* aRows);
|
||||
NS_IMETHOD InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aReturn);
|
||||
NS_IMETHOD DeleteRow(PRInt32 aIndex);
|
||||
|
||||
// nsIScriptObjectOwner
|
||||
NS_IMPL_ISCRIPTOBJECTOWNER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIDOMEventReceiver
|
||||
NS_IMPL_IDOMEVENTRECEIVER_USING_GENERIC(mInner)
|
||||
|
||||
// nsIContent
|
||||
NS_IMPL_ICONTENT_USING_GENERIC(mInner)
|
||||
|
||||
// nsIHTMLContent
|
||||
NS_IMPL_IHTMLCONTENT_USING_GENERIC(mInner)
|
||||
|
||||
protected:
|
||||
nsHTMLGenericContainerContent mInner;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTableSectionElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTableSectionElement(aTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTableSectionElement::nsHTMLTableSectionElement(nsIAtom* aTag)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
mInner.Init(this, aTag);
|
||||
}
|
||||
|
||||
nsHTMLTableSectionElement::~nsHTMLTableSectionElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsHTMLTableSectionElement)
|
||||
|
||||
NS_IMPL_RELEASE(nsHTMLTableSectionElement)
|
||||
|
||||
nsresult
|
||||
nsHTMLTableSectionElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_IMPL_HTML_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this)
|
||||
if (aIID.Equals(kIDOMHTMLTableSectionElementIID)) {
|
||||
nsIDOMHTMLTableSectionElement* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
mRefCnt++;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTableSectionElement::CloneNode(nsIDOMNode** aReturn)
|
||||
{
|
||||
nsHTMLTableSectionElement* it = new nsHTMLTableSectionElement(mInner.mTag);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mInner.CopyInnerTo(this, &it->mInner);
|
||||
return it->QueryInterface(kIDOMNodeIID, (void**) aReturn);
|
||||
}
|
||||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, Align, align, eSetAttrNotify_Reflow)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, VAlign, valign, eSetAttrNotify_Reflow)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSectionElement::SetRows(nsIDOMHTMLCollection* aValue)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSectionElement::InsertRow(PRInt32 aIndex, nsIDOMHTMLElement** aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSectionElement::DeleteRow(PRInt32 aIndex)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSectionElement::StringToAttribute(nsIAtom* aAttribute,
|
||||
const nsString& aValue,
|
||||
nsHTMLValue& aResult)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSectionElement::AttributeToString(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue,
|
||||
nsString& aResult) const
|
||||
{
|
||||
// XXX write me
|
||||
return mInner.AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSectionElement::MapAttributesInto(nsIStyleContext* aContext,
|
||||
nsIPresContext* aPresContext)
|
||||
{
|
||||
// XXX write me
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSectionElement::HandleDOMEvent(nsIPresContext& aPresContext,
|
||||
nsEvent* aEvent,
|
||||
nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
nsEventStatus& aEventStatus)
|
||||
{
|
||||
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
|
||||
aFlags, aEventStatus);
|
||||
}
|
||||
152
mozilla/layout/html/content/src/nsHTMLTitleElement.cpp
Normal file
152
mozilla/layout/html/content/src/nsHTMLTitleElement.cpp
Normal file
@@ -0,0 +1,152 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsHTMLContainer.h"
|
||||
#include "nsFrame.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsXIFConverter.h"
|
||||
|
||||
#define nsHTMLTitleElementSuper nsHTMLTagContent
|
||||
|
||||
class nsHTMLTitleElement : public nsHTMLTitleElementSuper {
|
||||
public:
|
||||
nsHTMLTitleElement(nsIAtom* aTag, const nsString& aTitle);
|
||||
|
||||
NS_IMETHOD CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult);
|
||||
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
|
||||
|
||||
|
||||
NS_IMETHOD BeginConvertToXIF(nsXIFConverter& aConverter) const;
|
||||
NS_IMETHOD ConvertContentToXIF(nsXIFConverter& aConverter) const;
|
||||
NS_IMETHOD FinishConvertToXIF(nsXIFConverter& aConverter) const;
|
||||
|
||||
protected:
|
||||
virtual ~nsHTMLTitleElement();
|
||||
nsString mTitle;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLTitle(nsIHTMLContent** aInstancePtrResult,
|
||||
nsIAtom* aTag, const nsString& aTitle)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIHTMLContent* it = new nsHTMLTitleElement(aTag, aTitle);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult);
|
||||
}
|
||||
|
||||
nsHTMLTitleElement::nsHTMLTitleElement(nsIAtom* aTag, const nsString& aTitle)
|
||||
: nsHTMLTitleElementSuper(aTag), mTitle(aTitle)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLTitleElement::~nsHTMLTitleElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitleElement::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aResult)
|
||||
{
|
||||
nsIFrame* frame;
|
||||
nsFrame::NewFrame(&frame, this, aParentFrame);
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
frame->SetStyleContext(aPresContext, aStyleContext);
|
||||
aResult = frame;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitleElement::List(FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
NS_PRECONDITION(nsnull != mDocument, "bad content");
|
||||
|
||||
PRInt32 index;
|
||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
|
||||
nsIAtom* tag;
|
||||
GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
|
||||
ListAttributes(out);
|
||||
|
||||
fprintf(out, " RefCount=%d<", mRefCnt);
|
||||
fputs(mTitle, out);
|
||||
fputs(">\n", out);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate the content object into the (XIF) XML Interchange Format
|
||||
* XIF is an intermediate form of the content model, the buffer
|
||||
* will then be parsed into any number of formats including HTML, TXT, etc.
|
||||
* These methods must be called in the following order:
|
||||
|
||||
BeginConvertToXIF
|
||||
ConvertContentToXIF
|
||||
EndConvertToXIF
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitleElement::BeginConvertToXIF(nsXIFConverter& aConverter) const
|
||||
{
|
||||
if (nsnull != mTag)
|
||||
{
|
||||
nsAutoString name;
|
||||
mTag->ToString(name);
|
||||
aConverter.BeginContainer(name);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitleElement::ConvertContentToXIF(nsXIFConverter& aConverter) const
|
||||
{
|
||||
aConverter.AddContent(mTitle);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTitleElement::FinishConvertToXIF(nsXIFConverter& aConverter) const
|
||||
{
|
||||
if (nsnull != mTag)
|
||||
{
|
||||
nsAutoString name;
|
||||
mTag->ToString(name);
|
||||
aConverter.EndContainer(name);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user