-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Adjust CSS styles degrading performance in Chromium browsers #13159
Adjust CSS styles degrading performance in Chromium browsers #13159
Conversation
This test case is expected to fail as of this commit with: ``` Detected CSS selectors that might cause performance issues in Chromium [ '.jp-icon-hoverShow:not(:hover) svg', '.jp-CodeMirrorEditor .remote-caret:hover > div', '.jp-RunningSessions-shutdownAll.jp-mod-styled:hover > span', '.jp-RunningSessions-shutdownAll.jp-mod-styled.jp-mod-disabled:hover > span', '.f437k8z:hover div', '.MathJax_Hover_Arrow:hover span', '.MathJax_MenuClose:hover span' ] ```
Thanks for making a pull request to jupyterlab! |
also removing the unscoped tag (`div`) after pseudo-class selector in order to improve performance in Chromium browsers.
performance problems in Chromium browsers.
rather than `svg` tag which was causing performance issues in Chrome
instead of generic `div` selector for shortcut title to workaround Chromium performance issues.
please run benchmark |
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.
Thanks @krassowski
I left an optional comment. But happy to merge as is.
Co-authored-by: Frédéric Collonval <[email protected]>
Merging to cut a final patch release for 3.4.x (with this and #13161) and start 3.5 |
@meeseeksdev please backport to 3.4.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
The backport will need to be manual commit-by-commit (e.g. there is no |
Thanks @krassowski |
…rmance in Chromium browsers) (#13175) * Add test case detecting CSS rules degrading performance in Chromium This test case is expected to fail as of this commit with: ``` Detected CSS selectors that might cause performance issues in Chromium [ '.jp-icon-hoverShow:not(:hover) svg', '.jp-CodeMirrorEditor .remote-caret:hover > div', '.jp-RunningSessions-shutdownAll.jp-mod-styled:hover > span', '.jp-RunningSessions-shutdownAll.jp-mod-styled.jp-mod-disabled:hover > span', '.f437k8z:hover div', '.MathJax_Hover_Arrow:hover span', '.MathJax_MenuClose:hover span' ] ``` (cherry picked from commit 9356447) * Use `.jp-icon-hoverShow-content` to denote the icon to hide rather than `svg` tag which was causing performance issues in Chrome (cherry picked from commit baad021) * Use class `.jp-ShortcutTitleItem-sortButton` selector instead of generic `div` selector for shortcut title to workaround Chromium performance issues. (cherry picked from commit ddc0854) * Disable MathJax styles deteriorating performance in Chromium browsers (cherry picked from commit 286fd04) * Limit the impact of `.remote-caret:hover div` on performance in Chromium browsers by increasing specificity of the `div` part. * Ignore problematic Blueprint CSS styles on 3.4.x * Fix incorrect expect in the styles test
I just wanted to thank @krassowski for this - tracking down the details of this issue was a ton of work, and it's hugely, hugely appreciated!! These performance issues have lingered for a long time and can be quite frustrating when they happen, so I'm sure I speak for many with my gratitude :) Keep up the awesome work!! |
References
Fixes #9757 and fixes #13160.
Code changes
Follow-up tasks:
How to test
gh-9757-reproducer.ipynb
Recalculate Style
event durationUser-facing changes
:hover
actions should no longer be sluggish when many<div>
,<span>
or<svg>
nodes are present.jp-icon-hoverShow
now requires the icon inside of the container to be marked withjp-icon-hoverShow-content
class. Note that in JupyterLab codebase this is only used by the command palette headers to show the filter icon on hover, and these headers (.lm-CommandPalette-header
) are hidden in the modal palette.Backwards-incompatible changes
jp-icon-hoverShow-content
requirement