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

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

Issue 18313005: Introduce isHTMLTableElement and toHTMLTableElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Retry Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | Source/core/editing/InsertLineBreakCommand.cpp » ('j') | 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 a01bb00bf2e032a4263dba30772596db6beafcec..9ba5478843d829c558f1d7882ba0384f3f6fa488 100644
--- a/Source/core/editing/DeleteSelectionCommand.cpp
+++ b/Source/core/editing/DeleteSelectionCommand.cpp
@@ -36,6 +36,7 @@
#include "core/editing/VisibleUnits.h"
#include "core/editing/htmlediting.h"
#include "core/html/HTMLInputElement.h"
+#include "core/html/HTMLTableElement.h"
#include "core/page/Frame.h"
#include "core/rendering/RenderTableCell.h"
@@ -443,7 +444,7 @@ void DeleteSelectionCommand::handleGeneralDelete()
makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss();
// Never remove the start block unless it's a table, in which case we won't merge content in.
- if (startNode == m_startBlock && startOffset == 0 && canHaveChildrenForEditing(startNode) && !startNode->hasTagName(tableTag)) {
+ if (startNode->isSameNode(m_startBlock.get()) && !startOffset && canHaveChildrenForEditing(startNode) && !isHTMLTableElement(startNode)) {
startOffset = 0;
startNode = NodeTraversal::next(startNode);
if (!startNode)
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | Source/core/editing/InsertLineBreakCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698