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

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

Issue 2370253002: Mark calls of visible{Start,End} with dirty layout deprecated (Closed)
Patch Set: Created 4 years, 2 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 // This is a scenario that should never happen, but we want to 87 // This is a scenario that should never happen, but we want to
88 // make sure we don't dereference a null pointer below. 88 // make sure we don't dereference a null pointer below.
89 89
90 DCHECK(!endingSelection().isNone()); 90 DCHECK(!endingSelection().isNone());
91 91
92 if (endingSelection().isNone()) 92 if (endingSelection().isNone())
93 return; 93 return;
94 94
95 VisiblePosition visiblePos = endingSelection().visibleStart(); 95 VisiblePosition visiblePos = endingSelection().visibleStartDeprecated();
96 96
97 // pos is a position equivalent to the caret. We use downstream() so that p os will 97 // pos is a position equivalent to the caret. We use downstream() so that p os will
98 // be in the first node that we need to move (there are a few exceptions to this, see below). 98 // be in the first node that we need to move (there are a few exceptions to this, see below).
99 Position pos = mostForwardCaretPosition(endingSelection().start()); 99 Position pos = mostForwardCaretPosition(endingSelection().start());
100 100
101 // Find the top-most blockquote from the start. 101 // Find the top-most blockquote from the start.
102 HTMLQuoteElement* topBlockquote = toHTMLQuoteElement(highestEnclosingNodeOfT ype(pos, isMailHTMLBlockquoteElement)); 102 HTMLQuoteElement* topBlockquote = toHTMLQuoteElement(highestEnclosingNodeOfT ype(pos, isMailHTMLBlockquoteElement));
103 if (!topBlockquote || !topBlockquote->parentNode()) 103 if (!topBlockquote || !topBlockquote->parentNode())
104 return; 104 return;
105 105
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 addBlockPlaceholderIfNeeded(clonedBlockquote, editingState); 234 addBlockPlaceholderIfNeeded(clonedBlockquote, editingState);
235 if (editingState->isAborted()) 235 if (editingState->isAborted())
236 return; 236 return;
237 237
238 // Put the selection right before the break. 238 // Put the selection right before the break.
239 setEndingSelection(VisibleSelection(Position::beforeNode(breakElement), Text Affinity::Downstream, endingSelection().isDirectional())); 239 setEndingSelection(VisibleSelection(Position::beforeNode(breakElement), Text Affinity::Downstream, endingSelection().isDirectional()));
240 rebalanceWhitespace(); 240 rebalanceWhitespace();
241 } 241 }
242 242
243 } // namespace blink 243 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698