Bug 148729

Summary: Node.textContent = undefined should be equivalent to textContent = ""
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, darin, kling
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://heycam.github.io/webidl/#es-nullable-type
Attachments:
Description Flags
Fixes the bug none

Description Ryosuke Niwa 2015-09-02 16:45:38 PDT
http://w3c-test.org/dom/nodes/Node-textContent.html fails because we don't treat undefined as an empty string in textContent's setter.
Comment 1 Ryosuke Niwa 2015-09-02 16:47:01 PDT
<rdar://problem/22549558>
Comment 2 Chris Dumez 2015-09-02 16:49:55 PDT
As per https://heycam.github.io/webidl/#es-nullable-type, since the attribute is nullable, "if V is null or undefined, then return the IDL nullable type T? value null".

Our generated bindings missed the "or undefined" part. I believe there is even a FIXME comment about this in the bindings generator already.
Comment 3 Ryosuke Niwa 2015-09-02 17:57:19 PDT
Created attachment 260462 [details]
Fixes the bug
Comment 4 WebKit Commit Bot 2015-09-02 19:51:12 PDT
Comment on attachment 260462 [details]
Fixes the bug

Clearing flags on attachment: 260462

Committed r189269: <http://trac.webkit.org/changeset/189269>
Comment 5 WebKit Commit Bot 2015-09-02 19:51:17 PDT
All reviewed patches have been landed.  Closing bug.