Simplify DOM Tree traversal in FrameSelection::setSelectionFromNone(). We only need to traverse the direct children of the Document element to find the body. The previous code was potentially traversing descendants. The new code is consistent with Document::body() except that we only look for an HTMLBodyElement (and ignore HTMLFrameSetElement).
Created attachment 237992 [details] Patch
Comment on attachment 237992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=237992&action=review > Source/WebCore/editing/FrameSelection.cpp:2117 > + Element* documentElement = document->documentElement(); > + if (!documentElement) > + return; If I were you, I'd declare documentElement inside the if condition and nest the if's.
Comment on attachment 237992 [details] Patch Clearing flags on attachment: 237992 Committed r173549: <http://trac.webkit.org/changeset/173549>
All reviewed patches have been landed. Closing bug.
Comment on attachment 237992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=237992&action=review > Source/WebCore/editing/FrameSelection.cpp:2115 > + Element* documentElement = document->documentElement(); In a case like this I prefer to use auto*. Later we might make the documentElement() function return a more specific type and it would be nice not to have to visit this call site.
Comment on attachment 237992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=237992&action=review >> Source/WebCore/editing/FrameSelection.cpp:2115 >> + Element* documentElement = document->documentElement(); > > In a case like this I prefer to use auto*. Later we might make the documentElement() function return a more specific type and it would be nice not to have to visit this call site. Ok, it makes sense. Would you like me to land another patch for the nit fix or is this for future reference?