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

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

Issue 23311004: inline <br> does not get deleted when following some non-textual content (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch with changed layout testcase Created 7 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 | « LayoutTests/editing/deleting/delete-inline-br-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/DeleteSelectionCommand.cpp
diff --git a/Source/core/editing/DeleteSelectionCommand.cpp b/Source/core/editing/DeleteSelectionCommand.cpp
index cf7b3be70ed4e148722ad027425de707d9f3dd0d..7a1ae301096cdf14318125d4d4ae1c4b3a48d651 100644
--- a/Source/core/editing/DeleteSelectionCommand.cpp
+++ b/Source/core/editing/DeleteSelectionCommand.cpp
@@ -324,7 +324,9 @@ bool DeleteSelectionCommand::handleSpecialCaseBRDelete()
// FIXME: This code doesn't belong in here.
// We detect the case where the start is an empty line consisting of BR not wrapped in a block element.
- if (upstreamStartIsBR && downstreamStartIsBR && !(isStartOfBlock(positionBeforeNode(nodeAfterUpstreamStart)) && isEndOfBlock(positionAfterNode(nodeAfterUpstreamStart)))) {
+ if (upstreamStartIsBR && downstreamStartIsBR
+ && !(isStartOfBlock(positionBeforeNode(nodeAfterUpstreamStart)) && isEndOfBlock(positionAfterNode(nodeAfterDownstreamStart)))
+ && (!nodeAfterUpstreamEnd || nodeAfterUpstreamEnd->hasTagName(brTag) || nodeAfterUpstreamEnd->previousSibling() != nodeAfterUpstreamStart)) {
m_startsAtEmptyLine = true;
m_endingPosition = m_downstreamEnd;
}
« no previous file with comments | « LayoutTests/editing/deleting/delete-inline-br-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698