-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rustdoc line number desynchronization on iPhone Safari #102404
Comments
I don't have an iphone so I won't be able to check what's going. Does someone on the @rust-lang/rustdoc team has an iphone by any chance? |
I've got one and will check. |
I was unable to reproduce on iPhone 15.5. The lines don't wrap at all, which is expected behavior. It looks like the latest iOS version is 15.7. I'm upgrading to that now. @pali6 would you mind upgrading to 15.7 as well and seeing if it still reproduces for you? |
That indeed fixed the issue. My bad for not staying updated. |
No worries! Thanks for taking the time. |
This is based on the compatibility data for `window.matchMedia` and `MediaQueryList`'s `EventTarget` implementation. https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#browser_compatibility https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia#browser_compatibility * EventTarget would require us to drop support for all Chrome versions before 39. However, we already require Chrome 49, because rustdoc requires [CSS variables]. * EventTarget would also limit us to Firefox 55, but since rust-lang#106502 rustdoc only supports Firefox > 68. * EventTarget limits us to Mobile Safari version 14, but rust-lang#102404 shows that our CSS is broken in Safari versions before 15.5. [CSS variables]: https://developer.mozilla.org/en-US/docs/Web/CSS/--*#browser_compatibility
On iPhone Safari 15.1 (
and possibly other mobile browsers, I am unable to checkEDIT: 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):

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):

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):

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):

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):

The text was updated successfully, but these errors were encountered: