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

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

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return; 148 return;
149 149
150 // Don't put the next paragraph in the blockquote we just created for th is paragraph unless 150 // Don't put the next paragraph in the blockquote we just created for th is paragraph unless
151 // the next paragraph is in the same cell. 151 // the next paragraph is in the same cell.
152 if (enclosingCell && enclosingCell != enclosingNodeOfType(endOfNextParag raph.deepEquivalent(), &isTableCell)) 152 if (enclosingCell && enclosingCell != enclosingNodeOfType(endOfNextParag raph.deepEquivalent(), &isTableCell))
153 blockquoteForNextIndent = nullptr; 153 blockquoteForNextIndent = nullptr;
154 154
155 // indentIntoBlockquote could move more than one paragraph if the paragr aph 155 // indentIntoBlockquote could move more than one paragraph if the paragr aph
156 // is in a list item or a table. As a result, endAfterSelection could re fer to a position 156 // is in a list item or a table. As a result, endAfterSelection could re fer to a position
157 // no longer in the document. 157 // no longer in the document.
158 if (endAfterSelection.isNotNull() && !endAfterSelection.deepEquivalent() .inDocument()) 158 if (endAfterSelection.isNotNull() && !endAfterSelection.deepEquivalent() .inShadowIncludingDocument())
159 break; 159 break;
160 // Sanity check: Make sure our moveParagraph calls didn't remove endOfNe xtParagraph.deepEquivalent().anchorNode() 160 // Sanity check: Make sure our moveParagraph calls didn't remove endOfNe xtParagraph.deepEquivalent().anchorNode()
161 // If somehow, e.g. mutation event handler, we did, return to prevent cr ashes. 161 // If somehow, e.g. mutation event handler, we did, return to prevent cr ashes.
162 if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent ().inDocument()) 162 if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent ().inShadowIncludingDocument())
163 return; 163 return;
164 endOfCurrentParagraph = endOfNextParagraph; 164 endOfCurrentParagraph = endOfNextParagraph;
165 } 165 }
166 } 166 }
167 167
168 static bool isNewLineAtPosition(const Position& position) 168 static bool isNewLineAtPosition(const Position& position)
169 { 169 {
170 Node* textNode = position.computeContainerNode(); 170 Node* textNode = position.computeContainerNode();
171 int offset = position.offsetInContainerNode(); 171 int offset = position.offsetInContainerNode();
172 if (!textNode || !textNode->isTextNode() || offset < 0 || offset >= textNode ->maxCharacterOffset()) 172 if (!textNode || !textNode->isTextNode() || offset < 0 || offset >= textNode ->maxCharacterOffset())
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return element.release(); 301 return element.release();
302 } 302 }
303 303
304 DEFINE_TRACE(ApplyBlockElementCommand) 304 DEFINE_TRACE(ApplyBlockElementCommand)
305 { 305 {
306 visitor->trace(m_endOfLastParagraph); 306 visitor->trace(m_endOfLastParagraph);
307 CompositeEditCommand::trace(visitor); 307 CompositeEditCommand::trace(visitor);
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698