-
Notifications
You must be signed in to change notification settings - Fork 715
[cssom-view] ScrollIntoViewOptions "nearest" description #4918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My understanding is that two conditions need to be described, as follow: → If element edge A and element edge B are both inside scrolling box edge A and scrolling box edge B → If element edge C and element edge D are both inside scrolling box edge C and scrolling box edge D |
But if both A and B edges are inside, then the other conditions do not hold. So nothing is done either. Then the spec seems fine already, your proposal would be just for completeness/clarification, right? |
Yes, for completeness and clarity. Another option (just stating, not recommending it) would be to remove any "do nothing" cases then. |
If you remove the initial "do nothing" case, then the other conditions may match when they are not supposed to. |
Indeed. To me the first condition illustrates only one possible situation: the element height is greater than the viewport and the element is currently taking all of the viewport. Please correct me if there's another possible situation. I'd be more secure about it if there was a 'respectively' there. And with that consideration on the 1st condition when we get to the 3rd and 4th conditions we make sure that the opposite element edge not mentioned is inside its respective scrolling box edge without ever using the word inside. Maybe that was the intention here.. Back to my initial suggestion, from a practical point of view, knowing what happens when both edges are in view is extremely helpful since using "nearest" is the only way to achieve no scrolling ("do nothing"). |
https://drafts.csswg.org/cssom-view/#element-scrolling-members
By this description nothing is done only when the element is bigger than the viewport.
However, another situation when nothing is done is when both edges are inside the box edges.
The same is valid for when
inline is "nearest"
on item 9.8.The text was updated successfully, but these errors were encountered: