[Webkit-unassigned] [Bug 154654] [TreatNullAs=NullString] should be renamed to [TreatNullAs=EmptyString] to match Web IDL

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 25 09:03:28 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=154654

--- Comment #1 from Darin Adler <darin at apple.com> ---
This doesn’t sound exactly right. Null string and empty string are not the same thing in the WebKit C++ DOM implementation. A function can tell the difference between an empty string and a null using the isNull function. It may be true that in some, even many, DOM function implementations, they are both treated the same. But [TreatNullAs=NullString] could be used to implement a form of "nullable" argument whereas [TreatNullAs=EmptyString] is clearly only useful when we actually want to handle the argument as the empty string.

I think you may be saying that all the places we are currently using [TreatNullAs=NullString], we could use [TreatNullAs=EmptyString] instead, and that may well be true. But it requires examining the functions to be sure.

There’s also an open question of whether the bindings should pass a null or empty WTF::String in these cases. It would be safer to pass an empty string if we really don’t want any chance that the C++ function accidentally handles a null differently than the empty string.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160225/79176f55/attachment.html>


More information about the webkit-unassigned mailing list