webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.14k stars 165 forks source link

[ShadyCSS] Incorrect parsing of string literals with colons in them leads to FUBAR rules #41

Open n1ywb opened 7 years ago

n1ywb commented 7 years ago

When writing an attribute selector with a string literal with a colon in it, shadycss puts the scoped-style rules INSIDE THE STRING LITERAL right after the colon. e.g.

iron-icon[icon="emerson-icons:onhold"]

should get rewritten as

iron-icon[icon="emerson-icons:onhold"]:not([style-scope]):not(.style-scope)

but instead becomes

iron-icon[icon="emerson-icons:not([style-scope]):not(.style-scope):onhold"]

I was able to work around the issue by using the CSS character code for the colon char

iron-icon[icon="emerson-icons\003Aonhold"]

is rewritten as

iron-icon[icon="emerson-icons\003Aonhold"]:not([style-scope]):not(.style-scope)

I tried to write a test for this but the tests seem to be broken, see my other ticket https://github.com/webcomponents/shadycss/issues/118

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.