DescriptionSimplify TypingCommand::makeEditableRootEmpty() a bit
Simplify TypingCommand::makeEditableRootEmpty() a bit by avoiding an unnecessary
call to ElementTraversal::firstWithin().
In this if scope, we already know that the root node has a single child.
Therefore, there is no reason to do a tree traversal, we can directly call
ContainerNode::firstChild().
ElementTraversal::firstWithin() never explores descendants and only looks
for the first direct child that is an Element. In this case, we don't need to
check if the child is an Element as we can pass a Node to isHTMLBRElement().
R=leviw@chromium.org, yosin@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180673
Patch Set 1 #
Messages
Total messages: 7 (0 generated)
|