W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2018

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

From: Simon Sapin via GitHub <sysbot+gh@w3.org>
Date: Thu, 28 Jun 2018 00:36:37 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-400873623-1530146196-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.3.1 : Wednesday, 9 October 2019 08:16:45 UTC