[Bug 23529] Behavior of CSS.escape(undefined)

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23529

Simon Pieters <simonp@opera.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #1 from Simon Pieters <simonp@opera.com> ---
I had misunderstood WebIDL. The current behavior is as follows:

CSS.escape() throws TypeError.
CSS.escape(undefined) returns "undefined"

This is consistent with other DOM methods like e.g. document.getElementById.
However, it's inconsistent with JS functions like encodeURIComponent which
makes omitted argument also return "undefined".

The pro-throwing argument is mainly that it's easier to debug an error like

   CSS.escape(someobject.propertyThatDoesntExist)

However, no other method that takes a DOMString seems to throw for that case.

I think this settles that CSS.escape(undefined) should return "undefined".

What to do for CSS.escape() without argument is less clear (be consistent with
encodeURIComponent or with document.getElementById). But also seems less
important. Let's stick with WebIDL's default for that case.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 16 October 2013 10:56:09 UTC