Fix code-block linenumbers highlight on Safari #1489
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
When using Safari and highlighting text in a code block with line numbers, the line numbers are also included. Line numbers are not included with eg. Firefox.
How to reproduce
Open https://sphinx-rtd-theme.readthedocs.io/en/stable/demo/demo.html#emphasized-lines-with-line-numbers with Safari (I used v16.5.2) and highlight the code block.
![image](https://private-user-images.githubusercontent.com/60272147/254603887-ab5e17e2-88a7-4f34-a45c-d466892a7e04.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NzQyMDAsIm5iZiI6MTcyNTk3MzkwMCwicGF0aCI6Ii82MDI3MjE0Ny8yNTQ2MDM4ODctYWI1ZTE3ZTItODhhNy00ZjM0LWE0NWMtZDQ2Njg5MmE3ZTA0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDEzMTE0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM4N2U3OTJjZmUwNWI5NzkzNmM4ZTRmNmM2OGY5MWI2ODJlYzMyYjcyMGE1MTczNDhhMWY2ZGI1YmY2ZmEyMmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0jNHSnlhoj3v3VJFFgHvq9Jr1Krz4xyjL_KD_J_eNlk)
Expected behavior
Line numbers should not be included when highlighting.
What is done
-webkit-user-select: none
field. This is needed on Safari to disable highlighting. See https://developer.mozilla.org/en-US/docs/Web/CSS/user-select for details.