Implement new focusing steps for modal <dialog>.

When a modal <dialog> is opened, then
1) The first autofocusable element in the dialog gets focus, or else
2) The first focusable element in the dialog gets focus, or else
3) The dialog itself gets focus, if it's focusable, or else
4) Focus is cleared (effectively, document.body gets focus)

I chose to do (4) since the the previous implementation
relied on CheckFocusedElementTask to clear focus, which
isn't great because "dialog.showModal(); document.activeElement"
was a race condition. One problem with (4) is it will
remove focus from a non-inert ancestor, but the spec also recently
changed to make ancestors inert so that's the direction to take.
We can't make that change immediately though since:
a) it would make document.body inert, which violates
assumptions of document.body getting default focus when
nothing else can have focus, and
b) it would prune the modal <dialog> out of the accessibility
tree

As per the recent spec change:
http://html5.org/r/8338

BUG=298078,324401

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

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