-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Fix trait method anchor disappearing before user can click on it #150816
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
Conversation
|
Some changes occurred in HTML/CSS/JS. |
This comment has been minimized.
This comment has been minimized.
tests/rustdoc-gui/anchors.goml
Outdated
| // Now we move the cursor to the anchor to check there is no gap between the method and the | ||
| // anchor, making the anchor disappear and preventing users to click on it. | ||
| move-cursor-to: "#method\.vroum .anchor" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this cursor move accomplished instantaneously, or does it move realistically in a gradual way? Ideally we'd make sure that even if it's done slowly, the anchor doesn't disappear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instantly. But moving at a given speed could be interesting. Gonna need to add this option in browser-ui-test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the instantaneous move is why we haven't been able to successfully test this before? Could you check if this new test fails without your CSS fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum yeah it still passes. Not fun... :-/
72cc903 to
a50ad76
Compare
a50ad76 to
16fbf6a
Compare
|
Found a way! I instead move the cursor just a bit left to the method. Failed without the fix, works with it. So all good. =D I added a comment explaining that too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
|
@bors r+ rollup |
Fix trait method anchor disappearing before user can click on it A good example of this bug is going to https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/collect/struct.ItemCtxt.html#impl-HirTyLowerer%3C'tcx%3E-for-ItemCtxt%3C'tcx%3E, and then try to click on the `§` anchor of the `tcx` method. The solution to this bug is to simply "glue" the anchor to the method, so when the mouse cursor moves to it, there is no gap between the two, preventing the anchor to disappear (hopefully this explanation doesn't make sense only to me ^^'). First commit fixes the bug by expanding the anchor size. Second commit is a small clean-up of the GUI test. Third commit actually adds the GUI regression test. cc @BoxyUwU r? @camelid
Fix trait method anchor disappearing before user can click on it A good example of this bug is going to https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/collect/struct.ItemCtxt.html#impl-HirTyLowerer%3C'tcx%3E-for-ItemCtxt%3C'tcx%3E, and then try to click on the `§` anchor of the `tcx` method. The solution to this bug is to simply "glue" the anchor to the method, so when the mouse cursor moves to it, there is no gap between the two, preventing the anchor to disappear (hopefully this explanation doesn't make sense only to me ^^'). First commit fixes the bug by expanding the anchor size. Second commit is a small clean-up of the GUI test. Third commit actually adds the GUI regression test. cc @BoxyUwU r? @camelid
Fix trait method anchor disappearing before user can click on it A good example of this bug is going to https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/collect/struct.ItemCtxt.html#impl-HirTyLowerer%3C'tcx%3E-for-ItemCtxt%3C'tcx%3E, and then try to click on the `§` anchor of the `tcx` method. The solution to this bug is to simply "glue" the anchor to the method, so when the mouse cursor moves to it, there is no gap between the two, preventing the anchor to disappear (hopefully this explanation doesn't make sense only to me ^^'). First commit fixes the bug by expanding the anchor size. Second commit is a small clean-up of the GUI test. Third commit actually adds the GUI regression test. cc @BoxyUwU r? @camelid
Rollup of 11 pull requests Successful merges: - #150272 (docs(core): update `find()` and `rfind()` examples) - #150385 (fix `Expr::can_have_side_effects` for `[x; N]` style array literal and binary expressions) - #150561 (Finish transition from `semitransparent` to `semiopaque` for `rustc_macro_transparency`) - #150574 (Clarify `MoveData::init_loc_map`.) - #150762 (Use functions more in rustdoc GUI tests) - #150808 (rename the `derive_{eq, clone_copy}` features to `*_internals`) - #150816 (Fix trait method anchor disappearing before user can click on it) - #150821 (tests/ui/borrowck/issue-92157.rs: Remove (bug not fixed)) - #150829 (make attrs actually use `Target::GenericParam`) - #150834 (Add tracking issue for `feature(multiple_supertrait_upcastable)`) - #150864 (The aarch64-unknown-none target requires NEON, so the docs were wrong.) r? @ghost
Rollup merge of #150816 - method-anchor, r=camelid Fix trait method anchor disappearing before user can click on it A good example of this bug is going to https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/collect/struct.ItemCtxt.html#impl-HirTyLowerer%3C'tcx%3E-for-ItemCtxt%3C'tcx%3E, and then try to click on the `§` anchor of the `tcx` method. The solution to this bug is to simply "glue" the anchor to the method, so when the mouse cursor moves to it, there is no gap between the two, preventing the anchor to disappear (hopefully this explanation doesn't make sense only to me ^^'). First commit fixes the bug by expanding the anchor size. Second commit is a small clean-up of the GUI test. Third commit actually adds the GUI regression test. cc @BoxyUwU r? @camelid
Rollup of 11 pull requests Successful merges: - rust-lang/rust#150272 (docs(core): update `find()` and `rfind()` examples) - rust-lang/rust#150385 (fix `Expr::can_have_side_effects` for `[x; N]` style array literal and binary expressions) - rust-lang/rust#150561 (Finish transition from `semitransparent` to `semiopaque` for `rustc_macro_transparency`) - rust-lang/rust#150574 (Clarify `MoveData::init_loc_map`.) - rust-lang/rust#150762 (Use functions more in rustdoc GUI tests) - rust-lang/rust#150808 (rename the `derive_{eq, clone_copy}` features to `*_internals`) - rust-lang/rust#150816 (Fix trait method anchor disappearing before user can click on it) - rust-lang/rust#150821 (tests/ui/borrowck/issue-92157.rs: Remove (bug not fixed)) - rust-lang/rust#150829 (make attrs actually use `Target::GenericParam`) - rust-lang/rust#150834 (Add tracking issue for `feature(multiple_supertrait_upcastable)`) - rust-lang/rust#150864 (The aarch64-unknown-none target requires NEON, so the docs were wrong.) r? @ghost
A good example of this bug is going to https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/collect/struct.ItemCtxt.html#impl-HirTyLowerer%3C'tcx%3E-for-ItemCtxt%3C'tcx%3E, and then try to click on the
§anchor of thetcxmethod.The solution to this bug is to simply "glue" the anchor to the method, so when the mouse cursor moves to it, there is no gap between the two, preventing the anchor to disappear (hopefully this explanation doesn't make sense only to me ^^').
First commit fixes the bug by expanding the anchor size.
Second commit is a small clean-up of the GUI test.
Third commit actually adds the GUI regression test.
cc @BoxyUwU
r? @camelid