Skip to content

Rustdoc line number desynchronization on iPhone Safari #102404

Closed
@pali6

Description

@pali6

On iPhone Safari 15.1 (and possibly other mobile browsers, I am unable to check EDIT: Android browsers do not have this issue) in the source view code lines get line wrapped which causes the line numbers to desynchronize from their lines. In some cases multi-digit line numbers also get line wrapped which causes further desynchronization, though from my checking this currently happens for docs hosted on docs.rs but not on doc.rust-lang.org/std. This issue also means that clicking on source links in documentation leads to completely unrelated code as the links are to the line numbers and not the lines themselves.

This issue does not happen on Windows browsers I tested when I manually shrink the window to be approximately as narrow as the mobile browser. I have not tested the issue with computer version of Safari.

https://doc.rust-lang.org/src/std/lib.rs.html#1-633 viewed on iPhone Safari 15.1 (note how one code line covers multiple line numbers when it wraps):
image

https://doc.rust-lang.org/src/std/lib.rs.html#1-633 viewed on Windows Firefox 105.0.1 with similar window size (no issue here):
image

https://docs.rs/smallvec/latest/src/smallvec/lib.rs.html#1485 viewed on iPhone Safari 15.1 (no source code is visible because the multi-line line numbers scroll way beyond source code):
image

https://docs.rs/smallvec/latest/src/smallvec/lib.rs.html#1485 viewed on iPhone Safari 15.1 and manually scrolled to the correct line (note the incorrect line numbers that cover multiple actual code lines):
image

https://docs.rs/smallvec/latest/src/smallvec/lib.rs.html#1485 viewed on Windows Firefox 105.0.1 with similar window size (no issue here):
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions