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

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

Issue 340013002: Rename {first,last}EditablePosition{After,Before}Position... to denote them returned VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/editing/htmlediting.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 // The base, start and end are all in the same region. No adjustment necess ary. 597 // The base, start and end are all in the same region. No adjustment necess ary.
598 if (baseRoot == startRoot && baseRoot == endRoot) 598 if (baseRoot == startRoot && baseRoot == endRoot)
599 return; 599 return;
600 600
601 // The selection is based in editable content. 601 // The selection is based in editable content.
602 if (baseRoot) { 602 if (baseRoot) {
603 // If the start is outside the base's editable root, cap it at the start of that root. 603 // If the start is outside the base's editable root, cap it at the start of that root.
604 // If the start is in non-editable content that is inside the base's edi table root, put it 604 // If the start is in non-editable content that is inside the base's edi table root, put it
605 // at the first editable position after start inside the base's editable root. 605 // at the first editable position after start inside the base's editable root.
606 if (startRoot != baseRoot) { 606 if (startRoot != baseRoot) {
607 VisiblePosition first = firstEditablePositionAfterPositionInRoot(m_s tart, baseRoot); 607 VisiblePosition first = firstEditableVisiblePositionAfterPositionInR oot(m_start, baseRoot);
608 m_start = first.deepEquivalent(); 608 m_start = first.deepEquivalent();
609 if (m_start.isNull()) { 609 if (m_start.isNull()) {
610 ASSERT_NOT_REACHED(); 610 ASSERT_NOT_REACHED();
611 m_start = m_end; 611 m_start = m_end;
612 } 612 }
613 } 613 }
614 // If the end is outside the base's editable root, cap it at the end of that root. 614 // If the end is outside the base's editable root, cap it at the end of that root.
615 // If the end is in non-editable content that is inside the base's root, put it 615 // If the end is in non-editable content that is inside the base's root, put it
616 // at the last editable position before the end inside the base's root. 616 // at the last editable position before the end inside the base's root.
617 if (endRoot != baseRoot) { 617 if (endRoot != baseRoot) {
618 VisiblePosition last = lastEditablePositionBeforePositionInRoot(m_en d, baseRoot); 618 VisiblePosition last = lastEditableVisiblePositionBeforePositionInRo ot(m_end, baseRoot);
619 m_end = last.deepEquivalent(); 619 m_end = last.deepEquivalent();
620 if (m_end.isNull()) 620 if (m_end.isNull())
621 m_end = m_start; 621 m_end = m_start;
622 } 622 }
623 // The selection is based in non-editable content. 623 // The selection is based in non-editable content.
624 } else { 624 } else {
625 // FIXME: Non-editable pieces inside editable content should be atomic, in the same way that editable 625 // FIXME: Non-editable pieces inside editable content should be atomic, in the same way that editable
626 // pieces in non-editable content are atomic. 626 // pieces in non-editable content are atomic.
627 627
628 // The selection ends in editable content or non-editable content inside a different editable ancestor, 628 // The selection ends in editable content or non-editable content inside a different editable ancestor,
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 sel.showTreeForThis(); 857 sel.showTreeForThis();
858 } 858 }
859 859
860 void showTree(const WebCore::VisibleSelection* sel) 860 void showTree(const WebCore::VisibleSelection* sel)
861 { 861 {
862 if (sel) 862 if (sel)
863 sel->showTreeForThis(); 863 sel->showTreeForThis();
864 } 864 }
865 865
866 #endif 866 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/editing/htmlediting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698