[csswg-drafts] [css-nav-1] Remove kAlignWeight? (#4567)

hugoholgersson has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-nav-1] Remove kAlignWeight? ==
Today Alignment() always returns a value between 0 and 5. [1]

That's a very small number so Alignment is, in practice, only used to break ties (when two candidates are at the same distance we take the one that is more aligned [2]).

As we only use alignment to break ties, alignment might as well be a number between 0 and 1. This means we can remove the multiplication of `alignWeight` from the formula?

[1] https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/page/spatial_navigation.cc?q=file:spatial+symbol:Alignment&sq=package:chromium
[2] https://chromium-review.googlesource.com/c/chromium/src/+/1594724/11/third_party/blink/web_tests/fast/spatial-navigation/snav-aligned-insiders.html

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4567 using your GitHub account

Received on Friday, 6 December 2019 07:08:05 UTC