W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2019

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

From: Jihye Hong via GitHub <sysbot+gh@w3.org>
Date: Fri, 01 Feb 2019 07:28:12 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-459632031-1549006091-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:43 UTC