Changeset 32443 in webkit
- Timestamp:
- Apr 23, 2008, 11:25:10 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r32439 r32443 1 2008-04-23 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/5825350> OWA: Caret disappears when navigating with arrows keys in contenteditable div 6 7 * editing/selection/5825350-1-expected.txt: Added. 8 * editing/selection/5825350-1.html: Added. 9 * editing/selection/5825350-2-expected.txt: Added. 10 * editing/selection/5825350-2.html: Added. 11 1 12 2008-04-23 Darin Adler <darin@apple.com> 2 13 -
trunk/WebCore/ChangeLog
r32442 r32443 1 2008-04-23 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/5825350> OWA: Caret disappears when navigating with arrows keys in contenteditable div 6 7 * editing/htmlediting.cpp: 8 (WebCore::firstEditablePositionAfterPositionInRoot): Return a null VisiblePosition if 9 this function moves out of highestRoot. Re-wrote so as to not duplicate code inside 10 and outside of the while loop. 11 (WebCore::lastEditablePositionBeforePositionInRoot): Ditto. 12 1 13 2008-04-23 Daniel Zucker <zucker@wake3.com> 2 14 -
trunk/WebCore/editing/htmlediting.cpp
r31851 r32443 243 243 VisiblePosition firstEditablePositionAfterPositionInRoot(const Position& position, Node* highestRoot) 244 244 { 245 // position falls before highestRoot. 245 246 if (comparePositions(position, Position(highestRoot, 0)) == -1 && highestRoot->isContentEditable()) 246 247 return VisiblePosition(Position(highestRoot, 0)); 247 248 Position p = nextVisuallyDistinctCandidate(position); 249 Node* root = editableRootForPosition(position); 250 Node* shadowAncestor = root ? root->shadowAncestorNode() : 0; 251 if (p.isNull() && root && (shadowAncestor != root)) 252 p = Position(shadowAncestor, maxDeepOffset(shadowAncestor)); 253 while (p.isNotNull() && !isEditablePosition(p) && p.node()->isDescendantOf(highestRoot)) { 248 249 Position p = position; 250 251 if (Node* shadowAncestor = p.node()->shadowAncestorNode()) 252 if (shadowAncestor != p.node()) 253 p = Position(shadowAncestor, maxDeepOffset(shadowAncestor)); 254 255 while (p.node() && !isEditablePosition(p) && p.node()->isDescendantOf(highestRoot)) 254 256 p = isAtomicNode(p.node()) ? positionAfterNode(p.node()) : nextVisuallyDistinctCandidate(p); 255 256 root = editableRootForPosition(position); 257 shadowAncestor = root ? root->shadowAncestorNode() : 0; 258 if (p.isNull() && root && (shadowAncestor != root)) 259 p = Position(shadowAncestor, maxDeepOffset(shadowAncestor)); 260 } 261 257 258 if (p.node() && !p.node()->isDescendantOf(highestRoot)) 259 return VisiblePosition(); 260 262 261 return VisiblePosition(p); 263 262 } … … 265 264 VisiblePosition lastEditablePositionBeforePositionInRoot(const Position& position, Node* highestRoot) 266 265 { 266 // When position falls after highestRoot, the result is easy to compute. 267 267 if (comparePositions(position, Position(highestRoot, maxDeepOffset(highestRoot))) == 1) 268 268 return VisiblePosition(Position(highestRoot, maxDeepOffset(highestRoot))); 269 270 Position p = previousVisuallyDistinctCandidate(position); 271 Node* root = editableRootForPosition(position); 272 Node* shadowAncestor = root ? root->shadowAncestorNode() : 0; 273 if (p.isNull() && root && (shadowAncestor != root)) 274 p = Position(shadowAncestor, 0); 275 while (p.isNotNull() && !isEditablePosition(p) && p.node()->isDescendantOf(highestRoot)) { 269 270 Position p = position; 271 272 if (Node* shadowAncestor = p.node()->shadowAncestorNode()) 273 if (shadowAncestor != p.node()) 274 p = Position(shadowAncestor, 0); 275 276 while (p.node() && !isEditablePosition(p) && p.node()->isDescendantOf(highestRoot)) 276 277 p = isAtomicNode(p.node()) ? positionBeforeNode(p.node()) : previousVisuallyDistinctCandidate(p); 277 278 root = editableRootForPosition(position); 279 shadowAncestor = root ? root->shadowAncestorNode() : 0; 280 if (p.isNull() && root && (shadowAncestor != root)) 281 p = Position(shadowAncestor, 0); 282 } 283 278 279 if (p.node() && !p.node()->isDescendantOf(highestRoot)) 280 return VisiblePosition(); 281 284 282 return VisiblePosition(p); 285 283 }
Note:
See TracChangeset
for help on using the changeset viewer.