nddelima 2004/08/05 08:56:54
Modified: java/src/org/apache/xerces/dom RangeImpl.java
Log:
compareBoundaryPoints should raise a WRONG_DOCUMENT_ERR if the two Ranges are not in
the same Document or DocumentFragment.
Revision Changes Path
1.33 +12 -2 xml-xerces/java/src/org/apache/xerces/dom/RangeImpl.java
Index: RangeImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/RangeImpl.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- RangeImpl.java 4 Aug 2004 21:24:34 -0000 1.32
+++ RangeImpl.java 5 Aug 2004 15:56:54 -0000 1.33
@@ -461,7 +461,17 @@
DOMException.INVALID_STATE_ERR,
DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN,
"INVALID_STATE_ERR", null));
}
-
+ // WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in the same
Document or DocumentFragment.
+ if ((fDocument != sourceRange.getStartContainer().getOwnerDocument()
+ && fDocument != sourceRange.getStartContainer()
+ && sourceRange.getStartContainer() != null)
+ || (fDocument != sourceRange.getEndContainer().getOwnerDocument()
+ && fDocument != sourceRange.getEndContainer()
+ && sourceRange.getStartContainer() != null)) {
+ throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
+ DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN,
"WRONG_DOCUMENT_ERR", null));
+ }
+
Node endPointA;
Node endPointB;
int offsetA;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]