| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) | 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) |
| 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
| 5 * (C) 2001 Peter Kelly (pmk@post.com) | 5 * (C) 2001 Peter Kelly (pmk@post.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 if (comparePoint(parentNode, nodeIndex + 1, exceptionState) > 0) // ends
after the range | 307 if (comparePoint(parentNode, nodeIndex + 1, exceptionState) > 0) // ends
after the range |
| 308 return NODE_BEFORE_AND_AFTER; | 308 return NODE_BEFORE_AND_AFTER; |
| 309 return NODE_BEFORE; // ends before or in the range | 309 return NODE_BEFORE; // ends before or in the range |
| 310 } | 310 } |
| 311 // starts at or after the range start | 311 // starts at or after the range start |
| 312 if (comparePoint(parentNode, nodeIndex + 1, exceptionState) > 0) // ends aft
er the range | 312 if (comparePoint(parentNode, nodeIndex + 1, exceptionState) > 0) // ends aft
er the range |
| 313 return NODE_AFTER; | 313 return NODE_AFTER; |
| 314 return NODE_INSIDE; // ends inside the range | 314 return NODE_INSIDE; // ends inside the range |
| 315 } | 315 } |
| 316 | 316 |
| 317 short Range::compareBoundaryPoints(CompareHow how, const Range* sourceRange, Exc
eptionState& exceptionState) const | 317 short Range::compareBoundaryPoints(unsigned how, const Range* sourceRange, Excep
tionState& exceptionState) const |
| 318 { | 318 { |
| 319 if (!(how == START_TO_START || how == START_TO_END || how == END_TO_END || h
ow == END_TO_START)) { | 319 if (!(how == START_TO_START || how == START_TO_END || how == END_TO_END || h
ow == END_TO_START)) { |
| 320 exceptionState.throwDOMException(NotSupportedError, "The comparison meth
od provided must be one of 'START_TO_START', 'START_TO_END', 'END_TO_END', or 'E
ND_TO_START'."); | 320 exceptionState.throwDOMException(NotSupportedError, "The comparison meth
od provided must be one of 'START_TO_START', 'START_TO_END', 'END_TO_END', or 'E
ND_TO_START'."); |
| 321 return 0; | 321 return 0; |
| 322 } | 322 } |
| 323 | 323 |
| 324 Node* thisCont = commonAncestorContainer(); | 324 Node* thisCont = commonAncestorContainer(); |
| 325 Node* sourceCont = sourceRange->commonAncestorContainer(); | 325 Node* sourceCont = sourceRange->commonAncestorContainer(); |
| 326 if (thisCont->document() != sourceCont->document()) { | 326 if (thisCont->document() != sourceCont->document()) { |
| 327 exceptionState.throwDOMException(WrongDocumentError, "The source range i
s in a different document than this range."); | 327 exceptionState.throwDOMException(WrongDocumentError, "The source range i
s in a different document than this range."); |
| (...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 | 1783 |
| 1784 void showTree(const blink::Range* range) | 1784 void showTree(const blink::Range* range) |
| 1785 { | 1785 { |
| 1786 if (range && range->boundaryPointsValid()) { | 1786 if (range && range->boundaryPointsValid()) { |
| 1787 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); | 1787 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r
ange->endContainer(), "E"); |
| 1788 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); | 1788 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset
(), range->endOffset()); |
| 1789 } | 1789 } |
| 1790 } | 1790 } |
| 1791 | 1791 |
| 1792 #endif | 1792 #endif |
| OLD | NEW |