jss icon indicating copy to clipboard operation
jss copied to clipboard

selectorText is case-sensitive

Open 4poc opened this issue 13 years ago • 2 comments

First thanks for that lib! I had a problem jss not working at all, this was the problem: // Browsers report selectors in lowercase if (selector) selector = selector.toLowerCase();

"Browsers report selectors in lowercase", Are you sure that is true? I tested Opera, Firefox and Chromium it doesn't looks like it.

4poc avatar Aug 14 '12 18:08 4poc

I can confirm this is the case (Chrome 22).

blq avatar Nov 02 '12 11:11 blq

selectorText also strips redundant whitespace (eg returns), which causes a similar silent failure because JSS creates the rule and then iterates through the output stylesheet looking for a match with the raw input before assigning properties.

I see the wisdom of relying on native CSSOM for a lot of the crucial work, but when nuts & bolts methods break because their own internals are erroneous, it becomes a problem.

I think this could be forked such that the internal methods checked to cache the output selector they had created and match against that… It would also avoid later iteration, I think.

barneycarroll avatar Nov 06 '12 18:11 barneycarroll