<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Improve support for nullable DOMString attributes / parameters"
href="https://bugs.webkit.org/show_bug.cgi?id=154656">154656</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Improve support for nullable DOMString attributes / parameters
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>WebKit Nightly Build
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>URL</th>
<td>http://heycam.github.io/webidl/#idl-nullable-type
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>Bindings
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>cdumez@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>darin@apple.com, sam@webkit.org
</td>
</tr></table>
<p>
<div>
<pre>Improve support for nullable DOMString attributes / parameters and use them when possible to match specifications:
<a href="http://heycam.github.io/webidl/#idl-nullable-type">http://heycam.github.io/webidl/#idl-nullable-type</a>
Once we support and use properly nullable DOMString attributes / parameters, we should be able to get rid of [TreatUndefined=NullString] WebKit IDL attribute.
Also, [TreatNullAs=NullString] should then only be used in cases where the specification has [TreatNullAs=EmptyString] (see <a class="bz_bug_link
bz_status_NEW "
title="NEW - [TreatNullAs=NullString] should be renamed to [TreatNullAs=EmptyString] to match Web IDL"
href="show_bug.cgi?id=154654">Bug 154654</a>).
* Currently, to emulate nullable DOMString parameters, WebKit uses:
void method([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString parameter)
or worse:
void method([TreatNullAs=NullString] DOMString parameter) // Wrong behavior for undefined.
When it should simply be:
void method(DOMString? parameter)
* And to emulate nullable DOMString attributes, WebKit uses:
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString, TreatUndefinedAs=NullString] attribute DOMString myAttr;
or worse:
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString myAttr; // Wrong behavior for undefined.
when it should simply be:
attribute DOMString? myAttr;
--
Note that the change should not be that hard because our bindings generator is already able to generate the right code for these nullable attributes / parameters, although via the use of WebKit-specific IDL attributes. Also, I believe I already added support for nullable attributes recently:
attribute DOMString? myAttr;
should already work and be equivalent to
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString, TreatUndefinedAs=NullString] attribute DOMString myAttr;
I am not sure what's our support for nullable DOMString parameters at the moment but I seem to remember messing with that code as well a while back.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>