This commit is contained in:
jst%netscape.com 2003-01-14 23:05:52 +00:00
Родитель 9553822500
Коммит 53dbf78a7a
39 изменённых файлов: 432 добавлений и 265 удалений

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

@ -1441,8 +1441,10 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
// does not fully contain any node.
PRBool nodeBefore, nodeAfter;
if (NS_FAILED(CompareNodeToRange(firstCandidate, aRange, &nodeBefore, &nodeAfter)))
if (NS_FAILED(nsRange::CompareNodeToRange(firstCandidate, aRange,
&nodeBefore, &nodeAfter)))
return NS_ERROR_FAILURE;
if (nodeBefore || nodeAfter)
{
MakeEmpty();
@ -1504,8 +1506,10 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
// is indeed contained. Else we have a range that
// does not fully contain any node.
if (NS_FAILED(CompareNodeToRange(lastCandidate, aRange, &nodeBefore, &nodeAfter)))
if (NS_FAILED(nsRange::CompareNodeToRange(lastCandidate, aRange, &nodeBefore,
&nodeAfter)))
return NS_ERROR_FAILURE;
if (nodeBefore || nodeAfter)
{
MakeEmpty();
@ -1635,8 +1639,10 @@ nsresult nsContentSubtreeIterator::GetTopAncestorInRange(
// sanity check: aNode is itself in the range
PRBool nodeBefore, nodeAfter;
if (NS_FAILED(CompareNodeToRange(aNode, mRange, &nodeBefore, &nodeAfter)))
if (NS_FAILED(nsRange::CompareNodeToRange(aNode, mRange, &nodeBefore,
&nodeAfter)))
return NS_ERROR_FAILURE;
if (nodeBefore || nodeAfter)
return NS_ERROR_FAILURE;
@ -1654,8 +1660,10 @@ nsresult nsContentSubtreeIterator::GetTopAncestorInRange(
}
else return NS_ERROR_FAILURE;
}
if (NS_FAILED(CompareNodeToRange(parent, mRange, &nodeBefore, &nodeAfter)))
if (NS_FAILED(nsRange::CompareNodeToRange(parent, mRange, &nodeBefore,
&nodeAfter)))
return NS_ERROR_FAILURE;
if (nodeBefore || nodeAfter)
{
*outAnestor = aNode;

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

@ -1040,8 +1040,11 @@ nsresult nsGeneratedSubtreeIterator::Init(nsIDOMRange* aRange)
// does not fully contain any node.
PRBool nodeBefore(PR_FALSE), nodeAfter(PR_FALSE);
if (!mFirstIter && NS_FAILED(CompareNodeToRange(firstCandidate, aRange, &nodeBefore, &nodeAfter)))
if (!mFirstIter &&
NS_FAILED(nsRange::CompareNodeToRange(firstCandidate, aRange,
&nodeBefore, &nodeAfter)))
return NS_ERROR_FAILURE;
if (nodeBefore || nodeAfter)
{
MakeEmpty();
@ -1122,9 +1125,10 @@ nsresult nsGeneratedSubtreeIterator::Init(nsIDOMRange* aRange)
// is indeed contained. Else we have a range that
// does not fully contain any node.
if (!mLastIter && NS_FAILED(CompareNodeToRange(lastCandidate, aRange, &nodeBefore, &nodeAfter)))
if (!mLastIter &&
NS_FAILED(nsRange::CompareNodeToRange(lastCandidate, aRange, &nodeBefore,
&nodeAfter)))
return NS_ERROR_FAILURE;
if (nodeBefore || nodeAfter)
{
@ -1230,8 +1234,10 @@ nsresult nsGeneratedSubtreeIterator::GetTopAncestorInRange(
// sanity check: aNode is itself in the range
PRBool nodeBefore, nodeAfter;
if (NS_FAILED(CompareNodeToRange(aNode, mRange, &nodeBefore, &nodeAfter)))
if (NS_FAILED(nsRange::CompareNodeToRange(aNode, mRange, &nodeBefore,
&nodeAfter)))
return NS_ERROR_FAILURE;
if (nodeBefore || nodeAfter)
return NS_ERROR_FAILURE;
@ -1240,8 +1246,10 @@ nsresult nsGeneratedSubtreeIterator::GetTopAncestorInRange(
{
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))) || !parent)
return NS_ERROR_FAILURE;
if (NS_FAILED(CompareNodeToRange(parent, mRange, &nodeBefore, &nodeAfter)))
if (NS_FAILED(nsRange::CompareNodeToRange(parent, mRange, &nodeBefore,
&nodeAfter)))
return NS_ERROR_FAILURE;
if (nodeBefore || nodeAfter)
{
*outAnestor = aNode;

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

@ -178,10 +178,11 @@ PRBool IsNodeIntersectsRange(nsIContent* aNode, nsIDOMRange* aRange)
// Note that both of the above might be true.
// If neither are true, the node is contained inside of the range.
// XXX - callers responsibility to ensure node in same doc as range!
nsresult CompareNodeToRange(nsIContent* aNode,
nsIDOMRange* aRange,
PRBool *outNodeBefore,
PRBool *outNodeAfter)
// static
nsresult
nsRange::CompareNodeToRange(nsIContent* aNode, nsIDOMRange* aRange,
PRBool *outNodeBefore, PRBool *outNodeAfter)
{
// create a pair of dom points that expresses location of node:
// NODE(start), NODE(end)
@ -377,12 +378,11 @@ nsRangeUtils::IsNodeIntersectsRange(nsIContent* aNode, nsIDOMRange* aRange)
}
NS_IMETHODIMP
nsRangeUtils::CompareNodeToRange(nsIContent* aNode,
nsIDOMRange* aRange,
PRBool *outNodeBefore,
PRBool *outNodeAfter)
nsRangeUtils::CompareNodeToRange(nsIContent* aNode, nsIDOMRange* aRange,
PRBool *outNodeBefore, PRBool *outNodeAfter)
{
return ::CompareNodeToRange(aNode, aRange, outNodeBefore, outNodeAfter);
return nsRange::CompareNodeToRange(aNode, aRange, outNodeBefore,
outNodeAfter);
}
#ifdef XP_MAC
@ -1171,12 +1171,6 @@ nsresult nsRange::Collapse(PRBool aToStart)
return DoSetRange(mEndParent,mEndOffset,mEndParent,mEndOffset);
}
nsresult nsRange::Unposition()
{
return DoSetRange(nsCOMPtr<nsIDOMNode>(),0,nsCOMPtr<nsIDOMNode>(),0);
// note that "nsCOMPtr<nsIDOMmNode>()" is the moral equivalent of null
}
nsresult nsRange::SelectNode(nsIDOMNode* aN)
{
if (!nsContentUtils::CanCallerAccess(aN)) {
@ -1749,8 +1743,9 @@ nsresult nsRange::DeleteContents()
return CollapseRangeAfterDelete(this);
}
nsresult nsRange::CompareBoundaryPoints(PRUint16 how, nsIDOMRange* srcRange,
PRInt32* aCmpRet)
NS_IMETHODIMP
nsRange::CompareBoundaryPoints(PRUint16 how, nsIDOMRange* srcRange,
PRInt16* aCmpRet)
{
if(IsDetached())
return NS_ERROR_DOM_INVALID_STATE_ERR;

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

@ -90,49 +90,7 @@ public:
static void Shutdown();
// nsIDOMRange interface
NS_IMETHOD GetIsPositioned(PRBool* aIsPositioned);
NS_IMETHOD GetStartContainer(nsIDOMNode** aStartParent);
NS_IMETHOD GetStartOffset(PRInt32* aStartOffset);
NS_IMETHOD GetEndContainer(nsIDOMNode** aEndParent);
NS_IMETHOD GetEndOffset(PRInt32* aEndOffset);
NS_IMETHOD GetCollapsed(PRBool* aIsCollapsed);
NS_IMETHOD GetCommonAncestorContainer(nsIDOMNode** aCommonParent);
NS_IMETHOD SetStart(nsIDOMNode* aParent, PRInt32 aOffset);
NS_IMETHOD SetStartBefore(nsIDOMNode* aSibling);
NS_IMETHOD SetStartAfter(nsIDOMNode* aSibling);
NS_IMETHOD SetEnd(nsIDOMNode* aParent, PRInt32 aOffset);
NS_IMETHOD SetEndBefore(nsIDOMNode* aSibling);
NS_IMETHOD SetEndAfter(nsIDOMNode* aSibling);
NS_IMETHOD Collapse(PRBool aToStart);
NS_IMETHOD Unposition();
NS_IMETHOD SelectNode(nsIDOMNode* aN);
NS_IMETHOD SelectNodeContents(nsIDOMNode* aN);
NS_IMETHOD CompareBoundaryPoints(PRUint16 how, nsIDOMRange* srcRange, PRInt32* ret);
NS_IMETHOD DeleteContents();
NS_IMETHOD ExtractContents(nsIDOMDocumentFragment** aReturn);
NS_IMETHOD CloneContents(nsIDOMDocumentFragment** aReturn);
NS_IMETHOD InsertNode(nsIDOMNode* aN);
NS_IMETHOD SurroundContents(nsIDOMNode* aN);
NS_IMETHOD CloneRange(nsIDOMRange** aReturn);
NS_IMETHOD Detach();
NS_IMETHOD ToString(nsAString& aReturn);
NS_DECL_NSIDOMRANGE
/*BEGIN nsIDOMNSRange interface implementations*/
NS_IMETHOD CreateContextualFragment(const nsAString& aFragment,
@ -201,6 +159,17 @@ public:
nsIDOMNode** closestAncestor,
nsIDOMNode** farthestAncestor);
/******************************************************************************
* Utility routine to detect if a content node starts before a range and/or
* ends after a range. If neither it is contained inside the range.
*
* XXX - callers responsibility to ensure node in same doc as range!
*
*****************************************************************************/
static nsresult CompareNodeToRange(nsIContent* aNode, nsIDOMRange* aRange,
PRBool *outNodeBefore,
PRBool *outNodeAfter);
protected:
// CollapseRangeAfterDelete() should only be called from DeleteContents()
@ -227,6 +196,7 @@ protected:
nsresult ContentOwnsUs(nsIDOMNode* domNode);
nsresult GetIsPositioned(PRBool* aIsPositioned);
};
// Make a new nsIDOMRange object
@ -251,19 +221,6 @@ PRInt32 ComparePoints(nsIDOMNode* aParent1, PRInt32 aOffset1,
PRBool IsNodeIntersectsRange(nsIContent* aNode, nsIDOMRange* aRange);
/*************************************************************************************
* Utility routine to detect if a content node starts before a range and/or
* ends after a range. If neither it is contained inside the range.
*
* XXX - callers responsibility to ensure node in same doc as range!
*
************************************************************************************/
nsresult CompareNodeToRange(nsIContent* aNode,
nsIDOMRange* aRange,
PRBool *outNodeBefore,
PRBool *outNodeAfter);
/*************************************************************************************
* Utility routine to create a pair of dom points to represent
* the start and end locations of a single node. Return false

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

@ -6946,9 +6946,9 @@ nsTypedSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYe
// else not recursive -- node itself must be contained,
// so we need to do more checking
PRBool nodeStartsBeforeRange, nodeEndsAfterRange;
if (NS_SUCCEEDED(CompareNodeToRange(content, range,
&nodeStartsBeforeRange,
&nodeEndsAfterRange)))
if (NS_SUCCEEDED(nsRange::CompareNodeToRange(content, range,
&nodeStartsBeforeRange,
&nodeEndsAfterRange)))
{
#ifdef DEBUG_ContainsNode
nsAutoString name, value;

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

@ -162,7 +162,25 @@ public:
NS_DECL_NSIDOM3NODE
// nsIDOMHTMLDocument interface
NS_DECL_NSIDOMHTMLDOCUMENT
NS_IMETHOD GetTitle(nsAString & aTitle);
NS_IMETHOD SetTitle(const nsAString & aTitle);
NS_IMETHOD GetReferrer(nsAString & aReferrer);
NS_IMETHOD GetURL(nsAString & aURL);
NS_IMETHOD GetBody(nsIDOMHTMLElement * *aBody);
NS_IMETHOD SetBody(nsIDOMHTMLElement * aBody);
NS_IMETHOD GetImages(nsIDOMHTMLCollection * *aImages);
NS_IMETHOD GetApplets(nsIDOMHTMLCollection * *aApplets);
NS_IMETHOD GetLinks(nsIDOMHTMLCollection * *aLinks);
NS_IMETHOD GetForms(nsIDOMHTMLCollection * *aForms);
NS_IMETHOD GetAnchors(nsIDOMHTMLCollection * *aAnchors);
NS_IMETHOD GetCookie(nsAString & aCookie);
NS_IMETHOD SetCookie(const nsAString & aCookie);
NS_IMETHOD Open(void);
NS_IMETHOD Close(void);
NS_IMETHOD Write(const nsAString & text);
NS_IMETHOD Writeln(const nsAString & text);
NS_IMETHOD GetElementsByName(const nsAString & elementName,
nsIDOMNodeList **_retval);
// nsIDOMNSHTMLDocument interface
NS_DECL_NSIDOMNSHTMLDOCUMENT

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

@ -78,7 +78,10 @@ interface nsIDOMNodeList;
interface nsIDOMNotation;
interface nsIDOMProcessingInstruction;
interface nsIDOMText;
// Needed for raises() in our IDL
interface DOMException;
interface RangeException;
// Style Sheets
interface nsIDOMStyleSheetList;

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

@ -39,9 +39,20 @@
#include "nsIDOMCSSValue.idl"
/**
* The nsIDOMCSSPrimitiveValue interface is a datatype for a primitive
* CSS value in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(e249031f-8df9-4e7a-b644-18946dce0019)]
interface nsIDOMCSSPrimitiveValue : nsIDOMCSSValue
{
// UnitTypes
const unsigned short CSS_UNKNOWN = 0;
const unsigned short CSS_NUMBER = 1;
const unsigned short CSS_PERCENTAGE = 2;

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

@ -40,9 +40,20 @@
#include "domstubs.idl"
/**
* The nsIDOMCSSRule interface is a datatype for a CSS style rule in
* the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90c1-15b3-11d2-932e-00805f8add32)]
interface nsIDOMCSSRule : nsISupports
{
// RuleType
const unsigned short UNKNOWN_RULE = 0;
const unsigned short STYLE_RULE = 1;
const unsigned short CHARSET_RULE = 2;

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

@ -40,6 +40,16 @@
#include "domstubs.idl"
/**
* The nsIDOMCSSRuleList interface is a datatype for a list of CSS
* style rules in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90c0-15b3-11d2-932e-00805f8add32)]
interface nsIDOMCSSRuleList : nsISupports
{

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

@ -40,6 +40,16 @@
#include "domstubs.idl"
/**
* The nsIDOMCSSStyleDeclaration interface is a datatype for a CSS
* style declaration in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90be-15b3-11d2-932e-00805f8add32)]
interface nsIDOMCSSStyleDeclaration : nsISupports
{
@ -55,9 +65,7 @@ interface nsIDOMCSSStyleDeclaration : nsISupports
in DOMString value,
in DOMString priority)
raises(DOMException);
readonly attribute unsigned long length;
DOMString item(in unsigned long index);
readonly attribute nsIDOMCSSRule parentRule;
readonly attribute nsIDOMCSSRule parentRule;
};

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

@ -40,6 +40,16 @@
#include "nsIDOMStyleSheet.idl"
/**
* The nsIDOMCSSStyleSheet interface is a datatype for a CSS style
* sheet in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90c2-15b3-11d2-932e-00805f8add32)]
interface nsIDOMCSSStyleSheet : nsIDOMStyleSheet
{

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

@ -39,9 +39,20 @@
#include "domstubs.idl"
/**
* The nsIDOMCSSValue interface is a datatype for a CSS value in the
* Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(009f7ea5-9e80-41be-b008-db62f10823f2)]
interface nsIDOMCSSValue : nsISupports
{
// UnitTypes
const unsigned short CSS_INHERIT = 0;
const unsigned short CSS_PRIMITIVE_VALUE = 1;
const unsigned short CSS_VALUE_LIST = 2;

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

@ -37,22 +37,19 @@
#include "nsIDOMCSSValue.idl"
/**
* The nsIDOMCSSValueList interface is a datatype for a list of CSS
* values in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(8f09fa84-39b9-4dca-9b2f-db0eeb186286)]
interface nsIDOMCSSValueList : nsIDOMCSSValue
{
// Introduced in DOM Level 2:
/**
* The number of items in the CSSValueList.
*/
readonly attribute unsigned long length;
/**
* Retrieve the indexth CSSValue from the CSSValueList.
*
* @param index Specifies the index of the desired
* CSSValue in the list.
* @return nsIDOMCSSValue The CSSValue at the requested index.
*/
readonly attribute unsigned long length;
nsIDOMCSSValue item(in unsigned long index);
};

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

@ -40,6 +40,16 @@
#include "nsIDOMUIEvent.idl"
/**
* The nsIDOMMouseEvent interface is the datatype for all mouse events
* in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Events/
*
* @status FROZEN
*/
[scriptable, uuid(ff751edc-8b02-aae7-0010-8301838a3123)]
interface nsIDOMMouseEvent : nsIDOMUIEvent
{
@ -49,9 +59,9 @@ interface nsIDOMMouseEvent : nsIDOMUIEvent
readonly attribute long clientX;
readonly attribute long clientY;
readonly attribute boolean altKey;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
readonly attribute boolean altKey;
readonly attribute boolean metaKey;
readonly attribute unsigned short button;

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

@ -40,6 +40,16 @@
#include "nsIDOMEvent.idl"
/**
* The nsIDOMUIEvent interface is the datatype for all UI events in the
* Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Events/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90c3-15b3-11d2-932e-00805f8add32)]
interface nsIDOMUIEvent : nsIDOMEvent
{

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

@ -40,6 +40,16 @@
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLAppletElement interface is the interface to a [X]HTML
* applet element.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90ae-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLAppletElement : nsIDOMHTMLElement
{
@ -49,9 +59,12 @@ interface nsIDOMHTMLAppletElement : nsIDOMHTMLElement
attribute DOMString code;
attribute DOMString codeBase;
attribute DOMString height;
// Modified in DOM Level 2:
attribute long hspace;
attribute DOMString name;
// Modified in DOM Level 2:
attribute DOMString object;
// Modified in DOM Level 2:
attribute long vspace;
attribute DOMString width;
};

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

@ -40,6 +40,16 @@
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLAreaElement interface is the interface to a [X]HTML
* area element.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90b0-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLAreaElement : nsIDOMHTMLElement
{

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

@ -40,6 +40,16 @@
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLBaseElement interface is the interface to a [X]HTML
* base element.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf908b-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLBaseElement : nsIDOMHTMLElement
{

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

@ -40,6 +40,16 @@
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLBodyElement interface is the interface to a [X]HTML
* body element.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf908e-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLBodyElement : nsIDOMHTMLElement
{

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

@ -40,6 +40,16 @@
#include "domstubs.idl"
/**
* The nsIDOMHTMLCollection interface is an interface to a collection
* of [X]HTML elements.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf9083-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLCollection : nsISupports
{

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

@ -40,12 +40,24 @@
#include "nsIDOMDocument.idl"
/**
* The nsIDOMHTMLDocument interface is the interface to a [X]HTML
* document object.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf9084-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLDocument : nsIDOMDocument
{
attribute DOMString title;
readonly attribute DOMString referrer;
attribute DOMString domain;
// domain is readonly per spec, but it's settable in
// nsIDOMNSHTMLDocument
[noscript] readonly attribute DOMString domain;
readonly attribute DOMString URL;
attribute nsIDOMHTMLElement body;
readonly attribute nsIDOMHTMLCollection images;
@ -54,7 +66,11 @@ interface nsIDOMHTMLDocument : nsIDOMDocument
readonly attribute nsIDOMHTMLCollection forms;
readonly attribute nsIDOMHTMLCollection anchors;
attribute DOMString cookie;
// raises(DOMException) on setting
// open() is noscript here since the DOM Level 0 version of open()
// returned nsIDOMDocument, and not void. The script version of
// open() is defined in nsIDOMNSHTMLDocument.
[noscript] void open();
void close();

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

@ -40,6 +40,17 @@
#include "nsIDOMElement.idl"
/**
* The nsIDOMHTMLElement interface is the primary [X]HTML element
* interface. It represents a single [X]HTML element in the document
* tree.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf9085-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLElement : nsIDOMElement
{

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

@ -40,6 +40,16 @@
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLFrameElement interface is the interface to a [X]HTML
* frame element.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90b9-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLFrameElement : nsIDOMHTMLElement
{

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

@ -40,6 +40,16 @@
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLIFrameElement interface is the interface to a [X]HTML
* iframe element.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90ba-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLIFrameElement : nsIDOMHTMLElement
{

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

@ -40,6 +40,16 @@
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLImageElement interface is the interface to a [X]HTML
* img element.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90ab-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
{
@ -47,12 +57,16 @@ interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
attribute DOMString align;
attribute DOMString alt;
attribute DOMString border;
// Modified in DOM Level 2:
attribute long height;
// Modified in DOM Level 2:
attribute long hspace;
attribute boolean isMap;
attribute DOMString longDesc;
attribute DOMString src;
attribute long vspace;
attribute long width;
attribute DOMString useMap;
// Modified in DOM Level 2:
attribute long vspace;
// Modified in DOM Level 2:
attribute long width;
};

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

@ -40,6 +40,16 @@
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLInputElement interface is the interface to a [X]HTML
* input element.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf9093-15b3-11d2-932e-00805f8add32)]
interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
{
@ -55,9 +65,11 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
attribute long maxLength;
attribute DOMString name;
attribute boolean readOnly;
// Modified in DOM Level 2:
attribute unsigned long size;
attribute DOMString src;
attribute long tabIndex;
// Modified in DOM Level 2:
attribute DOMString type;
attribute DOMString useMap;
attribute DOMString value;

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

@ -51,6 +51,7 @@ interface nsIDOMNSHTMLDocument : nsISupports
attribute DOMString bgColor;
attribute DOMString fgColor;
readonly attribute DOMString lastModified;
attribute DOMString domain;
readonly attribute nsIDOMHTMLCollection embeds;

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

@ -39,8 +39,17 @@
#include "domstubs.idl"
/**
* The nsIDOMDocumentRange interface is an interface to a document
* object that supports ranges in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Traversal-Range/
*
* @status FROZEN
*/
[scriptable, uuid(7b9badc6-c9bc-447a-8670-dbd195aed24b)]
// Introduced in DOM Level 2:
interface nsIDOMDocumentRange : nsISupports {
nsIDOMRange createRange();
nsIDOMRange createRange();
};

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

@ -38,162 +38,80 @@
*
* ***** END LICENSE BLOCK ***** */
/*
* The complete Range spec is located at:
* http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
*/
#include "domstubs.idl"
/**
* The nsIDOMRange interface is an interface to a DOM range object.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Traversal-Range/
*
* @status FROZEN
*/
[scriptable, uuid(a6cf90ce-15b3-11d2-932e-00805f8add32)]
interface nsIDOMRange : nsISupports
{
/**
* CompareHow group
* Passed as a parameter to the compareBoundaryPoints method.
*/
const unsigned short START_TO_START = 0;// Compare start boundary-point of sourceRange to start boundary-point of Range on which compareBoundaryPoints is invoked
const unsigned short START_TO_END = 1; // Compare start boundary-point of sourceRange to end boundary-point of Range on which compareBoundaryPoints is invoked
const unsigned short END_TO_START = 2; // Compare end boundary-point of sourceRange to start boundary-point of Range on which compareBoundaryPoints is invoked
const unsigned short END_TO_END = 3; // Compare end boundary-point of sourceRange to end boundary-point of Range on which compareBoundaryPoints is invoked
readonly attribute nsIDOMNode startContainer;
// raises(DOMException) on retrieval
readonly attribute nsIDOMNode startContainer;// Node within which the Range begins
readonly attribute long startOffset; // Offset within the starting node of the Range
readonly attribute nsIDOMNode endContainer; // Node within which the Range ends
readonly attribute long endOffset; // Offset within the ending node of the Range
readonly attribute long startOffset;
// raises(DOMException) on retrieval
readonly attribute boolean collapsed; // TRUE if the Range is collapsed
readonly attribute nsIDOMNode commonAncestorContainer; //The deepest common ancestor container of the Range's two boundary-points
readonly attribute nsIDOMNode endContainer;
// raises(DOMException) on retrieval
readonly attribute long endOffset;
// raises(DOMException) on retrieval
/**
* Sets the attributes describing the start of the Range. The start
* position of a Range is guaranteed to never be after the end position.
* To enforce this restriction, if the start is set to be at a position
* after the end, the Range is collapsed to that position
* @param parent The Parent Node value. This parameter must not be null.
* @param offset start offset value.
*/
void setStart(in nsIDOMNode parent, in long offset);
readonly attribute boolean collapsed;
// raises(DOMException) on retrieval
/**
* Sets the start position to be before the specified node.
* @param sibling Range starts before sibling Node.
*/
void setStartBefore(in nsIDOMNode sibling);
readonly attribute nsIDOMNode commonAncestorContainer;
// raises(DOMException) on retrieval
/**
* Sets the start position to be after the specified node.
* @param sibling Range starts after sibling Node.
*/
void setStartAfter(in nsIDOMNode sibling);
void setStart(in nsIDOMNode refNode, in long offset)
raises(RangeException, DOMException);
void setEnd(in nsIDOMNode refNode, in long offset)
raises(RangeException, DOMException);
void setStartBefore(in nsIDOMNode refNode)
raises(RangeException, DOMException);
void setStartAfter(in nsIDOMNode refNode)
raises(RangeException, DOMException);
void setEndBefore(in nsIDOMNode refNode)
raises(RangeException, DOMException);
void setEndAfter(in nsIDOMNode refNode)
raises(RangeException, DOMException);
void collapse(in boolean toStart)
raises(DOMException);
void selectNode(in nsIDOMNode refNode)
raises(RangeException, DOMException);
void selectNodeContents(in nsIDOMNode refNode)
raises(RangeException, DOMException);
/**
* Sets the attributes describing the end of a Range. If the
* end is set to be at a position before the start, the Range
* is collapsed to that position.
* @param parent The Parent Node value. This parameter must not be null.
* @param offset end offset value.
*/
void setEnd(in nsIDOMNode parent, in long offset);
// CompareHow
const unsigned short START_TO_START = 0;
const unsigned short START_TO_END = 1;
const unsigned short END_TO_END = 2;
const unsigned short END_TO_START = 3;
/**
* Sets the end position to be before the specified node
* @param sibling Range ends before sibling Node.
*/
void setEndBefore(in nsIDOMNode sibling);
/**
* Sets the end position to be after the specified node
* @param sibling Range ends before sibling Node.
*/
void setEndAfter(in nsIDOMNode sibling);
/**
* Collapse a Range onto one of its boundary-points
* @param toStart If TRUE. collapses the Range onto its start,
* if FALSE, collapses onto its end.
*/
void collapse(in boolean toStart);
/**
* Select a node and its contents. Replaces the
* contents of the range with this node.
* @param n The Node to select.
*/
void selectNode(in nsIDOMNode n);
/**
* Select the contents within a node. Replace the
* contents of the range with this node's contents.
* @param n Node to select from.
*/
void selectNodeContents(in nsIDOMNode n);
/**
* Compare the boundary-points of two Ranges in a document.
* @param how parameter from CompareHow group, how the boundary points
* are to be compared.
* @param srcRange the range which will have its boundary points compared.
* Return Value: -1, 0 or 1 depending on whether the corresponding
* boundary-point of the Range is before, equal to, or after the
* corresponding boundary-point of sourceRange.
*/
long compareBoundaryPoints(in unsigned short how, in nsIDOMRange srcRange);
/**
* Removes the contents of a Range from the containing document or document
* fragment without returning a reference to the removed content.
*/
void deleteContents();
/**
* Moves the contents of a Range from the containing document or document
* fragment to a new DocumentFragment.
* Return Value: A DocumentFragment containing the extracted contents.
*/
nsIDOMDocumentFragment extractContents();
/**
* Duplicates the contents of a Range
* Return Value: A DocumentFragment that contains content equivalent to this Range.
*/
nsIDOMDocumentFragment cloneContents();
/**
* Inserts a node into the Document or DocumentFragment at the start of the Range.
* If the container is a Text node, this will be split at the start of the Range.
* Adjacent Text nodes will not be automatically merged.
* @param n The node to insert at the start of the Range
*/
void insertNode(in nsIDOMNode n);
/**
* Reparents the contents of the Range to the given node and inserts
* the node at the position of the start of the Range.
* @param n The node to surround the contents with.
*/
void surroundContents(in nsIDOMNode n);
/**
* Produces a new Range whose boundary-points are equal to the
* boundary-points of the Range.
* Return Value: The duplicated Range.
*/
nsIDOMRange cloneRange();
/**
* Called to indicate that the Range is no longer in use and that
* the implementation may relinquish any resources associated with
* this Range. Subsequent calls to any methods or attribute getters
* on this Range will result in a DOMException being thrown with an
* error code of INVALID_STATE_ERR.
*/
void detach();
/**
* Returns the contents of a Range as a string. This string contains
* only the data characters, not any markup.
* Return Value: The contents of the Range.
*/
DOMString toString();
short compareBoundaryPoints(in unsigned short how,
in nsIDOMRange sourceRange)
raises(DOMException);
void deleteContents()
raises(DOMException);
nsIDOMDocumentFragment extractContents()
raises(DOMException);
nsIDOMDocumentFragment cloneContents()
raises(DOMException);
void insertNode(in nsIDOMNode newNode)
raises(DOMException, RangeException);
void surroundContents(in nsIDOMNode newParent)
raises(DOMException, RangeException);
nsIDOMRange cloneRange()
raises(DOMException);
DOMString toString()
raises(DOMException);
void detach()
raises(DOMException);
};

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

@ -40,6 +40,16 @@
#include "domstubs.idl"
/**
* The nsIDOMDocumentStyle interface is an interface to a document
* object that supports style sheets in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(3d9f4973-dd2e-48f5-b5f7-2634e09eadd9)]
interface nsIDOMDocumentStyle : nsISupports
{

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

@ -40,6 +40,16 @@
#include "domstubs.idl"
/**
* The nsIDOMMediaList interface is a datatype for a list of media
* types in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(9b0c2ed7-111c-4824-adf9-ef0da6dad371)]
interface nsIDOMMediaList : nsISupports
{
@ -48,7 +58,6 @@ interface nsIDOMMediaList : nsISupports
readonly attribute unsigned long length;
DOMString item(in unsigned long index);
void deleteMedium(in DOMString oldMedium)
raises(DOMException);
void appendMedium(in DOMString newMedium)

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

@ -40,6 +40,16 @@
#include "domstubs.idl"
/**
* The nsIDOMStyleSheet interface is a datatype for a style sheet in
* the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Style
*
* @status FROZEN
*/
[scriptable, uuid(a6cf9080-15b3-11d2-932e-00805f8add32)]
interface nsIDOMStyleSheet : nsISupports
{

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

@ -39,10 +39,18 @@
#include "domstubs.idl"
/**
* The nsIDOMAbstractView interface is a datatype for a view in the
* Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Views
*
* @status FROZEN
*/
[scriptable, uuid(F51EBADE-8B1A-11D3-AAE7-0010830123B4)]
interface nsIDOMAbstractView : nsISupports
{
readonly attribute nsIDOMDocumentView document;
};

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

@ -39,10 +39,19 @@
#include "domstubs.idl"
/**
* The nsIDOMDocumentView interface is a datatype for a document that
* supports views in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Views
*
* @status FROZEN
*/
[scriptable, uuid(1ACDB2BA-1DD2-11B2-95BC-9542495D2569)]
interface nsIDOMDocumentView : nsISupports
{
readonly attribute nsIDOMAbstractView defaultView;
};

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

@ -167,7 +167,7 @@ nsSelectionState::IsEqual(nsSelectionState *aSelState)
itsItem->GetRange(address_of(itsRange));
if (!myRange || !itsRange) return PR_FALSE;
PRInt32 compResult;
PRInt16 compResult;
myRange->CompareBoundaryPoints(nsIDOMRange::START_TO_START, itsRange, &compResult);
if (compResult) return PR_FALSE;
myRange->CompareBoundaryPoints(nsIDOMRange::END_TO_END, itsRange, &compResult);

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

@ -7460,7 +7460,7 @@ nsHTMLEditRules::UpdateDocChangeRange(nsIDOMRange *aRange)
}
else
{
PRInt32 result;
PRInt16 result;
// compare starts of ranges
res = mDocChangeRange->CompareBoundaryPoints(nsIDOMRange::START_TO_START, aRange, &result);

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

@ -1223,7 +1223,7 @@ nsTypeAheadFind::FindItNow(nsIPresShell *aPresShell,
return NS_ERROR_FAILURE;
}
PRInt32 rangeCompareResult = 0;
PRInt16 rangeCompareResult = 0;
mStartPointRange->CompareBoundaryPoints(nsIDOMRange::START_TO_START,
mSearchRange, &rangeCompareResult);
// No need to wrap find in doc if starting at beginning

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

@ -6946,9 +6946,9 @@ nsTypedSelection::ContainsNode(nsIDOMNode* aNode, PRBool aRecursive, PRBool* aYe
// else not recursive -- node itself must be contained,
// so we need to do more checking
PRBool nodeStartsBeforeRange, nodeEndsAfterRange;
if (NS_SUCCEEDED(CompareNodeToRange(content, range,
&nodeStartsBeforeRange,
&nodeEndsAfterRange)))
if (NS_SUCCEEDED(nsRange::CompareNodeToRange(content, range,
&nodeStartsBeforeRange,
&nodeEndsAfterRange)))
{
#ifdef DEBUG_ContainsNode
nsAutoString name, value;