Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Can you use multiple css selectors? #33

Closed
sonicpunk opened this issue Jun 23, 2015 · 4 comments
Closed

Can you use multiple css selectors? #33

sonicpunk opened this issue Jun 23, 2015 · 4 comments

Comments

@sonicpunk
Copy link

On my project watching all image tags just crashes IE. Is it possible to add multiple css selectors?

@anselmh
Copy link
Owner

anselmh commented Jun 23, 2015

Hey, the polyfill accepts all options of querySelectorAll() which means you can also chain CSS selectors in it, comma-separated.

Please be aware that the polyfill still needs to travel up the whole DOM to match parent styles on it as well which is a performance issue but lets it act properly. It might be the case that when you have a large CSS file and use this polyfill, IE might still crash, even when you limit the selectors.

@anselmh anselmh closed this as completed Jun 23, 2015
@anselmh
Copy link
Owner

anselmh commented Jun 23, 2015

Oh by the way, can you add your setup (IE version, MS version) and the size of your CSS just for the record, please?

@sonicpunk
Copy link
Author

Thanks for getting back to me. Our minified CSS is 201 KB, tested on Windows 8, IE11. Even with using the selectors, the performance is a no good.

@anselmh
Copy link
Owner

anselmh commented Jun 24, 2015

Yes, I assumed this already. 200kb of CSS is very heavy and it definitely is the reason that the browser hangs during the polyfills’ execution. Maybe you could go with SVG wrapper using the preserveAspectRatio trick which is at least similar to the object-fit behavior?
The polyfill won’t ever solve this performance problem as in that case it would lack much of the original behavior – making it useless as a "polyfill".

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

2 participants