Bug 153504

Summary: Settings a reflected DOMString attribute to null should set it to the "null" string rather than the empty string
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 153519    
Bug Blocks:    
Attachments:
Description Flags
WIP Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2016-01-26 13:00:48 PST
Settings a reflected DOMString attribute to null should set it to the "null" string rather than the empty string:
- https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
- http://heycam.github.io/webidl/#es-DOMString
- http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring

Firefox and Chrome match the specification here.

This is causing a lot of W3C HTML reflection tests to fail on WebKit, e.g.:
http://w3c-test.org/html/dom/reflection-text.html
Comment 1 Radar WebKit Bug Importer 2016-01-26 13:02:12 PST
<rdar://problem/24353072>
Comment 2 Chris Dumez 2016-01-26 15:48:30 PST
Created attachment 269939 [details]
WIP Patch
Comment 3 Chris Dumez 2016-01-26 19:11:31 PST
Created attachment 269974 [details]
Patch
Comment 4 Chris Dumez 2016-01-27 10:37:23 PST
Created attachment 270006 [details]
Patch
Comment 5 Ryosuke Niwa 2016-01-27 11:06:28 PST
Comment on attachment 270006 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=270006&action=review

> LayoutTests/fast/shadow-dom/HTMLSlotElement-interface.html:105
>      slotElement.name = null;

This should be slotElement.removeAttribute('name') instead.

> LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html:80
>      slot.name = null;

Ditto.
Comment 6 Chris Dumez 2016-01-27 14:18:47 PST
Created attachment 270038 [details]
Patch
Comment 7 WebKit Commit Bot 2016-01-27 14:20:39 PST
Comment on attachment 270038 [details]
Patch

Rejecting attachment 270038 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 270038, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
atching file LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html
Hunk #1 succeeded at 82 with fuzz 2 (offset 5 lines).
patching file LayoutTests/fast/shadow-dom/shadow-layout-after-slot-changes.html
patching file LayoutTests/svg/dom/svg-element-attribute-js-null-expected.txt
patching file LayoutTests/svg/dom/svg-element-attribute-js-null.xhtml

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/747095
Comment 8 Chris Dumez 2016-01-27 14:23:46 PST
Created attachment 270039 [details]
Patch
Comment 9 Chris Dumez 2016-01-27 14:44:26 PST
Created attachment 270045 [details]
Patch
Comment 10 Chris Dumez 2016-01-27 14:46:54 PST
Created attachment 270046 [details]
Patch
Comment 11 Chris Dumez 2016-01-27 15:42:53 PST
Comment on attachment 270046 [details]
Patch

Clearing flags on attachment: 270046

Committed r195700: <http://trac.webkit.org/changeset/195700>
Comment 12 Chris Dumez 2016-01-27 15:42:59 PST
All reviewed patches have been landed.  Closing bug.