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

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

Issue 425393002: Simplify code for finding body in FrameSelection::setSelectionFromNone() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | « 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/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index 2ed84aac4e26e24e5a3b7ebbc8ed1c4142092392..b8da536a4a1c921caf3c24abe5365d20195a512c 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -1823,8 +1823,7 @@ void FrameSelection::setSelectionFromNone()
Element* documentElement = document->documentElement();
if (!documentElement)
return;
- HTMLBodyElement* body = isHTMLBodyElement(*documentElement) ? toHTMLBodyElement(documentElement) : Traversal<HTMLBodyElement>::next(*documentElement);
- if (body)
+ if (HTMLBodyElement* body = Traversal<HTMLBodyElement>::firstChild(*documentElement))
setSelection(VisibleSelection(firstPositionInOrBeforeNode(body), DOWNSTREAM));
}
« 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