Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

poor performance for * selector #8

Open
yairEO opened this issue Feb 24, 2014 · 3 comments
Open

poor performance for * selector #8

yairEO opened this issue Feb 24, 2014 · 3 comments

Comments

@yairEO
Copy link

yairEO commented Feb 24, 2014

in your JS code, you are using an event-delegation such as:

*[data-placeholder]

this is a serious mistake and should be avoid at all costs to use such a poor-performance selector and listen for a lot of events for the whole document..this is insanely expensive!

@CraigStuntz
Copy link
Contributor

On a contemporary browser, you can get by with no JavaScript whatsoever, using the :focused and :empty selectors in CSS. But I no longer work for Spruce, so I can't update it here. A good solution for new browsers is to use feature detection and pure CSS when supported, and to use ID selectors for specific elements in your page for old browsers.

@yairEO
Copy link
Author

yairEO commented Feb 24, 2014

I've tried it with CSS only and this fails to work. please show me a test page where it should work, and I will show you, how it breaks in a common situation.

@nathanpalmer
Copy link
Member

@CraigStuntz you actually have access to this repo now. For some reason I only partially updated it before.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants