2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2001-11-17 02:23:22 +00:00
|
|
|
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */
|
2001-09-25 01:32:19 +00:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1998-08-28 23:27:19 +00:00
|
|
|
*
|
2001-09-25 01:32:19 +00:00
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.1 (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/
|
1998-08-28 23:27:19 +00:00
|
|
|
*
|
2001-09-25 01:32:19 +00:00
|
|
|
* 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.
|
1998-08-28 23:27:19 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator client code.
|
|
|
|
*
|
2001-09-25 01:32:19 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2001-09-25 01:32:19 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-09-03 22:21:32 +00:00
|
|
|
#ifndef nsGenericHTMLElement_h___
|
|
|
|
#define nsGenericHTMLElement_h___
|
1998-08-28 23:27:19 +00:00
|
|
|
|
1998-11-11 22:06:16 +00:00
|
|
|
#include "nsGenericElement.h"
|
1998-12-18 17:34:34 +00:00
|
|
|
#include "nsHTMLParts.h"
|
1998-08-28 23:27:19 +00:00
|
|
|
#include "nsIDOMHTMLElement.h"
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsHTMLValue.h"
|
|
|
|
#include "nsVoidArray.h"
|
2002-05-20 22:47:02 +00:00
|
|
|
#include "nsINameSpaceManager.h" // for kNameSpaceID_None
|
2000-12-23 10:56:31 +00:00
|
|
|
#include "nsIFormControl.h"
|
1998-08-28 23:27:19 +00:00
|
|
|
|
2000-01-14 09:28:54 +00:00
|
|
|
#include "nsIStatefulFrame.h"
|
|
|
|
|
1998-10-20 17:07:23 +00:00
|
|
|
class nsIDOMAttr;
|
1998-08-28 23:27:19 +00:00
|
|
|
class nsIDOMEventListener;
|
|
|
|
class nsIDOMNodeList;
|
|
|
|
class nsIFrame;
|
2002-03-27 00:13:57 +00:00
|
|
|
class nsHTMLAttributes;
|
1999-07-07 01:24:40 +00:00
|
|
|
class nsIHTMLMappedAttributes;
|
1998-08-28 23:27:19 +00:00
|
|
|
class nsIHTMLContent;
|
|
|
|
class nsIStyleRule;
|
|
|
|
class nsISupportsArray;
|
1998-09-09 21:02:42 +00:00
|
|
|
class nsChildContentList;
|
1998-10-06 01:39:33 +00:00
|
|
|
class nsDOMCSSDeclaration;
|
1998-10-20 17:07:23 +00:00
|
|
|
class nsIDOMCSSStyleDeclaration;
|
1999-06-23 03:29:44 +00:00
|
|
|
class nsIURI;
|
1999-02-01 18:44:59 +00:00
|
|
|
class nsIFormControlFrame;
|
1999-07-28 05:26:55 +00:00
|
|
|
class nsIForm;
|
2000-01-14 09:28:54 +00:00
|
|
|
class nsIPresState;
|
2001-10-17 01:17:47 +00:00
|
|
|
class nsIScrollableView;
|
2002-03-31 10:14:01 +00:00
|
|
|
class nsILayoutHistoryState;
|
2001-07-16 02:40:48 +00:00
|
|
|
struct nsRect;
|
2003-01-22 06:25:24 +00:00
|
|
|
struct nsSize;
|
1998-09-25 00:51:45 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* A common superclass for HTML elements
|
|
|
|
*/
|
2001-10-30 10:14:06 +00:00
|
|
|
class nsGenericHTMLElement : public nsGenericElement
|
|
|
|
{
|
1998-09-04 23:03:16 +00:00
|
|
|
public:
|
1998-09-03 22:21:32 +00:00
|
|
|
nsGenericHTMLElement();
|
2000-12-23 10:56:31 +00:00
|
|
|
virtual ~nsGenericHTMLElement();
|
1998-08-28 23:27:19 +00:00
|
|
|
|
2001-10-30 10:14:06 +00:00
|
|
|
#ifdef GATHER_ELEMENT_USEAGE_STATISTICS
|
|
|
|
nsresult Init(nsINodeInfo *aNodeInfo);
|
|
|
|
#endif
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/** Call on shutdown to release globals */
|
2001-11-07 07:06:31 +00:00
|
|
|
static void Shutdown();
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
// nsISupports
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Handle QI for the standard DOM interfaces (DOMNode, DOMElement,
|
|
|
|
* DOMHTMLElement) and handles tearoffs for other standard interfaces.
|
|
|
|
* @param aElement the element as nsIDOMHTMLElement*
|
|
|
|
* @param aIID the IID to QI to
|
|
|
|
* @param aInstancePtr the QI'd method [OUT]
|
|
|
|
* @see nsGenericHTMLElementTearoff
|
|
|
|
*/
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
nsresult DOMQueryInterface(nsIDOMHTMLElement *aElement, REFNSIID aIID,
|
|
|
|
void **aInstancePtr);
|
2000-12-23 10:56:31 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
// From nsGenericElement
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD CopyInnerTo(nsIContent* aSrcContent,
|
|
|
|
nsGenericHTMLElement* aDest,
|
|
|
|
PRBool aDeep);
|
1999-01-14 23:14:02 +00:00
|
|
|
|
1999-05-11 20:21:45 +00:00
|
|
|
// Implementation for nsIDOMNode
|
2002-03-23 23:13:20 +00:00
|
|
|
NS_METHOD GetNodeName(nsAString& aNodeName);
|
|
|
|
NS_METHOD GetLocalName(nsAString& aLocalName);
|
1999-05-11 20:21:45 +00:00
|
|
|
|
1998-12-20 01:21:23 +00:00
|
|
|
// Implementation for nsIDOMElement
|
2002-03-23 23:13:20 +00:00
|
|
|
NS_METHOD GetAttribute(const nsAString& aName,
|
|
|
|
nsAString& aReturn)
|
1999-01-12 16:37:24 +00:00
|
|
|
{
|
|
|
|
return nsGenericElement::GetAttribute(aName, aReturn);
|
|
|
|
}
|
2002-03-23 23:13:20 +00:00
|
|
|
NS_METHOD SetAttribute(const nsAString& aName,
|
|
|
|
const nsAString& aValue)
|
1999-01-12 16:37:24 +00:00
|
|
|
{
|
|
|
|
return nsGenericElement::SetAttribute(aName, aValue);
|
|
|
|
}
|
2002-03-23 23:13:20 +00:00
|
|
|
NS_METHOD GetTagName(nsAString& aTagName);
|
|
|
|
NS_METHOD GetElementsByTagName(const nsAString& aTagname,
|
2000-12-23 10:56:31 +00:00
|
|
|
nsIDOMNodeList** aReturn);
|
1998-12-20 01:21:23 +00:00
|
|
|
|
1998-08-28 23:27:19 +00:00
|
|
|
// Implementation for nsIDOMHTMLElement
|
2002-03-23 23:13:20 +00:00
|
|
|
nsresult GetId(nsAString& aId);
|
|
|
|
nsresult SetId(const nsAString& aId);
|
|
|
|
nsresult GetTitle(nsAString& aTitle);
|
|
|
|
nsresult SetTitle(const nsAString& aTitle);
|
|
|
|
nsresult GetLang(nsAString& aLang);
|
|
|
|
nsresult SetLang(const nsAString& aLang);
|
|
|
|
nsresult GetDir(nsAString& aDir);
|
|
|
|
nsresult SetDir(const nsAString& aDir);
|
|
|
|
nsresult GetClassName(nsAString& aClassName);
|
|
|
|
nsresult SetClassName(const nsAString& aClassName);
|
2001-10-17 01:17:47 +00:00
|
|
|
nsresult GetStyle(nsIDOMCSSStyleDeclaration** aStyle);
|
|
|
|
nsresult GetOffsetTop(PRInt32* aOffsetTop);
|
|
|
|
nsresult GetOffsetLeft(PRInt32* aOffsetLeft);
|
|
|
|
nsresult GetOffsetWidth(PRInt32* aOffsetWidth);
|
|
|
|
nsresult GetOffsetHeight(PRInt32* aOffsetHeight);
|
|
|
|
nsresult GetOffsetParent(nsIDOMElement** aOffsetParent);
|
2002-07-04 04:30:25 +00:00
|
|
|
virtual nsresult GetInnerHTML(nsAString& aInnerHTML);
|
|
|
|
virtual nsresult SetInnerHTML(const nsAString& aInnerHTML);
|
2001-10-17 01:17:47 +00:00
|
|
|
nsresult GetScrollTop(PRInt32* aScrollTop);
|
|
|
|
nsresult SetScrollTop(PRInt32 aScrollTop);
|
|
|
|
nsresult GetScrollLeft(PRInt32* aScrollLeft);
|
|
|
|
nsresult SetScrollLeft(PRInt32 aScrollLeft);
|
|
|
|
nsresult GetScrollHeight(PRInt32* aScrollHeight);
|
|
|
|
nsresult GetScrollWidth(PRInt32* aScrollWidth);
|
|
|
|
nsresult GetClientHeight(PRInt32* aClientHeight);
|
|
|
|
nsresult GetClientWidth(PRInt32* aClientWidth);
|
|
|
|
nsresult ScrollIntoView(PRBool aTop);
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Get the frame's offset information for offsetTop/Left/Width/Height.
|
|
|
|
* @param aRect the offset information [OUT]
|
|
|
|
* @param aOffsetParent the parent the offset is relative to (offsetParent)
|
|
|
|
* [OUT]
|
|
|
|
*/
|
2001-11-29 05:08:25 +00:00
|
|
|
nsresult GetOffsetRect(nsRect& aRect,
|
2000-12-23 10:56:31 +00:00
|
|
|
nsIContent** aOffsetParent);
|
2001-10-17 01:17:47 +00:00
|
|
|
nsresult GetScrollInfo(nsIScrollableView **aScrollableView, float *aP2T,
|
2003-01-22 06:25:24 +00:00
|
|
|
float *aT2P, nsIFrame **aFrame = nsnull);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an element's client info if the element doesn't have a
|
|
|
|
* scrollable view.
|
|
|
|
* @param aFrame the frame for which to get the client area size
|
|
|
|
* @return the size of the frame's client area
|
|
|
|
*/
|
|
|
|
static const nsSize GetClientAreaSize(nsIFrame *aFrame);
|
2000-05-12 13:46:59 +00:00
|
|
|
|
1998-08-28 23:27:19 +00:00
|
|
|
// Implementation for nsIContent
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD SetDocument(nsIDocument* aDocument, PRBool aDeep,
|
|
|
|
PRBool aCompileEventHandlers);
|
2003-06-13 20:10:01 +00:00
|
|
|
NS_IMETHOD GetNameSpaceID(PRInt32* aID) const;
|
2002-03-23 23:13:20 +00:00
|
|
|
NS_IMETHOD NormalizeAttrString(const nsAString& aStr,
|
2003-06-13 20:10:01 +00:00
|
|
|
nsINodeInfo** aNodeInfo);
|
2001-08-17 08:14:14 +00:00
|
|
|
NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
2002-03-23 23:13:20 +00:00
|
|
|
const nsAString& aValue,
|
2000-12-23 10:56:31 +00:00
|
|
|
PRBool aNotify);
|
2001-08-17 08:14:14 +00:00
|
|
|
NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo,
|
2002-03-23 23:13:20 +00:00
|
|
|
const nsAString& aValue,
|
2001-08-17 08:14:14 +00:00
|
|
|
PRBool aNotify);
|
|
|
|
NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult) const;
|
2001-08-17 08:14:14 +00:00
|
|
|
NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
2003-06-13 20:10:01 +00:00
|
|
|
nsIAtom** aPrefix, nsAString& aResult) const;
|
2001-12-11 02:57:52 +00:00
|
|
|
NS_IMETHOD_(PRBool) HasAttr(PRInt32 aNameSpaceID, nsIAtom* aName) const;
|
2001-08-17 08:14:14 +00:00
|
|
|
NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
|
|
|
PRBool aNotify);
|
|
|
|
NS_IMETHOD GetAttrNameAt(PRInt32 aIndex,
|
2003-06-13 20:10:01 +00:00
|
|
|
PRInt32* aNameSpaceID,
|
|
|
|
nsIAtom** aName,
|
|
|
|
nsIAtom** aPrefix) const;
|
2001-08-17 08:14:14 +00:00
|
|
|
NS_IMETHOD GetAttrCount(PRInt32& aResult) const;
|
2001-10-16 05:31:36 +00:00
|
|
|
#ifdef DEBUG
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
|
|
|
|
NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const;
|
2001-10-16 05:31:36 +00:00
|
|
|
#endif
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
NS_IMETHOD_(PRBool) IsContentOfType(PRUint32 aFlags);
|
2000-12-23 10:56:31 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Standard anchor HandleDOMEvent, used by A, AREA and LINK (parameters
|
|
|
|
* are the same as HandleDOMEvent)
|
|
|
|
*/
|
2003-06-17 16:22:51 +00:00
|
|
|
nsresult HandleDOMEventForAnchors(nsIPresContext* aPresContext,
|
2000-02-11 01:24:59 +00:00
|
|
|
nsEvent* aEvent,
|
|
|
|
nsIDOMEvent** aDOMEvent,
|
|
|
|
PRUint32 aFlags,
|
|
|
|
nsEventStatus* aEventStatus);
|
1998-08-28 23:27:19 +00:00
|
|
|
|
2003-06-17 16:22:51 +00:00
|
|
|
// Used by A, AREA, LINK, and STYLE.
|
|
|
|
// Callers must hold a reference to nsHTMLUtils's global reference count.
|
2003-07-01 02:59:54 +00:00
|
|
|
nsresult GetHrefURIForAnchors(nsIURI** aURI);
|
2003-06-17 16:22:51 +00:00
|
|
|
|
1998-08-28 23:27:19 +00:00
|
|
|
// Implementation for nsIHTMLContent
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD SetHTMLAttribute(nsIAtom* aAttribute, const nsHTMLValue& aValue,
|
|
|
|
PRBool aNotify);
|
|
|
|
NS_IMETHOD GetHTMLAttribute(nsIAtom* aAttribute, nsHTMLValue& aValue) const;
|
2003-06-13 20:10:01 +00:00
|
|
|
NS_IMETHOD GetID(nsIAtom** aResult) const;
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD GetClasses(nsVoidArray& aArray) const;
|
2002-11-25 11:21:22 +00:00
|
|
|
NS_IMETHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const;
|
2001-10-24 00:01:09 +00:00
|
|
|
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
|
2002-08-16 11:29:20 +00:00
|
|
|
NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule);
|
2003-06-13 20:10:01 +00:00
|
|
|
NS_IMETHOD GetBaseURL(nsIURI** aBaseURL) const;
|
2002-03-23 23:13:20 +00:00
|
|
|
NS_IMETHOD GetBaseTarget(nsAString& aBaseTarget) const;
|
1998-08-28 23:27:19 +00:00
|
|
|
|
|
|
|
//----------------------------------------
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
|
|
|
const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult) const;
|
2003-07-11 21:16:12 +00:00
|
|
|
NS_IMETHOD_(PRBool) HasAttributeDependentStyle(const nsIAtom* aAttribute) const;
|
2001-05-31 22:19:43 +00:00
|
|
|
NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const;
|
1998-08-28 23:27:19 +00:00
|
|
|
|
2001-10-16 05:31:36 +00:00
|
|
|
#ifdef DEBUG
|
1998-08-28 23:27:19 +00:00
|
|
|
void ListAttributes(FILE* out) const;
|
2001-10-16 05:31:36 +00:00
|
|
|
#endif
|
2000-12-23 10:56:31 +00:00
|
|
|
|
2002-05-16 18:26:05 +00:00
|
|
|
/**
|
|
|
|
* Get the primary form control frame for this content (see
|
|
|
|
* GetFormControlFrameFor)
|
|
|
|
*
|
|
|
|
* @param aFlushContent whether to flush the content sink
|
2002-07-28 01:47:59 +00:00
|
|
|
* @return the primary form control frame (or null)
|
2002-05-16 18:26:05 +00:00
|
|
|
*/
|
|
|
|
nsIFormControlFrame* GetFormControlFrame(PRBool aFlushContent)
|
2001-12-12 07:31:15 +00:00
|
|
|
{
|
2002-05-16 18:26:05 +00:00
|
|
|
if (!mDocument) {
|
2001-12-12 07:31:15 +00:00
|
|
|
return nsnull;
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
|
2001-12-12 07:31:15 +00:00
|
|
|
return GetFormControlFrameFor(this, mDocument, aFlushContent);
|
|
|
|
}
|
1998-08-29 03:16:46 +00:00
|
|
|
|
2002-05-16 18:26:05 +00:00
|
|
|
/**
|
|
|
|
* Get the primary frame for this content (see GetPrimaryFrameFor)
|
|
|
|
*
|
|
|
|
* @param aFlushContent whether to flush the content sink
|
|
|
|
* @return the primary frame
|
|
|
|
*/
|
|
|
|
nsIFrame* GetPrimaryFrame(PRBool aFlushContent)
|
|
|
|
{
|
|
|
|
if (!mDocument) {
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GetPrimaryFrameFor(this, mDocument, aFlushContent);
|
|
|
|
}
|
|
|
|
|
1998-08-28 23:27:19 +00:00
|
|
|
//----------------------------------------
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Parse common attributes (currently dir and lang, may be more)
|
|
|
|
*
|
|
|
|
* @param aAttribute the attr to parse
|
|
|
|
* @param aValue the value to parse
|
|
|
|
* @param aResult the resulting HTMLValue
|
|
|
|
* @return whether the value was parsed
|
|
|
|
*/
|
1999-07-28 21:41:16 +00:00
|
|
|
static PRBool ParseCommonAttribute(nsIAtom* aAttribute,
|
2002-03-23 23:13:20 +00:00
|
|
|
const nsAString& aValue,
|
1999-07-28 21:41:16 +00:00
|
|
|
nsHTMLValue& aResult);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Parse an alignment attribute (top/middle/bottom/baseline)
|
|
|
|
*
|
|
|
|
* @param aString the string to parse
|
|
|
|
* @param aResult the resulting HTMLValue
|
|
|
|
* @return whether the value was parsed
|
|
|
|
*/
|
2002-03-23 23:13:20 +00:00
|
|
|
static PRBool ParseAlignValue(const nsAString& aString,
|
2000-12-23 10:56:31 +00:00
|
|
|
nsHTMLValue& aResult);
|
1998-09-01 01:36:11 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Parse a div align string to value (left/right/center/middle/justify)
|
|
|
|
*
|
|
|
|
* @param aString the string to parse
|
|
|
|
* @param aResult the resulting HTMLValue
|
|
|
|
* @return whether the value was parsed
|
|
|
|
*/
|
2002-03-23 23:13:20 +00:00
|
|
|
PRBool ParseDivAlignValue(const nsAString& aString,
|
1999-08-27 21:42:08 +00:00
|
|
|
nsHTMLValue& aResult) const;
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a div align value to string
|
|
|
|
*
|
|
|
|
* @param aValue the value to convert
|
|
|
|
* @param aResult the resulting string
|
|
|
|
* @return whether the value was converted
|
|
|
|
*/
|
1999-09-21 00:12:09 +00:00
|
|
|
PRBool DivAlignValueToString(const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult) const;
|
1998-09-03 22:21:32 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a table halign string to value (left/right/center/char/justify)
|
|
|
|
*
|
|
|
|
* @param aString the string to parse
|
|
|
|
* @param aResult the resulting HTMLValue
|
|
|
|
* @return whether the value was parsed
|
|
|
|
*/
|
2002-03-23 23:13:20 +00:00
|
|
|
PRBool ParseTableHAlignValue(const nsAString& aString,
|
1999-09-21 00:12:09 +00:00
|
|
|
nsHTMLValue& aResult) const;
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a table halign value to string
|
|
|
|
*
|
|
|
|
* @param aValue the value to convert
|
|
|
|
* @param aResult the resulting string
|
|
|
|
* @return whether the value was converted
|
|
|
|
*/
|
1999-09-21 00:12:09 +00:00
|
|
|
PRBool TableHAlignValueToString(const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult) const;
|
1999-09-21 00:12:09 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a table cell halign string to value
|
|
|
|
*
|
|
|
|
* @param aString the string to parse
|
|
|
|
* @param aResult the resulting HTMLValue
|
|
|
|
* @return whether the value was parsed
|
|
|
|
*/
|
2002-03-23 23:13:20 +00:00
|
|
|
PRBool ParseTableCellHAlignValue(const nsAString& aString,
|
1999-09-21 00:12:09 +00:00
|
|
|
nsHTMLValue& aResult) const;
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a table cell halign value to string
|
|
|
|
*
|
|
|
|
* @param aValue the value to convert
|
|
|
|
* @param aResult the resulting string
|
|
|
|
* @return whether the value was converted
|
|
|
|
*/
|
1999-09-21 00:12:09 +00:00
|
|
|
PRBool TableCellHAlignValueToString(const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult) const;
|
1998-09-15 17:58:24 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a table valign string to value (left/right/center/char/justify/
|
|
|
|
* abscenter/absmiddle/middle)
|
|
|
|
*
|
|
|
|
* @param aString the string to parse
|
|
|
|
* @param aResult the resulting HTMLValue
|
|
|
|
* @return whether the value was parsed
|
|
|
|
*/
|
2002-03-23 23:13:20 +00:00
|
|
|
static PRBool ParseTableVAlignValue(const nsAString& aString,
|
1998-09-15 17:58:24 +00:00
|
|
|
nsHTMLValue& aResult);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a table valign value to string
|
|
|
|
*
|
|
|
|
* @param aValue the value to convert
|
|
|
|
* @param aResult the resulting string
|
|
|
|
* @return whether the value was converted
|
|
|
|
*/
|
1998-09-15 17:58:24 +00:00
|
|
|
static PRBool TableVAlignValueToString(const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult);
|
1998-09-15 17:58:24 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert an align value to string (left/right/texttop/baseline/center/
|
|
|
|
* bottom/top/middle/absbottom/abscenter/absmiddle)
|
|
|
|
*
|
|
|
|
* @param aValue the value to convert
|
|
|
|
* @param aResult the resulting string
|
|
|
|
* @return whether the value was converted
|
|
|
|
*/
|
1998-09-01 01:36:11 +00:00
|
|
|
static PRBool AlignValueToString(const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult);
|
1998-09-01 01:36:11 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a valign value to string
|
|
|
|
*
|
|
|
|
* @param aValue the value to convert
|
|
|
|
* @param aResult the resulting string
|
|
|
|
* @return whether the value was converted
|
|
|
|
*/
|
2002-01-18 20:09:04 +00:00
|
|
|
static PRBool VAlignValueToString(const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult);
|
2002-01-18 20:09:04 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert an image attribute to value (width, height, hspace, vspace, border)
|
|
|
|
*
|
|
|
|
* @param aAttribute the attribute to parse
|
|
|
|
* @param aString the string to parse
|
|
|
|
* @param aResult the resulting HTMLValue
|
|
|
|
* @return whether the value was parsed
|
|
|
|
*/
|
1998-09-01 01:36:11 +00:00
|
|
|
static PRBool ParseImageAttribute(nsIAtom* aAttribute,
|
2002-03-23 23:13:20 +00:00
|
|
|
const nsAString& aString,
|
1998-09-01 01:36:11 +00:00
|
|
|
nsHTMLValue& aResult);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert an image attribute to string
|
|
|
|
*
|
|
|
|
* @param aAttribute the attribute to parse
|
|
|
|
* @param aValue the value to convert
|
|
|
|
* @param aResult the resulting string
|
|
|
|
* @return whether the value was converted
|
|
|
|
*/
|
1998-09-01 01:36:11 +00:00
|
|
|
static PRBool ImageAttributeToString(nsIAtom* aAttribute,
|
|
|
|
const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult);
|
1998-09-01 01:36:11 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a frameborder string to value (yes/no/1/0)
|
|
|
|
*
|
|
|
|
* @param aString the string to parse
|
|
|
|
* @param aResult the resulting HTMLValue
|
|
|
|
* @return whether the value was parsed
|
|
|
|
*/
|
2002-03-23 23:13:20 +00:00
|
|
|
static PRBool ParseFrameborderValue(const nsAString& aString,
|
1998-09-09 23:30:30 +00:00
|
|
|
nsHTMLValue& aResult);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a frameborder value to string
|
|
|
|
*
|
|
|
|
* @param aValue the value to convert
|
|
|
|
* @param aResult the resulting string
|
|
|
|
* @return whether the value was converted
|
|
|
|
*/
|
2001-12-07 19:40:07 +00:00
|
|
|
static PRBool FrameborderValueToString(const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult);
|
1999-07-07 01:24:40 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a scrolling string to value (yes/no/on/off/scroll/noscroll/auto)
|
|
|
|
*
|
|
|
|
* @param aString the string to parse
|
|
|
|
* @param aResult the resulting HTMLValue
|
|
|
|
* @return whether the value was parsed
|
|
|
|
*/
|
2002-03-23 23:13:20 +00:00
|
|
|
static PRBool ParseScrollingValue(const nsAString& aString,
|
1999-07-07 01:24:40 +00:00
|
|
|
nsHTMLValue& aResult);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Convert a scrolling value to string
|
|
|
|
*
|
|
|
|
* @param aValue the value to convert
|
|
|
|
* @param aResult the resulting string
|
|
|
|
* @return whether the value was converted
|
|
|
|
*/
|
2001-12-07 19:40:07 +00:00
|
|
|
static PRBool ScrollingValueToString(const nsHTMLValue& aValue,
|
2002-03-23 23:13:20 +00:00
|
|
|
nsAString& aResult);
|
1999-07-07 01:24:40 +00:00
|
|
|
|
2003-07-08 05:35:04 +00:00
|
|
|
/**
|
|
|
|
* Take an attribute name, and return the value of that attribute,
|
|
|
|
* resolved to an absolute URI. Used by NS_IMPL_URI_ATTR macro.
|
|
|
|
*/
|
|
|
|
nsresult AttrToURI(nsIAtom* aAttrName, nsAString& aAbsoluteURI);
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Create the style struct from the style attr. Used when an element is first
|
|
|
|
* put into a document. Only has an effect if the old value is a string.
|
|
|
|
*/
|
1999-10-14 00:57:37 +00:00
|
|
|
nsresult ReparseStyleAttribute(void);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Parse a style attr value into a CSS rulestruct (or, if there is no
|
|
|
|
* document, leave it as a string) and return as HTMLValue.
|
|
|
|
*
|
|
|
|
* @param aValue the value to parse
|
|
|
|
* @param aResult the resulting HTMLValue [OUT]
|
|
|
|
*/
|
2002-03-23 23:13:20 +00:00
|
|
|
nsresult ParseStyleAttribute(const nsAString& aValue,
|
2000-12-23 10:56:31 +00:00
|
|
|
nsHTMLValue& aResult);
|
1999-10-14 00:57:37 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/*
|
|
|
|
* Attribute Mapping Helpers
|
1999-07-07 01:24:40 +00:00
|
|
|
*
|
|
|
|
* All attributes that are mapped into style contexts must have a
|
|
|
|
* matched set of mapping function and impact getter
|
|
|
|
*/
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* A style attribute mapping function for the most common attributes, to be
|
|
|
|
* called by subclasses' attribute mapping functions. Currently handles
|
|
|
|
* dir and lang, could handle others.
|
|
|
|
*
|
|
|
|
* @param aAttributes the list of attributes to map
|
|
|
|
* @param aData the returned rule data [INOUT]
|
|
|
|
* @see GetAttributeMappingFunction
|
|
|
|
*/
|
1999-07-07 01:24:40 +00:00
|
|
|
static void MapCommonAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
2001-05-31 22:19:43 +00:00
|
|
|
nsRuleData* aRuleData);
|
2003-07-11 21:16:12 +00:00
|
|
|
struct AttributeDependenceEntry {
|
2003-04-16 20:54:20 +00:00
|
|
|
nsIAtom** attribute;
|
|
|
|
};
|
1998-09-01 01:36:11 +00:00
|
|
|
|
2003-07-11 21:16:12 +00:00
|
|
|
static const AttributeDependenceEntry sCommonAttributeMap[];
|
|
|
|
static const AttributeDependenceEntry sImageMarginSizeAttributeMap[];
|
|
|
|
static const AttributeDependenceEntry sImageBorderAttributeMap[];
|
|
|
|
static const AttributeDependenceEntry sImageAlignAttributeMap[];
|
|
|
|
static const AttributeDependenceEntry sDivAlignAttributeMap[];
|
|
|
|
static const AttributeDependenceEntry sBackgroundAttributeMap[];
|
2003-04-16 20:54:20 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
2003-07-11 21:16:12 +00:00
|
|
|
* A common method where you can just pass in a list of maps to check
|
|
|
|
* for attribute dependence. Most implementations of
|
|
|
|
* HasAttributeDependentStyle should use this function as a default
|
|
|
|
* handler.
|
2002-07-28 01:47:59 +00:00
|
|
|
*/
|
2003-07-11 21:16:12 +00:00
|
|
|
static PRBool
|
|
|
|
FindAttributeDependence(const nsIAtom* aAttribute,
|
|
|
|
const AttributeDependenceEntry* const aMaps[],
|
|
|
|
PRUint32 aMapCount);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Helper to map the align attribute into a style struct.
|
|
|
|
*
|
|
|
|
* @param aAttributes the list of attributes to map
|
|
|
|
* @param aData the returned rule data [INOUT]
|
|
|
|
* @see GetAttributeMappingFunction
|
|
|
|
*/
|
2003-07-11 21:16:12 +00:00
|
|
|
static void MapImageAlignAttributeInto(const nsIHTMLMappedAttributes* aAttributes,
|
|
|
|
nsRuleData* aData);
|
2002-09-26 08:18:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper to map the align attribute into a style struct for things
|
|
|
|
* like <div>, <h1>, etc.
|
|
|
|
*
|
|
|
|
* @param aAttributes the list of attributes to map
|
|
|
|
* @param aData the returned rule data [INOUT]
|
|
|
|
* @see GetAttributeMappingFunction
|
|
|
|
*/
|
|
|
|
static void MapDivAlignAttributeInto(const nsIHTMLMappedAttributes* aAttributes,
|
|
|
|
nsRuleData* aData);
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Helper to map the image border attribute into a style struct.
|
|
|
|
*
|
|
|
|
* @param aAttributes the list of attributes to map
|
|
|
|
* @param aData the returned rule data [INOUT]
|
|
|
|
* @see GetAttributeMappingFunction
|
|
|
|
*/
|
2001-05-31 22:19:43 +00:00
|
|
|
static void MapImageBorderAttributeInto(const nsIHTMLMappedAttributes* aAttributes,
|
|
|
|
nsRuleData* aData);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Helper to map the image margin attribute into a style struct.
|
|
|
|
*
|
|
|
|
* @param aAttributes the list of attributes to map
|
|
|
|
* @param aData the returned rule data [INOUT]
|
|
|
|
* @see GetAttributeMappingFunction
|
|
|
|
*/
|
2001-05-31 22:19:43 +00:00
|
|
|
static void MapImageMarginAttributeInto(const nsIHTMLMappedAttributes* aAttributes,
|
|
|
|
nsRuleData* aData);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Helper to map the image position attribute into a style struct.
|
|
|
|
*
|
|
|
|
* @param aAttributes the list of attributes to map
|
|
|
|
* @param aData the returned rule data [INOUT]
|
|
|
|
* @see GetAttributeMappingFunction
|
|
|
|
*/
|
2003-07-11 21:16:12 +00:00
|
|
|
static void MapImageSizeAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|
|
|
nsRuleData* aData);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Helper to map the background attributes (currently background and bgcolor)
|
|
|
|
* into a style struct.
|
|
|
|
*
|
|
|
|
* @param aAttributes the list of attributes to map
|
|
|
|
* @param aData the returned rule data [INOUT]
|
|
|
|
* @see GetAttributeMappingFunction
|
|
|
|
*/
|
2001-05-31 22:19:43 +00:00
|
|
|
static void MapBackgroundAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
|
|
|
|
nsRuleData* aData);
|
2002-05-16 18:26:05 +00:00
|
|
|
/**
|
|
|
|
* Get the primary frame for a piece of content.
|
|
|
|
*
|
|
|
|
* @param aContent the content to get the primary frame for
|
|
|
|
* @param aDocument the document for this content
|
|
|
|
* @param aFlushContent whether to flush the content sink, which creates
|
|
|
|
* frames for content that do not already have it. EXPENSIVE.
|
|
|
|
* @return the primary frame
|
|
|
|
*/
|
|
|
|
static nsIFrame* GetPrimaryFrameFor(nsIContent* aContent,
|
|
|
|
nsIDocument* aDocument,
|
|
|
|
PRBool aFlushContent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the primary form control frame for a piece of content. Same as
|
|
|
|
* GetPrimaryFrameFor, except it QI's to nsIFormControlFrame.
|
|
|
|
*
|
|
|
|
* @param aContent the content to get the primary frame for
|
|
|
|
* @param aDocument the document for this content
|
|
|
|
* @param aFlushContent whether to flush the content sink, which creates
|
|
|
|
* frames for content that do not already have it. EXPENSIVE.
|
|
|
|
* @return the primary frame as nsIFormControlFrame
|
|
|
|
*/
|
2001-12-12 07:31:15 +00:00
|
|
|
static nsIFormControlFrame* GetFormControlFrameFor(nsIContent* aContent,
|
|
|
|
nsIDocument* aDocument,
|
|
|
|
PRBool aFlushContent);
|
2002-03-31 10:14:01 +00:00
|
|
|
/**
|
|
|
|
* Get the presentation state for a piece of content, or create it if it does
|
|
|
|
* not exist. Generally used by SaveState().
|
|
|
|
*
|
|
|
|
* @param aContent the content to get presentation state for.
|
|
|
|
* @param aPresState the presentation state (out param)
|
|
|
|
*/
|
2000-01-14 09:28:54 +00:00
|
|
|
static nsresult GetPrimaryPresState(nsIHTMLContent* aContent,
|
2000-12-23 10:56:31 +00:00
|
|
|
nsIPresState** aPresState);
|
2002-03-31 10:14:01 +00:00
|
|
|
/**
|
|
|
|
* Get the layout history object *and* generate the key for a particular
|
|
|
|
* piece of content.
|
|
|
|
*
|
|
|
|
* @param aContent the content to generate the key for
|
|
|
|
* @param aState the history state object (out param)
|
|
|
|
* @param aKey the key (out param)
|
|
|
|
*/
|
|
|
|
static nsresult GetLayoutHistoryAndKey(nsIHTMLContent* aContent,
|
|
|
|
nsILayoutHistoryState** aState,
|
|
|
|
nsACString& aKey);
|
|
|
|
/**
|
|
|
|
* Restore the state for a form control. Ends up calling
|
|
|
|
* nsIFormControl::RestoreState().
|
|
|
|
*
|
|
|
|
* @param aContent an nsIHTMLContent* pointing to the form control
|
|
|
|
* @param aControl an nsIFormControl* pointing to the form control
|
|
|
|
* @return whether or not the RestoreState() was called and exited
|
|
|
|
* successfully.
|
|
|
|
*/
|
|
|
|
static PRBool RestoreFormControlState(nsIHTMLContent* aContent,
|
|
|
|
nsIFormControl* aControl);
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Get the presentation context for a content node.
|
|
|
|
* @param aContent the content node
|
|
|
|
* @param aPresContext the presentation context [OUT]
|
|
|
|
*/
|
2000-12-23 10:56:31 +00:00
|
|
|
static nsresult GetPresContext(nsIHTMLContent* aContent,
|
|
|
|
nsIPresContext** aPresContext);
|
1999-02-01 18:44:59 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Resolve the base URL from a _baseHref attribute (could be empty) and
|
|
|
|
* from the document.
|
|
|
|
*
|
|
|
|
* @param aBaseHref the _baseHref attribute
|
|
|
|
* @param aDocument the document
|
|
|
|
* @param aResult the base URL
|
|
|
|
*/
|
1999-07-07 01:24:40 +00:00
|
|
|
static nsresult GetBaseURL(const nsHTMLValue& aBaseHref,
|
1999-03-19 23:09:29 +00:00
|
|
|
nsIDocument* aDocument,
|
1999-06-23 03:29:44 +00:00
|
|
|
nsIURI** aResult);
|
1999-03-19 23:09:29 +00:00
|
|
|
|
2001-03-02 15:45:35 +00:00
|
|
|
// Form Helper Routines
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Find an ancestor of this content node which is a form (could be null)
|
|
|
|
* @param aForm the form ancestore [OUT]
|
|
|
|
*/
|
2001-04-17 08:35:49 +00:00
|
|
|
nsresult FindForm(nsIDOMHTMLFormElement **aForm);
|
2001-03-02 15:45:35 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Find the form for this element and set aFormControl's form to it
|
|
|
|
* (aFormControl is passed in to avoid QI)
|
|
|
|
*
|
|
|
|
* @param aFormControl the form control to set the form for
|
|
|
|
*/
|
2001-04-17 08:35:49 +00:00
|
|
|
nsresult FindAndSetForm(nsIFormControl *aFormControl);
|
2001-03-02 15:45:35 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* See if the document being tested has nav-quirks mode enabled.
|
|
|
|
* @param doc the document
|
|
|
|
*/
|
2000-03-20 23:39:22 +00:00
|
|
|
static PRBool InNavQuirksMode(nsIDocument* aDoc);
|
1999-08-27 21:42:08 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Helper for the form subclasses of nsGenericHTMLElement to take care
|
|
|
|
* of fixing up form.elements when name, id and type change
|
|
|
|
*
|
|
|
|
* @param aForm the form the control is in
|
|
|
|
* @param aNameSpaceID the namespace of the attr
|
|
|
|
* @param aName the name of the attr
|
|
|
|
* @param aValue the value of the attr
|
|
|
|
* @param aNotify whether to notify the document of the attribute change
|
|
|
|
*/
|
2001-03-22 08:51:52 +00:00
|
|
|
nsresult SetFormControlAttribute(nsIForm* aForm, PRInt32 aNameSpaceID,
|
|
|
|
nsIAtom* aName,
|
2002-03-23 23:13:20 +00:00
|
|
|
const nsAString& aValue,
|
2001-03-22 08:51:52 +00:00
|
|
|
PRBool aNotify);
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/** The list of attributes */
|
2002-03-27 00:13:57 +00:00
|
|
|
nsHTMLAttributes* mAttributes;
|
2001-02-02 11:31:08 +00:00
|
|
|
|
2001-11-17 02:23:22 +00:00
|
|
|
// Helper functions for <a> and <area>
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult SetProtocolInHrefString(const nsAString &aHref,
|
|
|
|
const nsAString &aProtocol,
|
|
|
|
nsAString &aResult);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult SetHostInHrefString(const nsAString &aHref,
|
|
|
|
const nsAString &aHost,
|
|
|
|
nsAString &aResult);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult SetHostnameInHrefString(const nsAString &aHref,
|
|
|
|
const nsAString &aHostname,
|
|
|
|
nsAString &aResult);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult SetPathnameInHrefString(const nsAString &aHref,
|
|
|
|
const nsAString &aHostname,
|
|
|
|
nsAString &aResult);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult SetSearchInHrefString(const nsAString &aHref,
|
|
|
|
const nsAString &aSearch,
|
|
|
|
nsAString &aResult);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult SetHashInHrefString(const nsAString &aHref,
|
|
|
|
const nsAString &aHash,
|
|
|
|
nsAString &aResult);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult SetPortInHrefString(const nsAString &aHref,
|
|
|
|
const nsAString &aPort,
|
|
|
|
nsAString &aResult);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult GetProtocolFromHrefString(const nsAString &aHref,
|
|
|
|
nsAString& aProtocol,
|
2001-12-05 03:16:13 +00:00
|
|
|
nsIDocument *aDocument);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult GetHostFromHrefString(const nsAString &aHref,
|
|
|
|
nsAString& aHost);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult GetHostnameFromHrefString(const nsAString &aHref,
|
|
|
|
nsAString& aHostname);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult GetPathnameFromHrefString(const nsAString &aHref,
|
|
|
|
nsAString& aPathname);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult GetSearchFromHrefString(const nsAString &aHref,
|
|
|
|
nsAString& aSearch);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult GetPortFromHrefString(const nsAString &aHref,
|
|
|
|
nsAString& aPort);
|
2001-11-17 02:23:22 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
static nsresult GetHashFromHrefString(const nsAString &aHref,
|
|
|
|
nsAString& aHash);
|
2001-02-02 11:31:08 +00:00
|
|
|
protected:
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Focus or blur the element. This is what you should call if you want to
|
|
|
|
* *cause* a focus or blur on your element. SetFocus / SetBlur are the
|
|
|
|
* methods where you want to catch what occurs on your element.
|
|
|
|
* @param aDoFocus true to focus, false to blur
|
|
|
|
*/
|
2001-04-16 06:36:45 +00:00
|
|
|
nsresult SetElementFocus(PRBool aDoFocus);
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Register or unregister an access key to this element based on the
|
|
|
|
* accesskey attribute.
|
|
|
|
* @param aDoReg true to register, false to unregister
|
|
|
|
*/
|
2002-05-22 00:14:51 +00:00
|
|
|
nsresult RegUnRegAccessKey(PRBool aDoReg);
|
2001-04-16 06:36:45 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* Determine whether an attribute is an event (onclick, etc.)
|
|
|
|
* @param aName the attribute
|
|
|
|
* @return whether the name is an event handler name
|
|
|
|
*/
|
2001-05-04 05:34:58 +00:00
|
|
|
PRBool IsEventName(nsIAtom* aName);
|
1998-08-28 23:27:19 +00:00
|
|
|
};
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
|
1998-08-28 23:27:19 +00:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* A helper class to subclass for leaf elements.
|
|
|
|
*/
|
1998-09-04 23:03:16 +00:00
|
|
|
class nsGenericHTMLLeafElement : public nsGenericHTMLElement {
|
|
|
|
public:
|
1998-09-03 22:21:32 +00:00
|
|
|
nsGenericHTMLLeafElement();
|
2000-12-23 10:56:31 +00:00
|
|
|
virtual ~nsGenericHTMLLeafElement();
|
1998-08-28 23:27:19 +00:00
|
|
|
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD CopyInnerTo(nsIContent* aSrcContent,
|
|
|
|
nsGenericHTMLLeafElement* aDest,
|
|
|
|
PRBool aDeep);
|
1998-08-28 23:27:19 +00:00
|
|
|
|
|
|
|
// Remainder of nsIDOMHTMLElement (and nsIDOMNode)
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD GetChildNodes(nsIDOMNodeList** aChildNodes);
|
|
|
|
NS_METHOD HasChildNodes(PRBool* aHasChildNodes) {
|
1998-08-28 23:27:19 +00:00
|
|
|
*aHasChildNodes = PR_FALSE;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD GetFirstChild(nsIDOMNode** aFirstChild) {
|
1998-08-28 23:27:19 +00:00
|
|
|
*aFirstChild = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD GetLastChild(nsIDOMNode** aLastChild) {
|
1998-08-28 23:27:19 +00:00
|
|
|
*aLastChild = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
|
|
|
|
nsIDOMNode** aReturn) {
|
1998-08-28 23:27:19 +00:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild,
|
|
|
|
nsIDOMNode** aReturn) {
|
1998-08-28 23:27:19 +00:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn) {
|
1998-08-28 23:27:19 +00:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn) {
|
1998-08-28 23:27:19 +00:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Remainder of nsIHTMLContent (and nsIContent)
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD Compact() {
|
1998-08-29 20:20:38 +00:00
|
|
|
return NS_OK;
|
1998-08-28 23:27:19 +00:00
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD CanContainChildren(PRBool& aResult) const {
|
1998-08-29 20:20:38 +00:00
|
|
|
aResult = PR_FALSE;
|
|
|
|
return NS_OK;
|
1998-08-28 23:27:19 +00:00
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD ChildCount(PRInt32& aResult) const {
|
1998-08-29 20:20:38 +00:00
|
|
|
aResult = 0;
|
|
|
|
return NS_OK;
|
1998-08-28 23:27:19 +00:00
|
|
|
}
|
2003-06-13 20:10:01 +00:00
|
|
|
NS_IMETHOD ChildAt(PRInt32 aIndex, nsIContent** aResult) const {
|
1998-08-29 20:20:38 +00:00
|
|
|
aResult = nsnull;
|
|
|
|
return NS_OK;
|
1998-08-28 23:27:19 +00:00
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD IndexOf(nsIContent* aPossibleChild, PRInt32& aResult) const {
|
1998-08-29 20:20:38 +00:00
|
|
|
aResult = -1;
|
|
|
|
return NS_OK;
|
1998-08-28 23:27:19 +00:00
|
|
|
}
|
2001-04-02 00:45:52 +00:00
|
|
|
NS_IMETHOD InsertChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify,
|
|
|
|
PRBool aDeepSetDocument) {
|
1998-08-28 23:27:19 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2001-04-02 00:45:52 +00:00
|
|
|
NS_IMETHOD ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify,
|
|
|
|
PRBool aDeepSetDocument) {
|
1998-08-28 23:27:19 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2001-04-02 00:45:52 +00:00
|
|
|
NS_IMETHOD AppendChildTo(nsIContent* aKid, PRBool aNotify,
|
|
|
|
PRBool aDeepSetDocument) {
|
1998-08-28 23:27:19 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD RemoveChildAt(PRInt32 aIndex, PRBool aNotify) {
|
1998-08-28 23:27:19 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* A helper class to subclass for elements that can contain children
|
|
|
|
*/
|
2000-12-23 10:56:31 +00:00
|
|
|
class nsGenericHTMLContainerElement : public nsGenericHTMLElement
|
|
|
|
{
|
1998-09-04 23:03:16 +00:00
|
|
|
public:
|
1998-09-03 22:21:32 +00:00
|
|
|
nsGenericHTMLContainerElement();
|
2000-12-23 10:56:31 +00:00
|
|
|
virtual ~nsGenericHTMLContainerElement();
|
1998-08-28 23:27:19 +00:00
|
|
|
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD CopyInnerTo(nsIContent* aSrcContent,
|
1999-01-14 23:14:02 +00:00
|
|
|
nsGenericHTMLContainerElement* aDest,
|
|
|
|
PRBool aDeep);
|
1998-08-28 23:27:19 +00:00
|
|
|
|
|
|
|
// Remainder of nsIDOMHTMLElement (and nsIDOMNode)
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD GetChildNodes(nsIDOMNodeList** aChildNodes);
|
|
|
|
NS_METHOD HasChildNodes(PRBool* aHasChildNodes);
|
|
|
|
NS_METHOD GetFirstChild(nsIDOMNode** aFirstChild);
|
|
|
|
NS_METHOD GetLastChild(nsIDOMNode** aLastChild);
|
1998-11-11 22:06:16 +00:00
|
|
|
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild,
|
|
|
|
nsIDOMNode** aReturn)
|
2000-04-01 12:36:16 +00:00
|
|
|
{
|
|
|
|
return nsGenericElement::doInsertBefore(aNewChild, aRefChild, aReturn);
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild,
|
|
|
|
nsIDOMNode** aReturn)
|
2000-04-01 12:36:16 +00:00
|
|
|
{
|
|
|
|
return nsGenericElement::doReplaceChild(aNewChild, aOldChild, aReturn);
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn)
|
2000-04-01 12:36:16 +00:00
|
|
|
{
|
|
|
|
return nsGenericElement::doRemoveChild(aOldChild, aReturn);
|
|
|
|
}
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_METHOD AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn)
|
2000-04-01 12:36:16 +00:00
|
|
|
{
|
|
|
|
return nsGenericElement::doInsertBefore(aNewChild, nsnull, aReturn);
|
|
|
|
}
|
1998-08-28 23:27:19 +00:00
|
|
|
|
|
|
|
// Remainder of nsIHTMLContent (and nsIContent)
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD Compact();
|
|
|
|
NS_IMETHOD CanContainChildren(PRBool& aResult) const;
|
|
|
|
NS_IMETHOD ChildCount(PRInt32& aResult) const;
|
2003-06-13 20:10:01 +00:00
|
|
|
NS_IMETHOD ChildAt(PRInt32 aIndex, nsIContent** aResult) const;
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD IndexOf(nsIContent* aPossibleChild, PRInt32& aResult) const;
|
2001-04-02 00:45:52 +00:00
|
|
|
NS_IMETHOD InsertChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify,
|
|
|
|
PRBool aDeepSetDocument);
|
|
|
|
NS_IMETHOD ReplaceChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify,
|
|
|
|
PRBool aDeepSetDocument);
|
|
|
|
NS_IMETHOD AppendChildTo(nsIContent* aKid, PRBool aNotify,
|
|
|
|
PRBool aDeepSetDocument);
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD RemoveChildAt(PRInt32 aIndex, PRBool aNotify);
|
1998-08-28 23:27:19 +00:00
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/** The list of children */
|
2001-12-21 01:10:07 +00:00
|
|
|
nsSmallVoidArray mChildren;
|
2002-07-04 04:30:25 +00:00
|
|
|
protected:
|
|
|
|
/**
|
|
|
|
* ReplaceContentsWithText will take the aText string and make sure
|
|
|
|
* that the only child of |this| is a textnode which corresponds to
|
|
|
|
* that string.
|
2002-07-28 01:47:59 +00:00
|
|
|
*
|
|
|
|
* @param aText the text to put in
|
|
|
|
* @param aNotify whether to notify the document of child adds/removes
|
2002-07-04 04:30:25 +00:00
|
|
|
*/
|
|
|
|
nsresult ReplaceContentsWithText(const nsAString& aText, PRBool aNotify);
|
|
|
|
/**
|
|
|
|
* GetContentsAsText will take all the textnodes that are children
|
|
|
|
* of |this| and concatenate the text in them into aText. It
|
|
|
|
* completely ignores any non-text-node children of |this|; in
|
|
|
|
* particular it does not descend into any children of |this| that
|
|
|
|
* happen to be container elements.
|
2002-07-28 01:47:59 +00:00
|
|
|
*
|
|
|
|
* @param aText the resulting text [OUT]
|
2002-07-04 04:30:25 +00:00
|
|
|
*/
|
|
|
|
nsresult GetContentsAsText(nsAString& aText);
|
1998-08-28 23:27:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* A helper class for form elements that can contain children
|
|
|
|
*/
|
2000-12-23 10:56:31 +00:00
|
|
|
class nsGenericHTMLContainerFormElement : public nsGenericHTMLContainerElement,
|
|
|
|
public nsIFormControl
|
|
|
|
{
|
2000-04-19 07:49:07 +00:00
|
|
|
public:
|
|
|
|
nsGenericHTMLContainerFormElement();
|
2000-12-23 10:56:31 +00:00
|
|
|
virtual ~nsGenericHTMLContainerFormElement();
|
2000-04-19 07:49:07 +00:00
|
|
|
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
NS_IMETHOD_(PRBool) IsContentOfType(PRUint32 aFlags);
|
|
|
|
|
2000-12-23 10:56:31 +00:00
|
|
|
// nsIFormControl
|
|
|
|
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
|
2001-03-22 08:51:52 +00:00
|
|
|
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm,
|
|
|
|
PRBool aRemoveFromForm = PR_TRUE);
|
2002-03-31 10:14:01 +00:00
|
|
|
NS_IMETHOD SaveState() { return NS_OK; }
|
|
|
|
NS_IMETHOD RestoreState(nsIPresState* aState) { return NS_OK; }
|
2000-12-23 10:56:31 +00:00
|
|
|
|
2001-08-17 08:14:14 +00:00
|
|
|
// nsIContent
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD SetParent(nsIContent *aParent);
|
|
|
|
NS_IMETHOD SetDocument(nsIDocument* aDocument, PRBool aDeep,
|
|
|
|
PRBool aCompileEventHandlers);
|
|
|
|
|
2001-08-17 08:14:14 +00:00
|
|
|
NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
2002-03-23 23:13:20 +00:00
|
|
|
const nsAString& aValue, PRBool aNotify);
|
2001-08-17 08:14:14 +00:00
|
|
|
|
|
|
|
NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo,
|
2002-03-23 23:13:20 +00:00
|
|
|
const nsAString& aValue,
|
2001-08-17 08:14:14 +00:00
|
|
|
PRBool aNotify);
|
|
|
|
|
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
NS_METHOD SetAttribute(const nsAString& aName,
|
|
|
|
const nsAString& aValue)
|
2000-04-19 07:49:07 +00:00
|
|
|
{
|
|
|
|
return nsGenericHTMLElement::SetAttribute(aName, aValue);
|
|
|
|
}
|
|
|
|
|
2000-12-23 10:56:31 +00:00
|
|
|
protected:
|
2002-07-28 01:47:59 +00:00
|
|
|
/** The form that contains this control */
|
2000-04-19 07:49:07 +00:00
|
|
|
nsIForm* mForm;
|
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2002-07-28 01:47:59 +00:00
|
|
|
/**
|
|
|
|
* A helper class for form elements that can contain children
|
|
|
|
*/
|
2000-12-23 10:56:31 +00:00
|
|
|
class nsGenericHTMLLeafFormElement : public nsGenericHTMLLeafElement,
|
|
|
|
public nsIFormControl
|
|
|
|
{
|
2000-04-19 07:49:07 +00:00
|
|
|
public:
|
|
|
|
nsGenericHTMLLeafFormElement();
|
|
|
|
~nsGenericHTMLLeafFormElement();
|
|
|
|
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
NS_IMETHOD_(PRBool) IsContentOfType(PRUint32 aFlags);
|
|
|
|
|
2000-12-23 10:56:31 +00:00
|
|
|
// nsIFormControl
|
|
|
|
NS_IMETHOD GetForm(nsIDOMHTMLFormElement** aForm);
|
2001-03-22 08:51:52 +00:00
|
|
|
NS_IMETHOD SetForm(nsIDOMHTMLFormElement* aForm,
|
|
|
|
PRBool aRemoveFromForm = PR_TRUE);
|
2002-03-31 10:14:01 +00:00
|
|
|
NS_IMETHOD SaveState() { return NS_OK; }
|
|
|
|
NS_IMETHOD RestoreState(nsIPresState* aState) { return NS_OK; }
|
2000-12-23 10:56:31 +00:00
|
|
|
|
2001-08-17 08:14:14 +00:00
|
|
|
// nsIContent
|
2000-12-23 10:56:31 +00:00
|
|
|
NS_IMETHOD SetParent(nsIContent *aParent);
|
|
|
|
NS_IMETHOD SetDocument(nsIDocument* aDocument, PRBool aDeep,
|
|
|
|
PRBool aCompileEventHandlers);
|
|
|
|
|
2001-08-17 08:14:14 +00:00
|
|
|
NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
2002-03-23 23:13:20 +00:00
|
|
|
const nsAString& aValue, PRBool aNotify);
|
2001-08-17 08:14:14 +00:00
|
|
|
|
|
|
|
NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo,
|
2002-03-23 23:13:20 +00:00
|
|
|
const nsAString& aValue,
|
2001-08-17 08:14:14 +00:00
|
|
|
PRBool aNotify);
|
2002-03-31 10:14:01 +00:00
|
|
|
NS_IMETHOD DoneCreatingElement();
|
2001-08-17 08:14:14 +00:00
|
|
|
|
2002-03-23 23:13:20 +00:00
|
|
|
NS_METHOD SetAttribute(const nsAString& aName,
|
|
|
|
const nsAString& aValue)
|
2000-04-19 07:49:07 +00:00
|
|
|
{
|
|
|
|
return nsGenericHTMLElement::SetAttribute(aName, aValue);
|
|
|
|
}
|
|
|
|
|
2000-12-23 10:56:31 +00:00
|
|
|
protected:
|
2002-07-28 01:47:59 +00:00
|
|
|
/** The form that contains this control */
|
2000-04-19 07:49:07 +00:00
|
|
|
nsIForm* mForm;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2000-02-16 02:25:07 +00:00
|
|
|
|
1998-09-02 01:08:23 +00:00
|
|
|
/**
|
|
|
|
* A macro to implement the getter and setter for a given string
|
2002-02-12 21:35:45 +00:00
|
|
|
* valued content property. The method uses the generic GetAttr and
|
|
|
|
* SetAttr methods.
|
1998-09-02 01:08:23 +00:00
|
|
|
*/
|
1998-11-03 01:08:02 +00:00
|
|
|
#define NS_IMPL_STRING_ATTR(_class, _method, _atom) \
|
2002-02-12 21:35:45 +00:00
|
|
|
NS_IMPL_STRING_ATTR_DEFAULT_VALUE(_class, _method, _atom, "")
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A macro to implement the getter and setter for a given string
|
|
|
|
* valued content property with a default value.
|
|
|
|
* The method uses the generic GetAttr and SetAttr methods.
|
|
|
|
*/
|
|
|
|
#define NS_IMPL_STRING_ATTR_DEFAULT_VALUE(_class, _method, _atom, _default) \
|
1998-09-24 21:35:52 +00:00
|
|
|
NS_IMETHODIMP \
|
2002-03-23 23:13:20 +00:00
|
|
|
_class::Get##_method(nsAString& aValue) \
|
1998-09-24 21:35:52 +00:00
|
|
|
{ \
|
2002-05-20 22:47:02 +00:00
|
|
|
nsresult rv = GetAttr(kNameSpaceID_None, \
|
2002-02-12 21:35:45 +00:00
|
|
|
nsHTMLAtoms::_atom, aValue); \
|
|
|
|
if (rv == NS_CONTENT_ATTR_NOT_THERE) { \
|
|
|
|
aValue.Assign(NS_LITERAL_STRING(_default)); \
|
|
|
|
} \
|
1998-09-24 21:35:52 +00:00
|
|
|
return NS_OK; \
|
|
|
|
} \
|
|
|
|
NS_IMETHODIMP \
|
2002-03-23 23:13:20 +00:00
|
|
|
_class::Set##_method(const nsAString& aValue) \
|
1998-09-24 21:35:52 +00:00
|
|
|
{ \
|
2002-05-20 22:47:02 +00:00
|
|
|
return SetAttr(kNameSpaceID_None, nsHTMLAtoms::_atom, aValue, \
|
2001-09-11 04:48:31 +00:00
|
|
|
PR_TRUE); \
|
1998-09-02 01:08:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A macro to implement the getter and setter for a given boolean
|
2002-02-12 21:35:45 +00:00
|
|
|
* valued content property. The method uses the generic GetAttr and
|
|
|
|
* SetAttr methods.
|
1998-09-02 01:08:23 +00:00
|
|
|
*/
|
1998-11-03 01:08:02 +00:00
|
|
|
#define NS_IMPL_BOOL_ATTR(_class, _method, _atom) \
|
1998-09-24 21:35:52 +00:00
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Get##_method(PRBool* aValue) \
|
|
|
|
{ \
|
|
|
|
nsHTMLValue val; \
|
2002-02-12 21:35:45 +00:00
|
|
|
nsresult rv = GetHTMLAttribute(nsHTMLAtoms::_atom, val); \
|
1998-09-24 21:35:52 +00:00
|
|
|
*aValue = NS_CONTENT_ATTR_NOT_THERE != rv; \
|
|
|
|
return NS_OK; \
|
|
|
|
} \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Set##_method(PRBool aValue) \
|
|
|
|
{ \
|
1998-12-20 01:21:23 +00:00
|
|
|
nsHTMLValue empty(eHTMLUnit_Empty); \
|
1998-09-24 21:35:52 +00:00
|
|
|
if (aValue) { \
|
2001-09-11 04:48:31 +00:00
|
|
|
return SetHTMLAttribute(nsHTMLAtoms::_atom, empty, PR_TRUE); \
|
1998-09-24 21:35:52 +00:00
|
|
|
} \
|
|
|
|
else { \
|
2002-05-20 22:47:02 +00:00
|
|
|
UnsetAttr(kNameSpaceID_None, nsHTMLAtoms::_atom, PR_TRUE); \
|
1998-09-24 21:35:52 +00:00
|
|
|
return NS_OK; \
|
|
|
|
} \
|
1998-09-02 01:08:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A macro to implement the getter and setter for a given integer
|
2002-02-12 21:35:45 +00:00
|
|
|
* valued content property. The method uses the generic GetAttr and
|
|
|
|
* SetAttr methods.
|
1998-09-02 01:08:23 +00:00
|
|
|
*/
|
1998-11-03 01:08:02 +00:00
|
|
|
#define NS_IMPL_INT_ATTR(_class, _method, _atom) \
|
2002-02-12 21:35:45 +00:00
|
|
|
NS_IMPL_INT_ATTR_DEFAULT_VALUE(_class, _method, _atom, -1)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A macro to implement the getter and setter for a given integer
|
|
|
|
* valued content property with a default value.
|
|
|
|
* The method uses the generic GetAttr and SetAttr methods.
|
|
|
|
*/
|
|
|
|
#define NS_IMPL_INT_ATTR_DEFAULT_VALUE(_class, _method, _atom, _default) \
|
1998-09-24 21:35:52 +00:00
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Get##_method(PRInt32* aValue) \
|
|
|
|
{ \
|
|
|
|
nsHTMLValue value; \
|
2002-02-12 21:35:45 +00:00
|
|
|
*aValue = _default; \
|
1998-09-24 21:35:52 +00:00
|
|
|
if (NS_CONTENT_ATTR_HAS_VALUE == \
|
2001-09-11 04:48:31 +00:00
|
|
|
GetHTMLAttribute(nsHTMLAtoms::_atom, value)) { \
|
1998-09-24 21:35:52 +00:00
|
|
|
if (value.GetUnit() == eHTMLUnit_Integer) { \
|
|
|
|
*aValue = value.GetIntValue(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
return NS_OK; \
|
|
|
|
} \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Set##_method(PRInt32 aValue) \
|
|
|
|
{ \
|
|
|
|
nsHTMLValue value(aValue, eHTMLUnit_Integer); \
|
2001-09-11 04:48:31 +00:00
|
|
|
return SetHTMLAttribute(nsHTMLAtoms::_atom, value, PR_TRUE); \
|
1998-09-02 01:08:23 +00:00
|
|
|
}
|
|
|
|
|
2002-02-05 04:37:10 +00:00
|
|
|
/**
|
|
|
|
* A macro to implement the getter and the setter for a given pixel
|
|
|
|
* valued content property. The method uses the generic GetAttr and
|
2002-02-12 21:35:45 +00:00
|
|
|
* SetAttr methods.
|
2002-02-05 04:37:10 +00:00
|
|
|
*/
|
|
|
|
#define NS_IMPL_PIXEL_ATTR(_class, _method, _atom) \
|
2002-02-12 21:35:45 +00:00
|
|
|
NS_IMPL_PIXEL_ATTR_DEFAULT_VALUE(_class, _method, _atom, -1)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A macro to implement the getter and the setter for a given pixel
|
|
|
|
* valued content property with a default value.
|
|
|
|
* The method uses the generic GetAttr and SetAttr methods.
|
|
|
|
*/
|
|
|
|
#define NS_IMPL_PIXEL_ATTR_DEFAULT_VALUE(_class, _method, _atom, _default) \
|
2002-02-05 04:37:10 +00:00
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Get##_method(PRInt32* aValue) \
|
|
|
|
{ \
|
|
|
|
nsHTMLValue value; \
|
2002-02-12 21:35:45 +00:00
|
|
|
*aValue = _default; \
|
2002-02-05 04:37:10 +00:00
|
|
|
if (NS_CONTENT_ATTR_HAS_VALUE == \
|
|
|
|
GetHTMLAttribute(nsHTMLAtoms::_atom, value)) { \
|
|
|
|
if (value.GetUnit() == eHTMLUnit_Pixel) { \
|
|
|
|
*aValue = value.GetPixelValue(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
return NS_OK; \
|
|
|
|
} \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Set##_method(PRInt32 aValue) \
|
|
|
|
{ \
|
|
|
|
nsHTMLValue value(aValue, eHTMLUnit_Pixel); \
|
|
|
|
return SetHTMLAttribute(nsHTMLAtoms::_atom, value, PR_TRUE); \
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
|
2003-07-08 05:35:04 +00:00
|
|
|
/**
|
|
|
|
* A macro to implement the getter and setter for a given content
|
|
|
|
* property that needs to return a URI in string form. The method
|
|
|
|
* uses the generic GetAttr and SetAttr methods. This macro is much
|
|
|
|
* like the NS_IMPL_STRING_ATTR macro, except we make sure the URI is
|
|
|
|
* absolute.
|
|
|
|
*/
|
|
|
|
#define NS_IMPL_URI_ATTR_GETTER(_class, _method, _atom) \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Get##_method(nsAString& aValue) \
|
|
|
|
{ \
|
|
|
|
return AttrToURI(nsHTMLAtoms::_atom, aValue); \
|
|
|
|
}
|
|
|
|
#define NS_IMPL_URI_ATTR_SETTER(_class, _method, _atom) \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Set##_method(const nsAString& aValue) \
|
|
|
|
{ \
|
|
|
|
return SetAttr(kNameSpaceID_None, nsHTMLAtoms::_atom, aValue, \
|
|
|
|
PR_TRUE); \
|
|
|
|
}
|
|
|
|
#define NS_IMPL_URI_ATTR(_class, _method, _atom) \
|
|
|
|
NS_IMPL_URI_ATTR_GETTER(_class, _method, _atom) \
|
|
|
|
NS_IMPL_URI_ATTR_SETTER(_class, _method, _atom)
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
/**
|
|
|
|
* QueryInterface() implementation helper macros
|
|
|
|
*/
|
|
|
|
|
2001-10-30 10:14:06 +00:00
|
|
|
#define NS_HTML_CONTENT_INTERFACE_MAP_AMBIGOUS_BEGIN(_class, _base, _base_if) \
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr) \
|
|
|
|
{ \
|
|
|
|
NS_ENSURE_ARG_POINTER(aInstancePtr); \
|
|
|
|
\
|
|
|
|
*aInstancePtr = nsnull; \
|
|
|
|
\
|
|
|
|
nsresult rv; \
|
|
|
|
\
|
|
|
|
rv = _base::QueryInterface(aIID, aInstancePtr); \
|
|
|
|
\
|
|
|
|
if (NS_SUCCEEDED(rv)) \
|
|
|
|
return rv; \
|
|
|
|
\
|
2001-10-30 10:14:06 +00:00
|
|
|
rv = DOMQueryInterface(NS_STATIC_CAST(_base_if *, this), aIID, \
|
|
|
|
aInstancePtr); \
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
\
|
|
|
|
if (NS_SUCCEEDED(rv)) \
|
|
|
|
return rv; \
|
|
|
|
\
|
|
|
|
nsISupports *foundInterface = nsnull;
|
|
|
|
|
|
|
|
|
2001-10-30 10:14:06 +00:00
|
|
|
#define NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(_class, _base) \
|
|
|
|
NS_HTML_CONTENT_INTERFACE_MAP_AMBIGOUS_BEGIN(_class, _base, \
|
|
|
|
nsIDOMHTMLElement)
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
#define NS_HTML_CONTENT_INTERFACE_MAP_END \
|
|
|
|
{ \
|
2002-01-24 09:17:00 +00:00
|
|
|
return PostQueryInterface(aIID, aInstancePtr); \
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
} \
|
|
|
|
\
|
|
|
|
NS_ADDREF(foundInterface); \
|
|
|
|
\
|
|
|
|
*aInstancePtr = foundInterface; \
|
|
|
|
\
|
|
|
|
return NS_OK; \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-30 10:14:06 +00:00
|
|
|
#define NS_INTERFACE_MAP_ENTRY_IF_TAG(_interface, _tag) \
|
|
|
|
if (mNodeInfo->Equals(nsHTMLAtoms::_tag) && \
|
|
|
|
aIID.Equals(NS_GET_IID(_interface))) \
|
|
|
|
foundInterface = NS_STATIC_CAST(_interface *, this); \
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
#define NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO_IF_TAG(_class, _tag) \
|
|
|
|
if (mNodeInfo->Equals(nsHTMLAtoms::_tag) && \
|
|
|
|
aIID.Equals(NS_GET_IID(nsIClassInfo))) { \
|
|
|
|
foundInterface = \
|
|
|
|
nsContentUtils::GetClassInfoInstance(eDOMClassInfo_##_class##_id); \
|
|
|
|
NS_ENSURE_TRUE(foundInterface, NS_ERROR_OUT_OF_MEMORY); \
|
|
|
|
\
|
|
|
|
*aInstancePtr = foundInterface; \
|
|
|
|
\
|
|
|
|
return NS_OK; \
|
|
|
|
} else
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Element class factory methods
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLSharedLeafElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLAnchorElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLAppletElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLAreaElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLBRElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
inline nsresult
|
|
|
|
NS_NewHTMLBaseElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo)
|
|
|
|
{
|
|
|
|
return NS_NewHTMLSharedLeafElement(aResult, aNodeInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLBaseFontElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLBodyElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLButtonElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLDListElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLDelElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLDirectoryElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLDivElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
inline nsresult
|
|
|
|
NS_NewHTMLEmbedElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo)
|
|
|
|
{
|
|
|
|
return NS_NewHTMLSharedLeafElement(aResult, aNodeInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLFieldSetElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLFontElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLFormElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLFrameElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLFrameSetElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLHRElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLHeadElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLHeadingElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLHtmlElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLIFrameElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLImageElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
2002-03-31 10:14:01 +00:00
|
|
|
NS_NewHTMLInputElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo,
|
|
|
|
PRBool aFromParser);
|
2001-10-30 10:14:06 +00:00
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLInsElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
inline nsresult
|
|
|
|
NS_NewHTMLIsIndexElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo)
|
|
|
|
{
|
|
|
|
return NS_NewHTMLSharedLeafElement(aResult, aNodeInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLLIElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLLabelElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLLegendElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLLinkElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLMapElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLMenuElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLMetaElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLOListElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLObjectElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLOptGroupElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLOptionElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLParagraphElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
inline nsresult
|
|
|
|
NS_NewHTMLParamElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo)
|
|
|
|
{
|
|
|
|
return NS_NewHTMLSharedLeafElement(aResult, aNodeInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLPreElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLQuoteElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLScriptElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
2002-03-31 10:14:01 +00:00
|
|
|
NS_NewHTMLSelectElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo,
|
|
|
|
PRBool aFromParser);
|
2001-10-30 10:14:06 +00:00
|
|
|
|
|
|
|
inline nsresult
|
|
|
|
NS_NewHTMLSpacerElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo)
|
|
|
|
{
|
|
|
|
return NS_NewHTMLSharedLeafElement(aResult, aNodeInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLSpanElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLStyleElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTableCaptionElement(nsIHTMLContent** aResult,nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTableCellElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTableColElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
inline nsresult
|
|
|
|
NS_NewHTMLTableColGroupElement(nsIHTMLContent** aResult,
|
|
|
|
nsINodeInfo *aNodeInfo)
|
|
|
|
{
|
|
|
|
return NS_NewHTMLTableColElement(aResult, aNodeInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTableElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTableRowElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTableSectionElement(nsIHTMLContent** aResult,nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTbodyElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTextAreaElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTfootElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTheadElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLTitleElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLUListElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLUnknownElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|
|
|
|
|
|
|
inline nsresult
|
|
|
|
NS_NewHTMLWBRElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo)
|
|
|
|
{
|
|
|
|
return NS_NewHTMLSharedLeafElement(aResult, aNodeInfo);
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
|
1998-09-03 22:21:32 +00:00
|
|
|
#endif /* nsGenericHTMLElement_h___ */
|