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

Side by Side Diff: Source/core/editing/commands/BreakBlockquoteCommand.cpp

Issue 1307803003: Introduce nextPositionOf() for VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T18:13:02 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) 2005 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 bool isLastVisiblePositionInNode(const VisiblePosition& visiblePosition, const C ontainerNode* node) 57 bool isLastVisiblePositionInNode(const VisiblePosition& visiblePosition, const C ontainerNode* node)
58 { 58 {
59 if (visiblePosition.isNull()) 59 if (visiblePosition.isNull())
60 return false; 60 return false;
61 61
62 if (!visiblePosition.deepEquivalent().computeContainerNode()->isDescendantOf (node)) 62 if (!visiblePosition.deepEquivalent().computeContainerNode()->isDescendantOf (node))
63 return false; 63 return false;
64 64
65 VisiblePosition next = visiblePosition.next(); 65 VisiblePosition next = nextPositionOf(visiblePosition);
66 return next.isNull() || !next.deepEquivalent().anchorNode()->isDescendantOf( node); 66 return next.isNull() || !next.deepEquivalent().anchorNode()->isDescendantOf( node);
67 } 67 }
68 68
69 } // namespace 69 } // namespace
70 70
71 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document) 71 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document)
72 : CompositeEditCommand(document) 72 : CompositeEditCommand(document)
73 { 73 {
74 } 74 }
75 75
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 218
219 // Make sure the cloned block quote renders. 219 // Make sure the cloned block quote renders.
220 addBlockPlaceholderIfNeeded(clonedBlockquote.get()); 220 addBlockPlaceholderIfNeeded(clonedBlockquote.get());
221 221
222 // Put the selection right before the break. 222 // Put the selection right before the break.
223 setEndingSelection(VisibleSelection(positionBeforeNode(breakElement.get()), TextAffinity::Downstream, endingSelection().isDirectional())); 223 setEndingSelection(VisibleSelection(positionBeforeNode(breakElement.get()), TextAffinity::Downstream, endingSelection().isDirectional()));
224 rebalanceWhitespace(); 224 rebalanceWhitespace();
225 } 225 }
226 226
227 } // namespace blink 227 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/commands/ApplyStyleCommand.cpp ('k') | Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698