Open Bug 1410112 Opened 8 years ago Updated 6 months ago

How to reach full interoperability on default scrolling behavior for HTMLElement focus()

Categories

(Core :: DOM: UI Events & Focus Handling, enhancement, P3)

enhancement

Tracking

()

Tracking Status
firefox58 --- affected

People

(Reporter: zcorpan, Unassigned)

Details

Context is: https://github.com/w3c/csswg-drafts/pull/1805#issuecomment-337801758 > Ask browser vendors to consider if they want to get full interoperability on default scrolling behavior for focus(), and if so what the behavior should be. I can file issues. The current situation is summarized in https://github.com/w3c/csswg-drafts/pull/1805#issuecomment-331383688 and repeated below. Chrome, Opera, Safari behave as follows. Entirely in view: No scrolling Partially in view: Scrolling (block: nearest, inline: nearest) Entirely out of view: Scrolling (block: center, inline: center) Firefox, Edge behave as follows. Entirely in view: No scrolling Partially in view: No scrolling Entirely out of view: Scrolling (block: nearest, inline: nearest) Getting agreement between browsers here would give us a stable foundation to extend the focus() API with scrollOptions (or something) that can explain the default scrolling behavior and allow customizing alignment etc. It also makes the web platform more predictable for developers.
To put this to Anne's radar :)
Flags: needinfo?(annevk)
Priority: -- → P3
I think it would be best to ask UX folks if they have input on how scrolling should behave with regards to the focus scenarios outlined in comment 0, stressing that this needs to cover both horizontal and vertical scrolling, and needs to cover different writing directions, if I understand things correctly. We can then figure out how that would best map to https://drafts.csswg.org/cssom-view/#scroll-an-element-into-view. An alternative would be to simply match Chrome & Safari (if they decide not to change; https://bugs.webkit.org/show_bug.cgi?id=178515 lacks any feedback thus far) as they have majority market share on desktop and mobile and the behavior doesn't seem entirely unreasonable.
Flags: needinfo?(annevk)
Component: DOM: Core & HTML → DOM: UI Events & Focus Handling

There hasn't been any changes in other browsers. (Except Edge has switched to Chromium.) Getting interop in this would be good for adding new features, see discussion in https://github.com/w3c/csswg-drafts/pull/1805

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.