Bug 253041

Summary: CSSStyleRule.selectorText contains unquoted colon
Product: WebKit Reporter: vojacem
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: annevk, koivisto, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   

vojacem
Reported 2023-02-27 16:36:10 PST
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
Attachments
Radar WebKit Bug Importer
Comment 1 2023-03-06 16:37:16 PST
Anne van Kesteren
Comment 2 2023-08-26 00:15:58 PDT
Thanks for taking the time to report this; I recently fixed this. *** This bug has been marked as a duplicate of bug 184604 ***
Note You need to log in before you can comment on or make changes to this bug.