Skip to content

[css-nav-1] Remove kAlignWeight? #4567

@hugoholgersson

Description

@hugoholgersson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions