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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.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) 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005, 2006 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Handle whitespace that occurs after the split 149 // Handle whitespace that occurs after the split
150 document().updateLayoutIgnorePendingStylesheets(); 150 document().updateLayoutIgnorePendingStylesheets();
151 // TODO(yosin) |isRenderedCharacter()| should be removed, and we should 151 // TODO(yosin) |isRenderedCharacter()| should be removed, and we should
152 // use |VisiblePosition::characterAfter()|. 152 // use |VisiblePosition::characterAfter()|.
153 if (!isRenderedCharacter(endingPosition)) { 153 if (!isRenderedCharacter(endingPosition)) {
154 Position positionBeforeTextNode(positionInParentBeforeNode(*textNode )); 154 Position positionBeforeTextNode(positionInParentBeforeNode(*textNode ));
155 // Clear out all whitespace and insert one non-breaking space 155 // Clear out all whitespace and insert one non-breaking space
156 deleteInsignificantTextDownstream(endingPosition); 156 deleteInsignificantTextDownstream(endingPosition);
157 ASSERT(!textNode->layoutObject() || textNode->layoutObject()->style( )->collapseWhiteSpace()); 157 ASSERT(!textNode->layoutObject() || textNode->layoutObject()->style( )->collapseWhiteSpace());
158 // Deleting insignificant whitespace will remove textNode if it cont ains nothing but insignificant whitespace. 158 // Deleting insignificant whitespace will remove textNode if it cont ains nothing but insignificant whitespace.
159 if (textNode->inDocument()) { 159 if (textNode->inShadowIncludingDocument()) {
160 insertTextIntoNode(textNode, 0, nonBreakingSpaceString()); 160 insertTextIntoNode(textNode, 0, nonBreakingSpaceString());
161 } else { 161 } else {
162 RawPtr<Text> nbspNode = document().createTextNode(nonBreakingSpa ceString()); 162 RawPtr<Text> nbspNode = document().createTextNode(nonBreakingSpa ceString());
163 insertNodeAt(nbspNode.get(), positionBeforeTextNode, editingStat e); 163 insertNodeAt(nbspNode.get(), positionBeforeTextNode, editingStat e);
164 if (editingState->isAborted()) 164 if (editingState->isAborted())
165 return; 165 return;
166 endingPosition = firstPositionInNode(nbspNode.get()); 166 endingPosition = firstPositionInNode(nbspNode.get());
167 } 167 }
168 } 168 }
169 169
(...skipping 18 matching lines...) Expand all
188 // before the line break (if the line break is at the end of a block it isn't selectable). 188 // before the line break (if the line break is at the end of a block it isn't selectable).
189 // So, this next call sets the endingSelection() to a caret just after t he line break 189 // So, this next call sets the endingSelection() to a caret just after t he line break
190 // that we inserted, or just before it if it's at the end of a block. 190 // that we inserted, or just before it if it's at the end of a block.
191 setEndingSelection(endingSelection().visibleEnd()); 191 setEndingSelection(endingSelection().visibleEnd());
192 } 192 }
193 193
194 rebalanceWhitespace(); 194 rebalanceWhitespace();
195 } 195 }
196 196
197 } // namespace blink 197 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698