ZVON > References > DOM2 Reference

compareBoundaryPoints (method )

Owning interface and usage:  
Range.compareBoundaryPoints(how, sourceRange)

Member of these other interfaces:  
none

Description:  
Compare the boundary-points of two Ranges in a document.

Boundary Points Types:
  0 = START_TO_START (of type unsigned short)
Compare start boundary-point of sourceRange to start boundary-point of Range on which compareBoundaryPoints() is invoked.
  1 = START_TO_END (of type unsigned short)
Compare start boundary-point of sourceRange to end boundary-point of Range on which compareBoundaryPoints() is invoked.
  2 = END_TO_END (of type unsigned short)
Compare end boundary-point of sourceRange to end boundary-point of Range on which compareBoundaryPoints() is invoked.
  3 = END_TO_START (of type unsigned short)
Compare end boundary-point of sourceRange to start boundary-point of Range on which compareBoundaryPoints() is invoked.

Parameters:  
unsigned how  -  A code representing the type of comparison, as defined above.
Range sourceRange  -  The Range on which this current Range is compared to.

Returns:  
short -  -1, 0 or 1 depending on whether the corresponding boundary-point of the Range is respectively before, equal to, or after the corresponding boundary-point of sourceRange.

Exceptions:  
DOMException WRONG_DOCUMENT_ERR
Raised if the two Ranges are not in the same Document or DocumentFragment.
DOMException INVALID_STATE_ERR
Raised if detach() has already been invoked on this object.