Skip layout if possible in Element.focus

This CL adds a way to check if an element is focusable without
requiring layout to be up to date. This allows us to skip doing a full
layout for elements that aren't focusable.

Bug: 808503
Change-Id: I9cbcde28262039e908aac6cbc9ce00a057320c30
Reviewed-on: https://chromium-review.googlesource.com/955544
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Alan Cutter <alancutter@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549511}
5 files changed