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

Ryosuke Niwa
Reported 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.
Attachments
Fixes the bug (4.30 KB, patch)
2015-09-02 17:57 PDT, Ryosuke Niwa
no flags
Ryosuke Niwa
Comment 1 2015-09-02 16:47:01 PDT
Chris Dumez
Comment 2 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.
Ryosuke Niwa
Comment 3 2015-09-02 17:57:19 PDT
Created attachment 260462 [details] Fixes the bug
WebKit Commit Bot
Comment 4 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>
WebKit Commit Bot
Comment 5 2015-09-02 19:51:17 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.