DescriptionSimplify code for finding body in FrameSelection::setSelectionFromNone()
Simplify code for finding body in FrameSelection::setSelectionFromNone() by
using Traversal<HTMLBodyElement>::firstChild(*documentElement). This is very
close to what is done in Document::body() except that body() searches for
both HTMLBodyElement and HTMLFrameSetElement. For this reason, we cannot
simply call Document::body() here.
Besides being shorter, the new code is also more optimal because:
- It does not check documentElement as it cannot be an HTMLBodyElement. For
HTML documents, the documentElement is an HTMLHtmlElement.
- It avoids checking descendants and will only check the direct children of
the <html> element.
R=adamk@chromium.org, leviw@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179259
Patch Set 1 #
Messages
Total messages: 4 (0 generated)
|