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

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

Issue 306583005: Avoid to insert TAB before HTML element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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/execCommand/insert-tab-to-html-element-crash-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/InsertTextCommand.cpp
diff --git a/Source/core/editing/InsertTextCommand.cpp b/Source/core/editing/InsertTextCommand.cpp
index 5d3d91513ab86deac1993a282b216d92dea1cce3..0d6e03f61acffe413df8ceb3e5026ca34a2d8f61 100644
--- a/Source/core/editing/InsertTextCommand.cpp
+++ b/Source/core/editing/InsertTextCommand.cpp
@@ -229,6 +229,8 @@ void InsertTextCommand::doApply()
Position InsertTextCommand::insertTab(const Position& pos)
{
Position insertPos = VisiblePosition(pos, DOWNSTREAM).deepEquivalent();
+ if (insertPos.isNull())
+ return pos;
Node* node = insertPos.containerNode();
unsigned offset = node->isTextNode() ? insertPos.offsetInContainerNode() : 0;
« no previous file with comments | « LayoutTests/editing/execCommand/insert-tab-to-html-element-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698