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

Unified Diff: Source/core/editing/commands/DeleteSelectionCommand.cpp

Issue 1286993006: Introduce isRenderedCharacter(Position) function (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T12:39:43 Created 5 years, 4 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 | « Source/core/editing/Position.cpp ('k') | Source/core/editing/commands/InsertLineBreakCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/commands/DeleteSelectionCommand.cpp
diff --git a/Source/core/editing/commands/DeleteSelectionCommand.cpp b/Source/core/editing/commands/DeleteSelectionCommand.cpp
index d2754997ea1395ffed3a21539e0fbc7e7af2b299..7e8c4900e4fc81b7dfe74ec890cd91d51231f5b5 100644
--- a/Source/core/editing/commands/DeleteSelectionCommand.cpp
+++ b/Source/core/editing/commands/DeleteSelectionCommand.cpp
@@ -570,13 +570,15 @@ void DeleteSelectionCommand::handleGeneralDelete()
void DeleteSelectionCommand::fixupWhitespace()
{
document().updateLayoutIgnorePendingStylesheets();
- // FIXME: isRenderedCharacter should be removed, and we should use VisiblePosition::characterAfter and VisiblePosition::characterBefore
- if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharacter() && m_leadingWhitespace.anchorNode()->isTextNode()) {
+ // TODO(yosin) |isRenderedCharacter()| should be removed, and we should use
+ // |VisiblePosition::characterAfter()| and
+ // |VisiblePosition::characterBefore()|
+ if (m_leadingWhitespace.isNotNull() && !isRenderedCharacter(m_leadingWhitespace) && m_leadingWhitespace.anchorNode()->isTextNode()) {
Text* textNode = toText(m_leadingWhitespace.anchorNode());
ASSERT(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace());
replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.computeOffsetInContainerNode(), 1, nonBreakingSpaceString());
}
- if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedCharacter() && m_trailingWhitespace.anchorNode()->isTextNode()) {
+ if (m_trailingWhitespace.isNotNull() && !isRenderedCharacter(m_trailingWhitespace) && m_trailingWhitespace.anchorNode()->isTextNode()) {
Text* textNode = toText(m_trailingWhitespace.anchorNode());
ASSERT(!textNode->layoutObject() || textNode->layoutObject()->style()->collapseWhiteSpace());
replaceTextInNodePreservingMarkers(textNode, m_trailingWhitespace.computeOffsetInContainerNode(), 1, nonBreakingSpaceString());
« no previous file with comments | « Source/core/editing/Position.cpp ('k') | Source/core/editing/commands/InsertLineBreakCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698