Keep prefix attribute selectors while shimming (#525)

ShadowCSS converts all prefix attribute selectors `[attr^=value]` to exact selectors `[attr=value]`.

The bug was caused due to a bad regular expression which intended to remove `^`s. To maintain status quo but fix the issue, I have simply put in a negative look-ahead for `=`.
This commit is contained in:
Miki
2016-04-18 23:38:56 +05:30
committed by Daniel Freedman
parent 60845b53cf
commit 0aa8dee6d4

View File

@@ -586,7 +586,7 @@ var selectorRe = /([^{]*)({[\s\S]*?})/gim,
/\/shadow\//g, // former ::shadow
/\/shadow-deep\//g, // former /deep/
/\^\^/g, // former /shadow/
/\^/g // former /shadow-deep/
/\^(?!=)/g // former /shadow-deep/
];
function stylesToCssText(styles, preserveComments) {