Skip to content

Conversation

@jihyerish
Copy link
Contributor

This changes aim to update the spec with the improved distance function (Fixes #3384)

@jihyerish jihyerish requested a review from frivoal March 26, 2019 08:39
@jihyerish jihyerish removed the request for review from frivoal March 29, 2019 06:34
Copy link
Member

@anawhj anawhj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

@jihyerish jihyerish merged commit 550369f into w3c:master Mar 29, 2019
jihyerish pushed a commit to WICG/spatial-navigation that referenced this pull request Mar 29, 2019
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>

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?

Copy link
Member

@anawhj anawhj May 3, 2019

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

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).

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants