Here is the crux of the change. First, look for an element with the data-autofocus attribute. If it is true, try to focus. To avoid breaking backwards compatibility, look for the first enabled, visible input element. Fall back to the first visible button.