2015-05-03 19:32:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1998-12-16 18:36:48 +00:00
|
|
|
|
|
|
|
/*
|
2006-03-31 08:41:49 +00:00
|
|
|
* Implementation of the DOM nsIDOMRange object.
|
1998-12-16 18:36:48 +00:00
|
|
|
*/
|
|
|
|
|
2006-03-31 08:00:42 +00:00
|
|
|
#ifndef nsRange_h___
|
|
|
|
#define nsRange_h___
|
|
|
|
|
1998-12-18 02:51:34 +00:00
|
|
|
#include "nsIDOMRange.h"
|
1999-02-14 09:14:50 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2012-07-01 23:45:59 +00:00
|
|
|
#include "nsINode.h"
|
2013-02-07 12:09:41 +00:00
|
|
|
#include "nsIDocument.h"
|
1999-02-15 16:26:04 +00:00
|
|
|
#include "nsIDOMNode.h"
|
2014-06-04 20:54:00 +00:00
|
|
|
#include "nsLayoutUtils.h"
|
1999-07-03 11:14:08 +00:00
|
|
|
#include "prmon.h"
|
2006-11-03 21:51:01 +00:00
|
|
|
#include "nsStubMutationObserver.h"
|
2013-02-07 12:09:41 +00:00
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
#include "mozilla/Attributes.h"
|
1998-12-18 02:51:34 +00:00
|
|
|
|
2013-02-07 12:09:41 +00:00
|
|
|
namespace mozilla {
|
|
|
|
class ErrorResult;
|
|
|
|
namespace dom {
|
|
|
|
class DocumentFragment;
|
2013-09-20 10:21:03 +00:00
|
|
|
class DOMRect;
|
|
|
|
class DOMRectList;
|
2015-08-12 17:26:01 +00:00
|
|
|
class Selection;
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2013-02-07 12:09:41 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsRange final : public nsIDOMRange,
|
2015-03-27 18:52:19 +00:00
|
|
|
public nsStubMutationObserver,
|
|
|
|
public nsWrapperCache
|
1998-12-18 02:51:34 +00:00
|
|
|
{
|
2013-02-07 12:09:41 +00:00
|
|
|
typedef mozilla::ErrorResult ErrorResult;
|
2013-09-20 10:21:03 +00:00
|
|
|
typedef mozilla::dom::DOMRect DOMRect;
|
|
|
|
typedef mozilla::dom::DOMRectList DOMRectList;
|
2013-02-07 12:09:41 +00:00
|
|
|
|
2014-06-25 02:09:15 +00:00
|
|
|
virtual ~nsRange();
|
|
|
|
|
1998-12-18 02:51:34 +00:00
|
|
|
public:
|
2015-08-12 17:26:01 +00:00
|
|
|
explicit nsRange(nsINode* aNode);
|
1998-12-18 02:51:34 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
static nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset,
|
|
|
|
nsIDOMNode* aEndParent, int32_t aEndOffset,
|
2012-01-15 08:13:12 +00:00
|
|
|
nsRange** aRange);
|
2012-08-22 15:56:38 +00:00
|
|
|
static nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset,
|
|
|
|
nsIDOMNode* aEndParent, int32_t aEndOffset,
|
2012-01-15 08:13:12 +00:00
|
|
|
nsIDOMRange** aRange);
|
2013-04-16 21:12:03 +00:00
|
|
|
static nsresult CreateRange(nsINode* aStartParent, int32_t aStartOffset,
|
|
|
|
nsINode* aEndParent, int32_t aEndOffset,
|
|
|
|
nsRange** aRange);
|
2012-01-15 08:13:12 +00:00
|
|
|
|
2008-12-03 10:03:10 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2013-02-07 12:09:41 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsRange, nsIDOMRange)
|
2006-10-21 01:30:54 +00:00
|
|
|
|
2013-06-07 04:26:28 +00:00
|
|
|
/**
|
|
|
|
* The DOM Range spec requires that when a node is removed from its parent,
|
|
|
|
* and the node's subtree contains the start or end point of a range, that
|
|
|
|
* start or end point is moved up to where the node was removed from its
|
|
|
|
* parent.
|
|
|
|
* For some internal uses of Ranges it's useful to disable that behavior,
|
|
|
|
* so that a range of children within a single parent is preserved even if
|
|
|
|
* that parent is removed from the document tree.
|
|
|
|
*/
|
|
|
|
void SetEnableGravitationOnElementRemoval(bool aEnable)
|
|
|
|
{
|
|
|
|
mEnableGravitationOnElementRemoval = aEnable;
|
|
|
|
}
|
|
|
|
|
1998-12-18 09:28:55 +00:00
|
|
|
// nsIDOMRange interface
|
2003-01-14 23:05:52 +00:00
|
|
|
NS_DECL_NSIDOMRANGE
|
2013-07-12 03:29:24 +00:00
|
|
|
|
2012-01-10 14:19:54 +00:00
|
|
|
nsINode* GetRoot() const
|
|
|
|
{
|
|
|
|
return mRoot;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsINode* GetStartParent() const
|
|
|
|
{
|
|
|
|
return mStartParent;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsINode* GetEndParent() const
|
|
|
|
{
|
|
|
|
return mEndParent;
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t StartOffset() const
|
2012-01-10 14:19:54 +00:00
|
|
|
{
|
|
|
|
return mStartOffset;
|
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t EndOffset() const
|
2012-01-10 14:19:54 +00:00
|
|
|
{
|
|
|
|
return mEndOffset;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsPositioned() const
|
|
|
|
{
|
|
|
|
return mIsPositioned;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetMaySpanAnonymousSubtrees(bool aMaySpanAnonymousSubtrees)
|
|
|
|
{
|
|
|
|
mMaySpanAnonymousSubtrees = aMaySpanAnonymousSubtrees;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-08-12 17:26:01 +00:00
|
|
|
* Return true iff this range is part of a Selection object
|
2012-01-10 14:19:54 +00:00
|
|
|
* and isn't detached.
|
|
|
|
*/
|
|
|
|
bool IsInSelection() const
|
|
|
|
{
|
2015-08-12 17:26:01 +00:00
|
|
|
return !!mSelection;
|
2012-01-10 14:19:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when the range is added/removed from a Selection.
|
|
|
|
*/
|
2015-08-12 17:26:01 +00:00
|
|
|
void SetSelection(mozilla::dom::Selection* aSelection);
|
2012-01-10 14:19:54 +00:00
|
|
|
|
2015-02-21 04:27:59 +00:00
|
|
|
/**
|
|
|
|
* Return true if this range was generated.
|
|
|
|
* @see SetIsGenerated
|
|
|
|
*/
|
|
|
|
bool IsGenerated() const
|
|
|
|
{
|
|
|
|
return mIsGenerated;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mark this range as being generated or not.
|
|
|
|
* Currently it is used for marking ranges that are created when splitting up
|
|
|
|
* a range to exclude a -moz-user-select:none region.
|
|
|
|
* @see Selection::AddItem
|
|
|
|
* @see ExcludeNonSelectableNodes
|
|
|
|
*/
|
|
|
|
void SetIsGenerated(bool aIsGenerated)
|
|
|
|
{
|
|
|
|
mIsGenerated = aIsGenerated;
|
|
|
|
}
|
|
|
|
|
2012-01-10 14:19:54 +00:00
|
|
|
nsINode* GetCommonAncestor() const;
|
|
|
|
void Reset();
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult SetStart(nsINode* aParent, int32_t aOffset);
|
|
|
|
nsresult SetEnd(nsINode* aParent, int32_t aOffset);
|
2012-06-25 11:44:11 +00:00
|
|
|
already_AddRefed<nsRange> CloneRange() const;
|
2010-07-21 22:05:17 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult Set(nsINode* aStartParent, int32_t aStartOffset,
|
|
|
|
nsINode* aEndParent, int32_t aEndOffset)
|
2011-11-04 05:32:09 +00:00
|
|
|
{
|
|
|
|
// If this starts being hot, we may be able to optimize this a bit,
|
|
|
|
// but for now just set start and end separately.
|
|
|
|
nsresult rv = SetStart(aStartParent, aStartOffset);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
return SetEnd(aEndParent, aEndOffset);
|
|
|
|
}
|
|
|
|
|
2011-06-16 06:31:36 +00:00
|
|
|
NS_IMETHOD GetUsedFontFaces(nsIDOMFontFaceList** aResult);
|
|
|
|
|
2006-11-03 21:51:01 +00:00
|
|
|
// nsIMutationObserver methods
|
2010-07-21 22:05:17 +00:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_PARENTCHAINCHANGED
|
2011-12-20 09:15:41 +00:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
1998-12-18 02:51:34 +00:00
|
|
|
|
2013-02-07 12:09:41 +00:00
|
|
|
// WebIDL
|
2013-05-21 18:33:28 +00:00
|
|
|
static already_AddRefed<nsRange>
|
|
|
|
Constructor(const mozilla::dom::GlobalObject& global,
|
|
|
|
mozilla::ErrorResult& aRv);
|
|
|
|
|
2013-02-07 12:09:41 +00:00
|
|
|
bool Collapsed() const
|
|
|
|
{
|
|
|
|
return mIsPositioned && mStartParent == mEndParent &&
|
|
|
|
mStartOffset == mEndOffset;
|
|
|
|
}
|
|
|
|
already_AddRefed<mozilla::dom::DocumentFragment>
|
|
|
|
CreateContextualFragment(const nsAString& aString, ErrorResult& aError);
|
|
|
|
already_AddRefed<mozilla::dom::DocumentFragment>
|
|
|
|
CloneContents(ErrorResult& aErr);
|
|
|
|
int16_t CompareBoundaryPoints(uint16_t aHow, nsRange& aOther,
|
|
|
|
ErrorResult& aErr);
|
|
|
|
int16_t ComparePoint(nsINode& aParent, uint32_t aOffset, ErrorResult& aErr);
|
|
|
|
void DeleteContents(ErrorResult& aRv);
|
|
|
|
already_AddRefed<mozilla::dom::DocumentFragment>
|
|
|
|
ExtractContents(ErrorResult& aErr);
|
|
|
|
nsINode* GetCommonAncestorContainer(ErrorResult& aRv) const;
|
|
|
|
nsINode* GetStartContainer(ErrorResult& aRv) const;
|
|
|
|
uint32_t GetStartOffset(ErrorResult& aRv) const;
|
|
|
|
nsINode* GetEndContainer(ErrorResult& aRv) const;
|
|
|
|
uint32_t GetEndOffset(ErrorResult& aRv) const;
|
|
|
|
void InsertNode(nsINode& aNode, ErrorResult& aErr);
|
|
|
|
bool IntersectsNode(nsINode& aNode, ErrorResult& aRv);
|
|
|
|
bool IsPointInRange(nsINode& aParent, uint32_t aOffset, ErrorResult& aErr);
|
|
|
|
void SelectNode(nsINode& aNode, ErrorResult& aErr);
|
|
|
|
void SelectNodeContents(nsINode& aNode, ErrorResult& aErr);
|
|
|
|
void SetEnd(nsINode& aNode, uint32_t aOffset, ErrorResult& aErr);
|
|
|
|
void SetEndAfter(nsINode& aNode, ErrorResult& aErr);
|
|
|
|
void SetEndBefore(nsINode& aNode, ErrorResult& aErr);
|
|
|
|
void SetStart(nsINode& aNode, uint32_t aOffset, ErrorResult& aErr);
|
|
|
|
void SetStartAfter(nsINode& aNode, ErrorResult& aErr);
|
|
|
|
void SetStartBefore(nsINode& aNode, ErrorResult& aErr);
|
|
|
|
void SurroundContents(nsINode& aNode, ErrorResult& aErr);
|
2014-07-23 21:06:00 +00:00
|
|
|
already_AddRefed<DOMRect> GetBoundingClientRect(bool aClampToEdge = true,
|
|
|
|
bool aFlushLayout = true);
|
|
|
|
already_AddRefed<DOMRectList> GetClientRects(bool aClampToEdge = true,
|
|
|
|
bool aFlushLayout = true);
|
2015-10-30 05:37:03 +00:00
|
|
|
static void GetInnerTextNoFlush(mozilla::dom::DOMString& aValue,
|
|
|
|
mozilla::ErrorResult& aError,
|
|
|
|
nsIContent* aStartParent,
|
|
|
|
uint32_t aStartOffset,
|
|
|
|
nsIContent* aEndParent,
|
|
|
|
uint32_t aEndOffset);
|
2013-02-07 12:09:41 +00:00
|
|
|
|
|
|
|
nsINode* GetParentObject() const { return mOwner; }
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override final;
|
2013-02-07 12:09:41 +00:00
|
|
|
|
2006-10-21 01:30:54 +00:00
|
|
|
private:
|
1998-12-18 02:51:34 +00:00
|
|
|
// no copy's or assigns
|
|
|
|
nsRange(const nsRange&);
|
|
|
|
nsRange& operator=(const nsRange&);
|
2007-06-19 03:01:03 +00:00
|
|
|
|
2008-07-25 10:37:37 +00:00
|
|
|
/**
|
|
|
|
* Cut or delete the range's contents.
|
|
|
|
*
|
|
|
|
* @param aFragment nsIDOMDocumentFragment containing the nodes.
|
|
|
|
* May be null to indicate the caller doesn't want a fragment.
|
|
|
|
*/
|
2013-02-07 12:09:41 +00:00
|
|
|
nsresult CutContents(mozilla::dom::DocumentFragment** frag);
|
2008-07-25 10:37:37 +00:00
|
|
|
|
2013-07-12 03:29:24 +00:00
|
|
|
static nsresult CloneParentsBetween(nsINode* aAncestor,
|
|
|
|
nsINode* aNode,
|
|
|
|
nsINode** aClosestAncestor,
|
|
|
|
nsINode** aFarthestAncestor);
|
2008-07-25 10:37:37 +00:00
|
|
|
|
2001-12-14 23:10:42 +00:00
|
|
|
public:
|
2003-01-14 23:05:52 +00:00
|
|
|
/******************************************************************************
|
2013-07-12 03:29:24 +00:00
|
|
|
* Utility routine to detect if a content node starts before a range and/or
|
2003-01-14 23:05:52 +00:00
|
|
|
* ends after a range. If neither it is contained inside the range.
|
2013-07-12 03:29:24 +00:00
|
|
|
*
|
2003-01-14 23:05:52 +00:00
|
|
|
* XXX - callers responsibility to ensure node in same doc as range!
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
2012-01-10 14:19:54 +00:00
|
|
|
static nsresult CompareNodeToRange(nsINode* aNode, nsRange* aRange,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool *outNodeBefore,
|
|
|
|
bool *outNodeAfter);
|
2003-01-14 23:05:52 +00:00
|
|
|
|
2016-02-13 17:40:23 +00:00
|
|
|
/**
|
|
|
|
* Return true if any part of (aNode, aStartOffset) .. (aNode, aEndOffset)
|
|
|
|
* overlaps any nsRange in aNode's GetNextRangeCommonAncestor ranges (i.e.
|
|
|
|
* where aNode is a descendant of a range's common ancestor node).
|
|
|
|
* If a nsRange starts in (aNode, aEndOffset) or if it ends in
|
|
|
|
* (aNode, aStartOffset) then it is non-overlapping and the result is false
|
|
|
|
* for that nsRange. Collapsed ranges always counts as non-overlapping.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
static bool IsNodeSelected(nsINode* aNode, uint32_t aStartOffset,
|
|
|
|
uint32_t aEndOffset);
|
2011-12-20 09:15:41 +00:00
|
|
|
|
2014-06-04 20:54:00 +00:00
|
|
|
static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
|
|
|
|
nsRange* aRange,
|
|
|
|
nsINode* aStartParent, int32_t aStartOffset,
|
2014-06-27 20:58:57 +00:00
|
|
|
nsINode* aEndParent, int32_t aEndOffset,
|
2014-07-23 21:06:00 +00:00
|
|
|
bool aClampToEdge, bool aFlushLayout);
|
2014-06-04 20:54:00 +00:00
|
|
|
|
2014-09-10 17:07:36 +00:00
|
|
|
/**
|
|
|
|
* Scan this range for -moz-user-select:none nodes and split it up into
|
|
|
|
* multiple ranges to exclude those nodes. The resulting ranges are put
|
|
|
|
* in aOutRanges. If no -moz-user-select:none node is found in the range
|
|
|
|
* then |this| is unmodified and is the only range in aOutRanges.
|
|
|
|
* Otherwise, |this| will be modified so that it ends before the first
|
|
|
|
* -moz-user-select:none node and additional ranges may also be created.
|
|
|
|
* If all nodes in the range are -moz-user-select:none then aOutRanges
|
|
|
|
* will be empty.
|
|
|
|
* @param aOutRanges the resulting set of ranges
|
|
|
|
*/
|
2015-10-18 05:24:48 +00:00
|
|
|
void ExcludeNonSelectableNodes(nsTArray<RefPtr<nsRange>>* aOutRanges);
|
2014-09-10 17:07:36 +00:00
|
|
|
|
2012-01-10 14:19:54 +00:00
|
|
|
typedef nsTHashtable<nsPtrHashKey<nsRange> > RangeHashTable;
|
2001-12-14 23:10:42 +00:00
|
|
|
protected:
|
2012-01-10 14:19:54 +00:00
|
|
|
void RegisterCommonAncestor(nsINode* aNode);
|
|
|
|
void UnregisterCommonAncestor(nsINode* aNode);
|
|
|
|
nsINode* IsValidBoundary(nsINode* aNode);
|
|
|
|
|
2011-12-20 09:15:41 +00:00
|
|
|
// CharacterDataChanged set aNotInsertedYet to true to disable an assertion
|
|
|
|
// and suppress re-registering a range common ancestor node since
|
|
|
|
// the new text node of a splitText hasn't been inserted yet.
|
|
|
|
// CharacterDataChanged does the re-registering when needed.
|
2012-08-22 15:56:38 +00:00
|
|
|
void DoSetRange(nsINode* aStartN, int32_t aStartOffset,
|
|
|
|
nsINode* aEndN, int32_t aEndOffset,
|
2011-12-20 09:15:41 +00:00
|
|
|
nsINode* aRoot, bool aNotInsertedYet = false);
|
2011-12-24 13:26:03 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* For a range for which IsInSelection() is true, return the common
|
|
|
|
* ancestor for the range. This method uses the selection bits and
|
|
|
|
* nsGkAtoms::range property on the nodes to quickly find the ancestor.
|
|
|
|
* That is, it's a faster version of GetCommonAncestor that only works
|
|
|
|
* for ranges in a Selection. The method will assert and the behavior
|
|
|
|
* is undefined if called on a range where IsInSelection() is false.
|
|
|
|
*/
|
|
|
|
nsINode* GetRegisteredCommonAncestor();
|
|
|
|
|
2016-02-13 17:40:23 +00:00
|
|
|
// Helper to IsNodeSelected.
|
|
|
|
static bool IsNodeInSortedRanges(nsINode* aNode,
|
|
|
|
uint32_t aStartOffset,
|
|
|
|
uint32_t aEndOffset,
|
|
|
|
const nsTArray<const nsRange*>& aRanges,
|
|
|
|
size_t aRangeStart,
|
|
|
|
size_t aRangeEnd);
|
|
|
|
|
2013-04-12 03:20:09 +00:00
|
|
|
struct MOZ_STACK_CLASS AutoInvalidateSelection
|
2011-12-24 13:26:03 +00:00
|
|
|
{
|
2014-08-05 13:19:51 +00:00
|
|
|
explicit AutoInvalidateSelection(nsRange* aRange) : mRange(aRange)
|
2011-12-24 13:26:03 +00:00
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
mWasInSelection = mRange->IsInSelection();
|
|
|
|
#endif
|
|
|
|
if (!mRange->IsInSelection() || mIsNested) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mIsNested = true;
|
|
|
|
mCommonAncestor = mRange->GetRegisteredCommonAncestor();
|
|
|
|
}
|
|
|
|
~AutoInvalidateSelection();
|
|
|
|
nsRange* mRange;
|
2015-10-18 05:24:48 +00:00
|
|
|
RefPtr<nsINode> mCommonAncestor;
|
2011-12-24 13:26:03 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
bool mWasInSelection;
|
|
|
|
#endif
|
|
|
|
static bool mIsNested;
|
|
|
|
};
|
2013-02-07 12:09:41 +00:00
|
|
|
|
|
|
|
nsCOMPtr<nsIDocument> mOwner;
|
2012-01-10 14:19:54 +00:00
|
|
|
nsCOMPtr<nsINode> mRoot;
|
|
|
|
nsCOMPtr<nsINode> mStartParent;
|
|
|
|
nsCOMPtr<nsINode> mEndParent;
|
2015-10-18 05:24:48 +00:00
|
|
|
RefPtr<mozilla::dom::Selection> mSelection;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mStartOffset;
|
|
|
|
int32_t mEndOffset;
|
2012-01-10 14:19:54 +00:00
|
|
|
|
2015-02-24 18:35:30 +00:00
|
|
|
bool mIsPositioned : 1;
|
|
|
|
bool mMaySpanAnonymousSubtrees : 1;
|
|
|
|
bool mIsGenerated : 1;
|
|
|
|
bool mStartOffsetWasIncremented : 1;
|
|
|
|
bool mEndOffsetWasIncremented : 1;
|
|
|
|
bool mEnableGravitationOnElementRemoval : 1;
|
2012-11-20 20:14:15 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
int32_t mAssertNextInsertOrAppendIndex;
|
|
|
|
nsINode* mAssertNextInsertOrAppendNode;
|
|
|
|
#endif
|
1998-12-18 02:51:34 +00:00
|
|
|
};
|
|
|
|
|
2012-12-22 08:27:27 +00:00
|
|
|
inline nsISupports*
|
|
|
|
ToCanonicalSupports(nsRange* aRange)
|
|
|
|
{
|
|
|
|
return static_cast<nsIDOMRange*>(aRange);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nsISupports*
|
|
|
|
ToSupports(nsRange* aRange)
|
|
|
|
{
|
|
|
|
return static_cast<nsIDOMRange*>(aRange);
|
|
|
|
}
|
|
|
|
|
1999-10-08 20:41:19 +00:00
|
|
|
#endif /* nsRange_h___ */
|