Steps to reproduce: // Note, assumes a style tag exists const style = document.querySelector('style')[0]; style.sheet.insertRule('.test { content: "moo"; }'); // this is incorrect, missing quotes around _moo_ style.sheet.rules[0].cssText === ".test { content: moo; }"; style.sheet.insertRule(style.sheet.rules[0].cssText); // this is actually correct because the cssText string above is invalid style.sheet.rules[0].cssText === ".re-test { }";
^ last link in the reproduction was incorrect. should be as follows: // this is actually correct because the cssText string above is invalid style.sheet.rules[0].cssText === ".test { }";
<rdar://problem/51488597>
*** This bug has been marked as a duplicate of bug 118045 ***