| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 if (hasDescendentA) | 94 if (hasDescendentA) |
| 95 bias = -1; | 95 bias = -1; |
| 96 else if (hasDescendentB) | 96 else if (hasDescendentB) |
| 97 bias = 1; | 97 bias = 1; |
| 98 } | 98 } |
| 99 | 99 |
| 100 int result = Range::compareBoundaryPoints(nodeA, offsetA, nodeB, offsetB, IG
NORE_EXCEPTION); | 100 int result = Range::compareBoundaryPoints(nodeA, offsetA, nodeB, offsetB, IG
NORE_EXCEPTION); |
| 101 return result ? result : bias; | 101 return result ? result : bias; |
| 102 } | 102 } |
| 103 | 103 |
| 104 int comparePositions(const PositionWithAffinity& a, const PositionWithAffinity&
b) |
| 105 { |
| 106 return comparePositions(a.position(), b.position()); |
| 107 } |
| 108 |
| 104 int comparePositions(const VisiblePosition& a, const VisiblePosition& b) | 109 int comparePositions(const VisiblePosition& a, const VisiblePosition& b) |
| 105 { | 110 { |
| 106 return comparePositions(a.deepEquivalent(), b.deepEquivalent()); | 111 return comparePositions(a.deepEquivalent(), b.deepEquivalent()); |
| 107 } | 112 } |
| 108 | 113 |
| 109 Node* highestEditableRoot(const Position& position, EditableType editableType) | 114 Node* highestEditableRoot(const Position& position, EditableType editableType) |
| 110 { | 115 { |
| 111 Node* node = position.deprecatedNode(); | 116 Node* node = position.deprecatedNode(); |
| 112 if (!node) | 117 if (!node) |
| 113 return 0; | 118 return 0; |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 // if the selection starts just before a paragraph break, skip over it | 1167 // if the selection starts just before a paragraph break, skip over it |
| 1163 if (isEndOfParagraph(visiblePosition)) | 1168 if (isEndOfParagraph(visiblePosition)) |
| 1164 return visiblePosition.next().deepEquivalent().downstream(); | 1169 return visiblePosition.next().deepEquivalent().downstream(); |
| 1165 | 1170 |
| 1166 // otherwise, make sure to be at the start of the first selected node, | 1171 // otherwise, make sure to be at the start of the first selected node, |
| 1167 // instead of possibly at the end of the last node before the selection | 1172 // instead of possibly at the end of the last node before the selection |
| 1168 return visiblePosition.deepEquivalent().downstream(); | 1173 return visiblePosition.deepEquivalent().downstream(); |
| 1169 } | 1174 } |
| 1170 | 1175 |
| 1171 } // namespace WebCore | 1176 } // namespace WebCore |
| OLD | NEW |