W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2020

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

From: Simon Pieters via GitHub <sysbot+gh@w3.org>
Date: Wed, 18 Nov 2020 08:19:03 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-729516022-1605687541-sysbot+gh@w3.org>
I think the interop difference in alignment on `focus()` should be fixed by browsers directly, and not be used as motivation for adding new API. We should only add alignment API if it's useful on its own.

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. I see that the Scroll Snap spec has 'scroll-snap-align' which seems related: https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align

> My proposal is:
> Can we rename the dictionary from [`scrollIntoviewOptions`](https://www.w3.org/TR/cssom-view-1/#dictdef-scrollintoviewoptions) to `scrollAllignmentOptions' as more general term?
> I referred Scroll Alignment term to https://scroll-into-view-if-needed.netlify.app/#scroll-alignment.
> The renamed dictionary can be referred for the additional focus() extension in whatwg side.
> It doesn't affect to web developers without any WebAPI change.

This PR adds `FocusScrollOptions`, intended to be used by `focus()`. It's a separate dictionary from `ScrollIntoViewOptions` because `scrollIntoView()` and `focus()` have different default behavior (`always` vs. `if-needed`, and likely also default alignment).

-- 
GitHub Notification of comment by zcorpan
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/pull/5677#issuecomment-729516022 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 18 November 2020 08:19:08 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:22 UTC