Re: [csswg-drafts] [cssom-view] Add notIfViewed to ScrollIntoViewOptions; add FocusScrollOptions

Another approach could be to add "-if-needed" suffixes to the keywords in LogicalScrollPosition. The current `nearest` already has "if needed" semantics, as specified. This would give more control as it lets developers specify "if needed" separately for the two dimensions.

```
focus({ preventScroll: true });
focus({ scrollOptions: { block: "center", inline: "center" } });
focus({ scrollOptions: { block: "center-if-needed", inline: "center-if-needed" } });
scrollIntoView({ block: "start" });
scrollIntoView({ block: "start-if-needed" });
```
IDL
```
enum ScrollLogicalPosition { "start", "start-if-needed", "center", "center-if-needed", "end", "end-if-needed", "nearest" };
```
(No change to `nearest` for compat.)

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

Received on Friday, 15 September 2017 12:01:16 UTC