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

Unified Diff: third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp

Issue 2397963002: Reflow comments in //third_party/WebKit/Source/core/editing/commands (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
index df5c04b8e4605a1808f59a1a7c0caa55967ceeb5..d9d2bd2ca3645ae6735577a7f8662c36f38f31f4 100644
--- a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
@@ -173,20 +173,21 @@ void ApplyBlockElementCommand::formatSelection(
if (editingState->isAborted())
return;
- // Don't put the next paragraph in the blockquote we just created for this paragraph unless
- // the next paragraph is in the same cell.
+ // Don't put the next paragraph in the blockquote we just created for this
+ // paragraph unless the next paragraph is in the same cell.
if (enclosingCell &&
enclosingCell !=
enclosingNodeOfType(endOfNextParagraph.position(), &isTableCell))
blockquoteForNextIndent = nullptr;
// indentIntoBlockquote could move more than one paragraph if the paragraph
- // is in a list item or a table. As a result, endAfterSelection could refer to a position
- // no longer in the document.
+ // is in a list item or a table. As a result, endAfterSelection could refer
+ // to a position no longer in the document.
if (endAfterSelection.isNotNull() && !endAfterSelection.isConnected())
break;
- // Sanity check: Make sure our moveParagraph calls didn't remove endOfNextParagraph.position().anchorNode()
- // If somehow, e.g. mutation event handler, we did, return to prevent crashes.
+ // Sanity check: Make sure our moveParagraph calls didn't remove
+ // endOfNextParagraph.position().anchorNode() If somehow, e.g. mutation
+ // event handler, we did, return to prevent crashes.
if (endOfNextParagraph.isNotNull() &&
!endOfNextParagraph.position().isConnected())
return;
@@ -335,9 +336,10 @@ ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded(
!isNewLineAtPosition(Position::firstPositionInNode(text)))
return endOfNextParagraph;
- // \n at the beginning of the text node immediately following the current paragraph is trimmed by moveParagraphWithClones.
- // If endOfNextParagraph was pointing at this same text node, endOfNextParagraph will be shifted by one paragraph.
- // Avoid this by splitting "\n"
+ // \n at the beginning of the text node immediately following the current
+ // paragraph is trimmed by moveParagraphWithClones. If endOfNextParagraph was
+ // pointing at this same text node, endOfNextParagraph will be shifted by one
+ // paragraph. Avoid this by splitting "\n"
splitTextNode(text, 1);
document().updateStyleAndLayoutIgnorePendingStylesheets();
@@ -356,7 +358,8 @@ ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded(
if (text == m_endOfLastParagraph.computeContainerNode()) {
if (m_endOfLastParagraph.offsetInContainerNode() <
position.offsetInContainerNode()) {
- // We can only fix endOfLastParagraph if the previous node was still text and hasn't been modified by script.
+ // We can only fix endOfLastParagraph if the previous node was still text
+ // and hasn't been modified by script.
if (text->previousSibling()->isTextNode() &&
static_cast<unsigned>(m_endOfLastParagraph.offsetInContainerNode()) <=
toText(text->previousSibling())->length())
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698