• Hugo Holgersson's avatar
    [SpatNav] Add projected overlap to SpatNav's distance formula · b27a05ca
    Hugo Holgersson authored
    When two candidates are equally close to our current focus F,
    SpatNav now prioritizes the candidate that can "absorb" most
    of F's horizontal or vertical projection. The spec calls this
    "projected overlap" [1].
    
    When a document is focused (or when activeElement is null),
    SpatNav projects the document's edge onto each candidate.
    More generally, when looking inside (and outside) any focused
    box, we project the box's _edge_ onto each candidate.
    
    Note: The current spec [1] suggests us to remove
    |navigation_axis_distance| from the formula but if we do,
    snav-symmetrically-positioned.html will fail. So let's keep
    it until we find a simpler/more robust formula that can
    handle this pattern.
    
    [1] https://drafts.csswg.org/css-nav-1/
    
    Bug: 958845
    Change-Id: Id90bce78c9e9d985e6936716b8dafce883b07540
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594724Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
    Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
    Commit-Queue: Hugo Holgersson <hholgersson@fb.com>
    Cr-Commit-Position: refs/heads/master@{#665845}
    b27a05ca
snav-fragmented-link.html 3.62 KB