CSS.escape is an API defined at http://dev.w3.org/csswg/cssom/#the-css.escape%28%29-method which allows web pages to create a valid CSS identifier that will parse to a given string. A typical use case is:

  document.querySelector('#' + CSS.escape(stringIDontControl))

Unless there are objections, I'm going to check this in without a preference, for Firefox 31. The spec for this is very straightforward and not likely to change, apart from the feature disappearing altogether or something. But I think this feature is pretty much necessary in some form, whether built into the platform or as a library, to safely use querySelector-like APIs with non-literal strings.

Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=955860

Please let me know if there are objections.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to