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

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

Issue 485313002: Simplify TypingCommand::makeEditableRootEmpty() a bit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/TypingCommand.cpp
diff --git a/Source/core/editing/TypingCommand.cpp b/Source/core/editing/TypingCommand.cpp
index d3b8864706f026488af592b08d9999d04a4b9d24..47830a99e7d67baf690af586b3c3494656ccbd2b 100644
--- a/Source/core/editing/TypingCommand.cpp
+++ b/Source/core/editing/TypingCommand.cpp
@@ -390,8 +390,7 @@ bool TypingCommand::makeEditableRootEmpty()
return false;
if (root->firstChild() == root->lastChild()) {
- Element* firstElementChild = ElementTraversal::firstWithin(*root);
- if (isHTMLBRElement(firstElementChild)) {
+ if (isHTMLBRElement(root->firstChild())) {
// If there is a single child and it could be a placeholder, leave it alone.
if (root->renderer() && root->renderer()->isRenderBlockFlow())
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698