This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Created attachment 1508 [details] Example showing the expectations of the new behavior; this is the primary repro file. A few months ago, IE made a platform change to improve our Mobile interop to match a webkit behavior which a variety of sites required in order to display properly. The change involved the behavior of focusing the body element. IE [previously], Firefox, and the spec all define the behavior that when element.focus() is called on the body element, it forwards the focus command on to the window which causes the viewport to be in a focused state (this scenario is usually done from a parent browsing context calling focus() on the body element of a child browsing context). However, in Webkit-based browsers, the ability of the body/viewport to accept focus is conditional on whether the body element can actually accept focus (e.g., if the body element has a valid tabindex attribute set). So, in a webkit-based browser and now in IE (on mobile, soon to come to desktop) unless the body element is focusable the call to focus() the body will do nothing. I recommend updating the spec to contain this condition in order to better match an interoperable pattern that many [mobile] sites expect. The change would be from: > Section: Focus management APIs > element . focus() > Moves the focus to the element. > If the element is the body element, moves the focus to the viewport instead. to: > Section: Focus management APIs > element . focus() > Moves the focus to the element. > If the element is the body element, and the body element is focusable, moves the focus to the viewport instead. Otherwise, does nothing. (and update the relevant details in the algorithm for the "focusing steps")
Created attachment 1509 [details] Supporting Iframe (needed for the repro)
Making this a higher priority to actively seek more feedback on from implementers and webdevs.
HTML5.1 Bugzilla Bug Triage: Moved to Github issue: https://github.com/w3c/html/issues/290 To file additional issues please use the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new Thanks!