Re: [csswg-drafts] [cssom-view] Add ScrollIntoViewMode ("always", "if-needed"); add FocusScrollOptions (#5677)

> the interop difference in alignment on focus() should be fixed by browsers directly

I agree with it, but it hasn't been able to be unified for a long time, so authors need to have an option for handling it as one behavior now. Hopefully, it can be completed by

> I wonder if it makes sense to have a CSS property for focus alignment, which could take effect both for focus() and when the user moves focus with the Tab key.

If we define a new CSS property for focus alignment, it needs to work as `scroll-behavior` does. The scroll-behavior takes effect both cases now. (focus() method and seq. navigation by tab key) Do we have further consideration for defining the new CSS property? If it needs much works to do, it could be simply handled by FocusScrollOptions as parameters inside focus() without a new CSS property.
e.g. `scroll-alignment-[x|y]: [auto | start | end | center]`

> It's a separate dictionary from ScrollIntoViewOptions because scrollIntoView() and focus() have different default behavior (always vs. if-needed, and likely also default alignment).

If we can define the different default behaviors as a unified one in CSSOM-VIEW spec, ScrollIntoViewOptions could be used for several usages incl. focus(). If it would be difficult, I'm okay to put FocusScrollOptions separately from ScrollIntoViewOptions.

GitHub Notification of comment by anawhj
Please view or discuss this issue at using your GitHub account

Sent via github-notify-ml as configured in

Received on Wednesday, 18 November 2020 09:54:44 UTC