WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
268742
cssText wrong escaping
https://bugs.webkit.org/show_bug.cgi?id=268742
Summary
cssText wrong escaping
Jozef
Reported
2024-02-05 06:09:38 PST
Run this code in safari and see that the cssText is wrongly escaped const style = document.createElement('style') document.body.append(style) style.sheet.insertRule(`h6 { background: url(/my-image.png), var(--my-image); }`) console.log(style.sheet.cssRules[0].cssText) Output: h6 { background: url(\/my-image\.png), var(--my-image); } Chrome and Firefox outputs: h6 { background: url(/my-image.png), var(--my-image); }
Attachments
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2024-02-05 07:57:44 PST
*** Safari Technology Preview 187 *** "h6 { background: url(\/my-image\.png), var(--my-image); }" *** Chrome Canary 123 *** "h6 { background: url(/my-image.png), var(--my-image); }" *** Firefox Nightly 124 *** "h6 { background: url(/my-image.png), var(--my-image); }" ___ Just wanted to share as of today result. I will share Minibrowesr (WebKit ToT) results later.
Ahmad Saleem
Comment 2
2024-02-05 09:20:14 PST
WebKit ToT (
274096@main
) same as STP187.
Sam Sneddon [:gsnedders]
Comment 3
2024-02-05 10:53:53 PST
I will note that both outputs are semantically equivalent; have you had this serialisation difference cause problems anywhere?
Sam Sneddon [:gsnedders]
Comment 4
2024-02-05 11:01:46 PST
See also
https://github.com/w3c/csswg-drafts/issues/9913
for the spec not matching any existing major browser.
Jozef
Comment 5
2024-02-12 03:31:32 PST
@Sam Sneddon, I don't believe it carries the same semantic meaning. There are actually two backslashes. The raw form is `h6 { background: url(\\/my-image\\.png), var(--my-image); }`. which is not equal to: `h6 { background: url(\/my-image\.png), var(--my-image); }` or `h6 { background: url(/my-image.png), var(--my-image); }`
Radar WebKit Bug Importer
Comment 6
2024-02-12 06:10:13 PST
<
rdar://problem/122796093
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug