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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 Position position = passedPosition; | 477 Position position = passedPosition; |
478 | 478 |
479 // FIXME (9535): Canonicalizing to the leftmost candidate means that if we'
re at a line wrap, we will | 479 // FIXME (9535): Canonicalizing to the leftmost candidate means that if we'
re at a line wrap, we will |
480 // ask renderers to paint downstream carets for other renderers. | 480 // ask renderers to paint downstream carets for other renderers. |
481 // To fix this, we need to either a) add code to all paintCarets to pass the
responsibility off to | 481 // To fix this, we need to either a) add code to all paintCarets to pass the
responsibility off to |
482 // the appropriate renderer for VisiblePosition's like these, or b) canonica
lize to the rightmost candidate | 482 // the appropriate renderer for VisiblePosition's like these, or b) canonica
lize to the rightmost candidate |
483 // unless the affinity is upstream. | 483 // unless the affinity is upstream. |
484 if (position.isNull()) | 484 if (position.isNull()) |
485 return Position(); | 485 return Position(); |
486 | 486 |
487 Node* node = position.containerNode(); | |
488 | |
489 ASSERT(position.document()); | 487 ASSERT(position.document()); |
490 position.document()->updateLayoutIgnorePendingStylesheets(); | 488 position.document()->updateLayoutIgnorePendingStylesheets(); |
491 | 489 |
| 490 Node* node = position.containerNode(); |
| 491 |
492 Position candidate = position.upstream(); | 492 Position candidate = position.upstream(); |
493 if (candidate.isCandidate()) | 493 if (candidate.isCandidate()) |
494 return candidate; | 494 return candidate; |
495 candidate = position.downstream(); | 495 candidate = position.downstream(); |
496 if (candidate.isCandidate()) | 496 if (candidate.isCandidate()) |
497 return candidate; | 497 return candidate; |
498 | 498 |
499 // When neither upstream or downstream gets us to a candidate (upstream/down
stream won't leave | 499 // When neither upstream or downstream gets us to a candidate (upstream/down
stream won't leave |
500 // blocks or enter new ones), we search forward and backward until we find o
ne. | 500 // blocks or enter new ones), we search forward and backward until we find o
ne. |
501 Position next = canonicalizeCandidate(nextCandidate(position)); | 501 Position next = canonicalizeCandidate(nextCandidate(position)); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 if (vpos) | 718 if (vpos) |
719 vpos->showTreeForThis(); | 719 vpos->showTreeForThis(); |
720 } | 720 } |
721 | 721 |
722 void showTree(const WebCore::VisiblePosition& vpos) | 722 void showTree(const WebCore::VisiblePosition& vpos) |
723 { | 723 { |
724 vpos.showTreeForThis(); | 724 vpos.showTreeForThis(); |
725 } | 725 } |
726 | 726 |
727 #endif | 727 #endif |
OLD | NEW |