rustdoc mobile: fix scroll offset when jumping to internal id by jsha · Pull Request #93067 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation10 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Followup to #92692. The semantics of scroll-margin-top
are a little surprising - the attribute needs to be applied to the element that gets scrolled into the viewport, not the scrolling element.
This fixes an issue where clicking on a method (or other item) from the sidebar takes you to a scroll position where the topbar covers up the method name.
I'm interested in ideas for how to test this with browser-ui-test, but I think it doesn't yet have what I need. What I need is an assert that <element>.getBoundingClientRect().y
is > 45.
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Area: Rustdoc UI (generated HTML)
labels
I'm interested in ideas for how to test this with browser-ui-test, but I think it doesn't yet have what I need. What I need is an assert that
<element>.getBoundingClientRect().y
is > 45.
Maybe the following would work: click on an element. Check that the element has the scrollbar-top
property? Otherwise please tell me what you need in browser-ui-test
and I'll add it.
Otherwise, this PR looks good to me minus the missing test. :)
Thanks a lot for this improvement!
r=me once CI pass then. :)
@bors r=GuillaumeGomez rollup
📌 Commit 801ac0e has been approved by GuillaumeGomez
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
bors added a commit to rust-lang-ci/rust that referenced this pull request
…askrgr
Rollup of 17 pull requests
Successful merges:
- rust-lang#91032 (Introduce drop range tracking to generator interior analysis)
- rust-lang#92856 (Exclude "test" from doc_auto_cfg)
- rust-lang#92860 (Fix errors on blanket impls by ignoring the children of generated impls)
- rust-lang#93038 (Fix star handling in block doc comments)
- rust-lang#93061 (Only suggest adding
!
to expressions that can be macro invocation) - rust-lang#93067 (rustdoc mobile: fix scroll offset when jumping to internal id)
- rust-lang#93086 (Add tests to ensure that
let_chains
works withif_let_guard
) - rust-lang#93087 (Fix src/test/run-make/raw-dylib-alt-calling-convention)
- rust-lang#93091 (⬆ chalk to 0.76.0)
- rust-lang#93094 (src/test/rustdoc-json: Check for
struct_field
s invariant_tuple_struct.rs
) - rust-lang#93098 (Show a more informative panic message when
DefPathHash
does not exist) - rust-lang#93099 (rustdoc: auto create output directory when "--output-format json")
- rust-lang#93102 (Pretty printer algorithm revamp step 3)
- rust-lang#93104 (Support --bless for pp-exact pretty printer tests)
- rust-lang#93114 (update comment for
ensure_monomorphic_enough
) - rust-lang#93128 (Add script to prevent point releases with same number as existing ones)
- rust-lang#93136 (Backport the 1.58.1 release notes to master)
Failed merges:
r? @ghost
@rustbot
modify labels: rollup
Labels
Area: Rustdoc UI (generated HTML)
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the rustdoc team, which will review and decide on the PR/issue.