Re: [csswg-drafts] [css-syntax] Consider disallowing NULL code points in stylesheets

> Gecko does not replace with a replacement character in custom idents, it seems.

This is a bug, and specific to custom properties. I’ve filed https://bugzilla.mozilla.org/show_bug.cgi?id=1471772, thanks for mentioning it. Modified test case:

```html
<div id="a"></div>
<div id="b"></div>

<script>
var css = document.createElement("style");
css.innerHTML = '* { --a: hello\0world; }';
document.body.appendChild(css);

a.innerHTML = JSON.stringify(css.sheet.cssRules[0].style.getPropertyValue("--a"));
b.innerHTML = JSON.stringify(getComputedStyle(document.body).getPropertyValue('--a'));
</script>
```

Which in Firefox 61 produces:
```
" hello\u0000world"
" hello"
```

-- 
GitHub Notification of comment by SimonSapin
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2757#issuecomment-400873623 using your GitHub account

Received on Thursday, 28 June 2018 00:36:40 UTC