| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 Element* startBlock = enclosingBlock(startNode); | 1136 Element* startBlock = enclosingBlock(startNode); |
| 1137 | 1137 |
| 1138 Node* node = startNode; | 1138 Node* node = startNode; |
| 1139 ContainerNode* highestRoot = highestEditableRoot(p); | 1139 ContainerNode* highestRoot = highestEditableRoot(p); |
| 1140 int offset = p.computeEditingOffset(); | 1140 int offset = p.computeEditingOffset(); |
| 1141 PositionAnchorType type = p.anchorType(); | 1141 PositionAnchorType type = p.anchorType(); |
| 1142 | 1142 |
| 1143 Node* n = startNode; | 1143 Node* n = startNode; |
| 1144 bool startNodeIsEditable = startNode->hasEditableStyle(); | 1144 bool startNodeIsEditable = startNode->hasEditableStyle(); |
| 1145 while (n) { | 1145 while (n) { |
| 1146 if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nod
eIsUserSelectAll(n) && n->hasEditableStyle() != startNodeIsEditable) | 1146 if (boundaryCrossingRule == CannotCrossEditingBoundary && !nodeIsUserSel
ectAll(n) && n->hasEditableStyle() != startNodeIsEditable) |
| 1147 break; | 1147 break; |
| 1148 if (boundaryCrossingRule == CanSkipOverEditingBoundary) { | 1148 if (boundaryCrossingRule == CanSkipOverEditingBoundary) { |
| 1149 while (n && n->hasEditableStyle() != startNodeIsEditable) | 1149 while (n && n->hasEditableStyle() != startNodeIsEditable) |
| 1150 n = NodeTraversal::previousPostOrder(*n, startBlock); | 1150 n = NodeTraversal::previousPostOrder(*n, startBlock); |
| 1151 if (!n || !n->isDescendantOf(highestRoot)) | 1151 if (!n || !n->isDescendantOf(highestRoot)) |
| 1152 break; | 1152 break; |
| 1153 } | 1153 } |
| 1154 LayoutObject* r = n->layoutObject(); | 1154 LayoutObject* r = n->layoutObject(); |
| 1155 if (!r) { | 1155 if (!r) { |
| 1156 n = NodeTraversal::previousPostOrder(*n, startBlock); | 1156 n = NodeTraversal::previousPostOrder(*n, startBlock); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 Element* stayInsideBlock = startBlock; | 1212 Element* stayInsideBlock = startBlock; |
| 1213 | 1213 |
| 1214 Node* node = startNode; | 1214 Node* node = startNode; |
| 1215 ContainerNode* highestRoot = highestEditableRoot(p); | 1215 ContainerNode* highestRoot = highestEditableRoot(p); |
| 1216 int offset = p.computeEditingOffset(); | 1216 int offset = p.computeEditingOffset(); |
| 1217 PositionAnchorType type = p.anchorType(); | 1217 PositionAnchorType type = p.anchorType(); |
| 1218 | 1218 |
| 1219 Node* n = startNode; | 1219 Node* n = startNode; |
| 1220 bool startNodeIsEditable = startNode->hasEditableStyle(); | 1220 bool startNodeIsEditable = startNode->hasEditableStyle(); |
| 1221 while (n) { | 1221 while (n) { |
| 1222 if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nod
eIsUserSelectAll(n) && n->hasEditableStyle() != startNodeIsEditable) | 1222 if (boundaryCrossingRule == CannotCrossEditingBoundary && !nodeIsUserSel
ectAll(n) && n->hasEditableStyle() != startNodeIsEditable) |
| 1223 break; | 1223 break; |
| 1224 if (boundaryCrossingRule == CanSkipOverEditingBoundary) { | 1224 if (boundaryCrossingRule == CanSkipOverEditingBoundary) { |
| 1225 while (n && n->hasEditableStyle() != startNodeIsEditable) | 1225 while (n && n->hasEditableStyle() != startNodeIsEditable) |
| 1226 n = NodeTraversal::next(*n, stayInsideBlock); | 1226 n = NodeTraversal::next(*n, stayInsideBlock); |
| 1227 if (!n || !n->isDescendantOf(highestRoot)) | 1227 if (!n || !n->isDescendantOf(highestRoot)) |
| 1228 break; | 1228 break; |
| 1229 } | 1229 } |
| 1230 | 1230 |
| 1231 LayoutObject* r = n->layoutObject(); | 1231 LayoutObject* r = n->layoutObject(); |
| 1232 if (!r) { | 1232 if (!r) { |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1596 | 1596 |
| 1597 if (previousRenderedEditable(position1.anchorNode()) == position2.anchorNode
() | 1597 if (previousRenderedEditable(position1.anchorNode()) == position2.anchorNode
() |
| 1598 && !renderedOffset1 && renderedOffset2 == caretMaxOffset(position2.ancho
rNode())) { | 1598 && !renderedOffset1 && renderedOffset2 == caretMaxOffset(position2.ancho
rNode())) { |
| 1599 return false; | 1599 return false; |
| 1600 } | 1600 } |
| 1601 | 1601 |
| 1602 return true; | 1602 return true; |
| 1603 } | 1603 } |
| 1604 | 1604 |
| 1605 } | 1605 } |
| OLD | NEW |