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

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

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return; 147 return;
148 148
149 // Don't put the next paragraph in the blockquote we just created for th is paragraph unless 149 // Don't put the next paragraph in the blockquote we just created for th is paragraph unless
150 // the next paragraph is in the same cell. 150 // the next paragraph is in the same cell.
151 if (enclosingCell && enclosingCell != enclosingNodeOfType(endOfNextParag raph.deepEquivalent(), &isTableCell)) 151 if (enclosingCell && enclosingCell != enclosingNodeOfType(endOfNextParag raph.deepEquivalent(), &isTableCell))
152 blockquoteForNextIndent = nullptr; 152 blockquoteForNextIndent = nullptr;
153 153
154 // indentIntoBlockquote could move more than one paragraph if the paragr aph 154 // indentIntoBlockquote could move more than one paragraph if the paragr aph
155 // is in a list item or a table. As a result, endAfterSelection could re fer to a position 155 // is in a list item or a table. As a result, endAfterSelection could re fer to a position
156 // no longer in the document. 156 // no longer in the document.
157 if (endAfterSelection.isNotNull() && !endAfterSelection.deepEquivalent() .inShadowIncludingDocument()) 157 if (endAfterSelection.isNotNull() && !endAfterSelection.deepEquivalent() .isConnected())
158 break; 158 break;
159 // Sanity check: Make sure our moveParagraph calls didn't remove endOfNe xtParagraph.deepEquivalent().anchorNode() 159 // Sanity check: Make sure our moveParagraph calls didn't remove endOfNe xtParagraph.deepEquivalent().anchorNode()
160 // If somehow, e.g. mutation event handler, we did, return to prevent cr ashes. 160 // If somehow, e.g. mutation event handler, we did, return to prevent cr ashes.
161 if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent ().inShadowIncludingDocument()) 161 if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent ().isConnected())
162 return; 162 return;
163 endOfCurrentParagraph = endOfNextParagraph; 163 endOfCurrentParagraph = endOfNextParagraph;
164 } 164 }
165 } 165 }
166 166
167 static bool isNewLineAtPosition(const Position& position) 167 static bool isNewLineAtPosition(const Position& position)
168 { 168 {
169 Node* textNode = position.computeContainerNode(); 169 Node* textNode = position.computeContainerNode();
170 int offset = position.offsetInContainerNode(); 170 int offset = position.offsetInContainerNode();
171 if (!textNode || !textNode->isTextNode() || offset < 0 || offset >= textNode ->maxCharacterOffset()) 171 if (!textNode || !textNode->isTextNode() || offset < 0 || offset >= textNode ->maxCharacterOffset())
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 return element; 300 return element;
301 } 301 }
302 302
303 DEFINE_TRACE(ApplyBlockElementCommand) 303 DEFINE_TRACE(ApplyBlockElementCommand)
304 { 304 {
305 visitor->trace(m_endOfLastParagraph); 305 visitor->trace(m_endOfLastParagraph);
306 CompositeEditCommand::trace(visitor); 306 CompositeEditCommand::trace(visitor);
307 } 307 }
308 308
309 } // namespace blink 309 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698