OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 VisiblePosition end(wordEnd); | 487 VisiblePosition end(wordEnd); |
488 | 488 |
489 if (isEndOfParagraph(originalEnd) && !isEmptyTableCell(m_start.anchorNod
e())) { | 489 if (isEndOfParagraph(originalEnd) && !isEmptyTableCell(m_start.anchorNod
e())) { |
490 // Select the paragraph break (the space from the end of a paragraph
to the start of | 490 // Select the paragraph break (the space from the end of a paragraph
to the start of |
491 // the next one) to match TextEdit. | 491 // the next one) to match TextEdit. |
492 end = wordEnd.next(); | 492 end = wordEnd.next(); |
493 | 493 |
494 if (Element* table = isFirstPositionAfterTable(end)) { | 494 if (Element* table = isFirstPositionAfterTable(end)) { |
495 // The paragraph break after the last paragraph in the last cell
of a block table ends | 495 // The paragraph break after the last paragraph in the last cell
of a block table ends |
496 // at the start of the paragraph after the table. | 496 // at the start of the paragraph after the table. |
497 if (isBlock(table)) | 497 if (isEnclosingBlock(table)) |
498 end = end.next(CannotCrossEditingBoundary); | 498 end = end.next(CannotCrossEditingBoundary); |
499 else | 499 else |
500 end = wordEnd; | 500 end = wordEnd; |
501 } | 501 } |
502 | 502 |
503 if (end.isNull()) | 503 if (end.isNull()) |
504 end = wordEnd; | 504 end = wordEnd; |
505 | 505 |
506 } | 506 } |
507 | 507 |
(...skipping 22 matching lines...) Expand all Loading... |
530 case ParagraphGranularity: { | 530 case ParagraphGranularity: { |
531 VisiblePosition visibleParagraphEnd = endOfParagraph(VisiblePosition(m_e
nd, m_affinity)); | 531 VisiblePosition visibleParagraphEnd = endOfParagraph(VisiblePosition(m_e
nd, m_affinity)); |
532 | 532 |
533 // Include the "paragraph break" (the space from the end of this paragra
ph to the start | 533 // Include the "paragraph break" (the space from the end of this paragra
ph to the start |
534 // of the next one) in the selection. | 534 // of the next one) in the selection. |
535 VisiblePosition end(visibleParagraphEnd.next()); | 535 VisiblePosition end(visibleParagraphEnd.next()); |
536 | 536 |
537 if (Element* table = isFirstPositionAfterTable(end)) { | 537 if (Element* table = isFirstPositionAfterTable(end)) { |
538 // The paragraph break after the last paragraph in the last cell of
a block table ends | 538 // The paragraph break after the last paragraph in the last cell of
a block table ends |
539 // at the start of the paragraph after the table, not at the positio
n just after the table. | 539 // at the start of the paragraph after the table, not at the positio
n just after the table. |
540 if (isBlock(table)) | 540 if (isEnclosingBlock(table)) |
541 end = end.next(CannotCrossEditingBoundary); | 541 end = end.next(CannotCrossEditingBoundary); |
542 // There is no parargraph break after the last paragraph in the last
cell of an inline table. | 542 // There is no parargraph break after the last paragraph in the last
cell of an inline table. |
543 else | 543 else |
544 end = visibleParagraphEnd; | 544 end = visibleParagraphEnd; |
545 } | 545 } |
546 | 546 |
547 if (end.isNull()) | 547 if (end.isNull()) |
548 end = visibleParagraphEnd; | 548 end = visibleParagraphEnd; |
549 | 549 |
550 m_end = end.deepEquivalent(); | 550 m_end = end.deepEquivalent(); |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 sel.showTreeForThis(); | 1244 sel.showTreeForThis(); |
1245 } | 1245 } |
1246 | 1246 |
1247 void showTree(const blink::VisibleSelection* sel) | 1247 void showTree(const blink::VisibleSelection* sel) |
1248 { | 1248 { |
1249 if (sel) | 1249 if (sel) |
1250 sel->showTreeForThis(); | 1250 sel->showTreeForThis(); |
1251 } | 1251 } |
1252 | 1252 |
1253 #endif | 1253 #endif |
OLD | NEW |