CSSStyleRule.selectorText contains unquoted colons. Recreating rules with colons leads to broken syntax. Steps to reproduce: # Open `about:blank` # Run the following piece of code, the red box is not shown in Safari. const styleElement = document.createElement('style') styleElement.innerHTML = ` [a\\:b], .red { background-color: red; width: 100px; height: 100px; } ` const divElement = document.createElement('div') divElement.className = 'red' document.body.append(styleElement, divElement) console.log(styleElement.sheet.cssRules[0].selectorText + " should be [a\\:b], .red") styleElement.innerHTML = styleElement.sheet.cssRules[0].cssText
<rdar://problem/106330426>
Thanks for taking the time to report this; I recently fixed this. *** This bug has been marked as a duplicate of bug 184604 ***