Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: Source/core/editing/VisibleSelection.cpp

Issue 1320573003: Rename isBlock() to isEnclosingBlock() in EditingUtilities (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-26T15:16:19 Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 VisiblePosition end(wordEnd); 492 VisiblePosition end(wordEnd);
493 493
494 if (isEndOfParagraph(originalEnd) && !isEmptyTableCell(m_start.anchorNod e())) { 494 if (isEndOfParagraph(originalEnd) && !isEmptyTableCell(m_start.anchorNod e())) {
495 // Select the paragraph break (the space from the end of a paragraph to the start of 495 // Select the paragraph break (the space from the end of a paragraph to the start of
496 // the next one) to match TextEdit. 496 // the next one) to match TextEdit.
497 end = wordEnd.next(); 497 end = wordEnd.next();
498 498
499 if (Element* table = isFirstPositionAfterTable(end)) { 499 if (Element* table = isFirstPositionAfterTable(end)) {
500 // The paragraph break after the last paragraph in the last cell of a block table ends 500 // The paragraph break after the last paragraph in the last cell of a block table ends
501 // at the start of the paragraph after the table. 501 // at the start of the paragraph after the table.
502 if (isBlock(table)) 502 if (isEnclosingBlock(table))
503 end = end.next(CannotCrossEditingBoundary); 503 end = end.next(CannotCrossEditingBoundary);
504 else 504 else
505 end = wordEnd; 505 end = wordEnd;
506 } 506 }
507 507
508 if (end.isNull()) 508 if (end.isNull())
509 end = wordEnd; 509 end = wordEnd;
510 510
511 } 511 }
512 512
(...skipping 22 matching lines...) Expand all
535 case ParagraphGranularity: { 535 case ParagraphGranularity: {
536 VisiblePosition visibleParagraphEnd = endOfParagraph(VisiblePosition(m_e nd, m_affinity)); 536 VisiblePosition visibleParagraphEnd = endOfParagraph(VisiblePosition(m_e nd, m_affinity));
537 537
538 // Include the "paragraph break" (the space from the end of this paragra ph to the start 538 // Include the "paragraph break" (the space from the end of this paragra ph to the start
539 // of the next one) in the selection. 539 // of the next one) in the selection.
540 VisiblePosition end(visibleParagraphEnd.next()); 540 VisiblePosition end(visibleParagraphEnd.next());
541 541
542 if (Element* table = isFirstPositionAfterTable(end)) { 542 if (Element* table = isFirstPositionAfterTable(end)) {
543 // The paragraph break after the last paragraph in the last cell of a block table ends 543 // The paragraph break after the last paragraph in the last cell of a block table ends
544 // at the start of the paragraph after the table, not at the positio n just after the table. 544 // at the start of the paragraph after the table, not at the positio n just after the table.
545 if (isBlock(table)) 545 if (isEnclosingBlock(table))
546 end = end.next(CannotCrossEditingBoundary); 546 end = end.next(CannotCrossEditingBoundary);
547 // There is no parargraph break after the last paragraph in the last cell of an inline table. 547 // There is no parargraph break after the last paragraph in the last cell of an inline table.
548 else 548 else
549 end = visibleParagraphEnd; 549 end = visibleParagraphEnd;
550 } 550 }
551 551
552 if (end.isNull()) 552 if (end.isNull())
553 end = visibleParagraphEnd; 553 end = visibleParagraphEnd;
554 554
555 m_end = end.deepEquivalent(); 555 m_end = end.deepEquivalent();
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 sel.showTreeForThis(); 1249 sel.showTreeForThis();
1250 } 1250 }
1251 1251
1252 void showTree(const blink::VisibleSelection* sel) 1252 void showTree(const blink::VisibleSelection* sel)
1253 { 1253 {
1254 if (sel) 1254 if (sel)
1255 sel->showTreeForThis(); 1255 sel->showTreeForThis();
1256 } 1256 }
1257 1257
1258 #endif 1258 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698