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

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

Issue 1310043003: Introduce previousPositionOf() for VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T16:28:03 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
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 case LineGranularity: { 422 case LineGranularity: {
423 m_start = startOfLine(VisiblePosition(m_start, m_affinity)).deepEquivale nt(); 423 m_start = startOfLine(VisiblePosition(m_start, m_affinity)).deepEquivale nt();
424 break; 424 break;
425 } 425 }
426 case LineBoundary: 426 case LineBoundary:
427 m_start = startOfLine(VisiblePosition(m_start, m_affinity)).deepEquivale nt(); 427 m_start = startOfLine(VisiblePosition(m_start, m_affinity)).deepEquivale nt();
428 break; 428 break;
429 case ParagraphGranularity: { 429 case ParagraphGranularity: {
430 VisiblePosition pos(m_start, m_affinity); 430 VisiblePosition pos(m_start, m_affinity);
431 if (isStartOfLine(pos) && isEndOfEditableOrNonEditableContent(pos)) 431 if (isStartOfLine(pos) && isEndOfEditableOrNonEditableContent(pos))
432 pos = pos.previous(); 432 pos = previousPositionOf(pos);
433 m_start = startOfParagraph(pos).deepEquivalent(); 433 m_start = startOfParagraph(pos).deepEquivalent();
434 break; 434 break;
435 } 435 }
436 case DocumentBoundary: 436 case DocumentBoundary:
437 m_start = startOfDocument(VisiblePosition(m_start, m_affinity)).deepEqui valent(); 437 m_start = startOfDocument(VisiblePosition(m_start, m_affinity)).deepEqui valent();
438 break; 438 break;
439 case ParagraphBoundary: 439 case ParagraphBoundary:
440 m_start = startOfParagraph(VisiblePosition(m_start, m_affinity)).deepEqu ivalent(); 440 m_start = startOfParagraph(VisiblePosition(m_start, m_affinity)).deepEqu ivalent();
441 break; 441 break;
442 case SentenceBoundary: 442 case SentenceBoundary:
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 sel.showTreeForThis(); 1247 sel.showTreeForThis();
1248 } 1248 }
1249 1249
1250 void showTree(const blink::VisibleSelection* sel) 1250 void showTree(const blink::VisibleSelection* sel)
1251 { 1251 {
1252 if (sel) 1252 if (sel)
1253 sel->showTreeForThis(); 1253 sel->showTreeForThis();
1254 } 1254 }
1255 1255
1256 #endif 1256 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698