Only copy visible content in clipboard in source code pages#158137
Conversation
|
Some changes occurred in HTML/CSS/JS. |
This comment has been minimized.
This comment has been minimized.
642c60a to
c664cc8
Compare
This comment has been minimized.
This comment has been minimized.
c664cc8 to
ef8c9ed
Compare
I'm very surprised you couldn't reproduce it, Ralf and I were able to reproduce it just a few months ago. Ralf even commented on the Firefox issue. But indeed, seems like the bug is fixed, for some reproduction at least. I will check if I can still reproduce on our GHA Logs viewer, where we have had a similar workaround. |
The bug still reproduce on triagebot. Although now that I look more at it, it might not be the same. Details |
|
Dark magic. |
|
I take it back, I wasn't testing the right thing. I (locally) removed the workaround on the timestamps ( |
|
Dark magic intensifies. |
|
Alright, I just spend a bunch of time on BrowserStack Live feature testing various configurations (old docs, 1.90 and this PR) with different versions... The bottom line is that the both issues from Firefox and Chrome do not reproduce anymore on the latest version (Firefox 151 and Chrome 149). The Chrome issue seems to have been fixed in Chrome 144, while the Firefox issue seems to have been fixed before Firefox 140. As for the issue reported here, I can also confirm it is fixed by this PR. I created a gist with the tests I did. |
|
@bors r+ rollup |
Only copy visible content in clipboard in source code pages You can see this bug but enabling the `--generate-macro-expansion` rustdoc option. When selecting text which contains a macro expansion, it'll copy all the code, both displayed and hidden. To reproduce it, take a look [here](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/hir/mod.rs.html#26-27). This PR fixes it. I'm currently adding the missing bits in `browser-ui-test` to be able to add a GUI regression test for it (selecting text and doing "ctrl-c"). The code I removed was added to fix both #146816 and #142354. However, I couldn't reproduce the bug in firefox 152 and in chromium 149. So instead of trying to handle more corner-cases, it's better to just remove the whole code. :) r? @Urgau
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #158164. |
…=Urgau Only copy visible content in clipboard in source code pages You can see this bug but enabling the `--generate-macro-expansion` rustdoc option. When selecting text which contains a macro expansion, it'll copy all the code, both displayed and hidden. To reproduce it, take a look [here](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/hir/mod.rs.html#26-27). This PR fixes it. I'm currently adding the missing bits in `browser-ui-test` to be able to add a GUI regression test for it (selecting text and doing "ctrl-c"). The code I removed was added to fix both rust-lang#146816 and rust-lang#142354. However, I couldn't reproduce the bug in firefox 152 and in chromium 149. So instead of trying to handle more corner-cases, it's better to just remove the whole code. :) r? @Urgau
Rollup merge of #158137 - GuillaumeGomez:copy-source-code, r=Urgau Only copy visible content in clipboard in source code pages You can see this bug but enabling the `--generate-macro-expansion` rustdoc option. When selecting text which contains a macro expansion, it'll copy all the code, both displayed and hidden. To reproduce it, take a look [here](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/hir/mod.rs.html#26-27). This PR fixes it. I'm currently adding the missing bits in `browser-ui-test` to be able to add a GUI regression test for it (selecting text and doing "ctrl-c"). The code I removed was added to fix both #146816 and #142354. However, I couldn't reproduce the bug in firefox 152 and in chromium 149. So instead of trying to handle more corner-cases, it's better to just remove the whole code. :) r? @Urgau
…uwer Rollup of 3 pull requests Successful merges: - rust-lang/rust#158137 (Only copy visible content in clipboard in source code pages) - rust-lang/rust#158141 ([AArch64] FEAT_SVE implies FEAT_FP16) - rust-lang/rust#158177 (rustc-dev-guide subtree update)
You can see this bug but enabling the
--generate-macro-expansionrustdoc option. When selecting text which contains a macro expansion, it'll copy all the code, both displayed and hidden. To reproduce it, take a look here.This PR fixes it.
I'm currently adding the missing bits in
browser-ui-testto be able to add a GUI regression test for it (selecting text and doing "ctrl-c").The code I removed was added to fix both #146816 and #142354. However, I couldn't reproduce the bug in firefox 152 and in chromium 149. So instead of trying to handle more corner-cases, it's better to just remove the whole code. :)
r? @Urgau