Skip to content
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

Reduce table-input CPU usage thanks to :has selector #6088

Merged
merged 4 commits into from
Oct 26, 2022
Merged

Conversation

fregante
Copy link
Member

@fregante fregante commented Oct 16, 2022

mouseenter events are triggered hundreds of times just by moving the mouse across the page, whether you’re using table-input or not; delegate will call querySelector in each event to determine whether to call our callback on the specific events we want.

Thankfully :has again comes to the rescue, even though the code is awful. I implemented this in a way to preserve backwards compatibility.

Test URLs

This page

Screenshot

gif

@@ -6,18 +6,33 @@
grid-template: repeat(5, 20px) / repeat(5, 20px);
}

:root .rgh-table-input-cell {
.rgh-table-input .sentinel { /* 🤷‍♂️ */
display: none;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did they add this element literally just now while I was writing this PR? I think this effectively forces me to push another release soon because the feature looks wonky 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They dropped it. What a coincidence.

@fregante fregante marked this pull request as ready for review October 26, 2022 07:35
@fregante
Copy link
Member Author

Feature verified both in Chrome and Firefox

@fregante fregante merged commit aaed2c3 into main Oct 26, 2022
@fregante fregante deleted the has-all-the-rage branch October 26, 2022 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant