Process the 'autofocus' attribute upon dialog.showModal()

This change just handles autofocusing as described in the
WHATWG spec: on subject.showModal, give focus to the
"first element in tree order whose nearest ancestor
dialog element is subject and that has an autofocus
attribute specified, if any."

Probably, the first focusable child should get focus if
nothing was autofocused, but that spec is still in
progress:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23366

This patch introduces isAutofocusable and
shouldAutofocusOnAttach, since the steps for autofocusing
on node insertion and on dialog.showModal differ in
the spec.

Although the spec just says to autofocus
elements with the "autofocus" attribute, our existing
behavior is to not autofocus elements who don't have an
autofocus IDL attribute, e.g., using
setAttribute('autofocus') on an <output> won't give it 
focus. This is consistent with Firefox's behavior.
So the check of the element tags in isAutofocus() remains
for dialog.showModal.


BUG=298079

Review URL: https://codereview.chromium.org/25487002

git-svn-id: svn://svn.chromium.org/blink/trunk@158714 bbb929c8-8fbe-4397-9dbb-9b2b20218538