-
Notifications
You must be signed in to change notification settings - Fork 756
[css-nav-1] Modify the definition of the distance function #3755
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
Conversation
Change the meaning of factor B as the resolution from #3384
anawhj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved
Modify the distance function depending on the updated spec (w3c/csswg-drafts#3755)
| * <var>alignBias</var> | ||
|
|
||
| * If the <var>dir</var> is {{SpatialNavigationDirection/left}} or {{SpatialNavigationDirection/right}}, | ||
| height of <var>intersectRect</var> / height of <var>candidate</var> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #3388 you wrote "length of the edge of the search origin". Here you wrote candidate's edge" instead... Mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The edge of search origin on the comment (#3388) has been replaced with the current expression on the spec which describes an edge of candidate. If you have another opinion, please put it here or make an issue so that we could consider. With minor updates (figures of some weights), we are going to apply the updated expression into Blink.
BTW, the polyfill would operate it with the edge of search origin that seems not to match with the current spec. @jihyerish please check and update on it.
https://github.com/WICG/spatial-navigation/blob/master/polyfill/spatial-navigation-polyfill.js#L1059
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created crbug.com/958845 for the Blink work.
See this example:
____________________ top edge of container or other focusable. 20 units wide.
YYYYY XXXXXXXXXXXX
Here we want X to win so we do 12/20 .
12 / 20 > 5 / 20 => we give X a larger alignment because we want to decrease the distance to X more than we decrease the distance to Y. (alignment is a negative term in the formula).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right. My mistake...
Thanks for pointing this out! I'll fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been fixed by bfe77ef.
This changes aim to update the spec with the improved distance function (Fixes #3384)