Re: [csswg-drafts] [css-nav-1] Tweak the distance function to prioritize elements that are aligned (#3388)

While investigating how to improve the distance formula in the spec, I noticed that prioritizing elements that are with the currently focused element can be solved by removing the **B factor** of the formula. 

But there still remains ambiguity when there are more than one aligned elements with the currently focused element.
For example, please see [this sample](https://wicg.github.io/spatial-navigation/tests/ux/spatnav-distance-function-grid-003.html). 

Therefore, to solve this problem, I'd like to suggest adding a **_new factor_** for calculating the degree of alignment between a candidate and the search origin.

 The factor is calculated as

> Factor = degree of alignment * alignWeight
> 
> degree of alignment = (length of the edge of the area of intersection between a candidate and the search origin / length of the edge of the search origin)

See more information in [here](https://wicg.github.io/spatial-navigation/tests/ux/result.html#2-add-the-factor-about-calculating-the-degree-of-alignment-between-a-candidate-and-the-search-origin).

For overall improvement of the distance formula, I suggest the changes in the issue  https://github.com/w3c/csswg-drafts/issues/3384.

-- 
GitHub Notification of comment by jihyerish
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3388#issuecomment-459632031 using your GitHub account

Received on Friday, 1 February 2019 07:28:15 UTC