webcomponents/shadycss

CSS @Import directive with semicolon breaks when using apply shim

Closed this issue · 1 comments

Originally reported as Polymer/polymer#4629.

Putting aside the fact that shadycss does not shim styles in @import'ed stylesheets, it appears that the apply shim parsing results in @import statements to be removed altogether if the @import statement ends in a semicolon. This is unexpected and appears to be an apply shim parsing bug.

To reproduce, open http://plnkr.co/edit/8S85VShD4KGldF7h4phW?p=preview in Chrome, and note that the 2nd element's style breaks when apply-shim.html is loaded.

It would say that the removal of @import rules is intentional, because not supported. A valid @import rule must end with a semicolon. The shim matches valid import rules. When you omit the semicolon, the import slips through removal, but is syntactically invalid, with unpredictable results.