Bug 149238

Summary: Element's attribute NS API should treat defined undefined namespace as null
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch rniwa: review+

Description Chris Dumez 2015-09-16 16:40:07 PDT
Element's attribute NS API should defined undefined namespace as null instead of converting it to the "undefined" String. This is because the namespace parameter is a nullable String as per the DOM spec:
https://dom.spec.whatwg.org/#element

The attribute is nullable and WebIDL says undefined should be converted to null for nullable parameters:
https://heycam.github.io/webidl/#es-nullable-type (step 3)
Comment 1 Chris Dumez 2015-09-16 16:45:51 PDT
Created attachment 261338 [details]
Patch
Comment 2 Chris Dumez 2015-09-16 16:46:22 PDT
rdar://problem/22562204
Comment 3 Ryosuke Niwa 2015-09-16 18:23:02 PDT
Comment on attachment 261338 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        Element's attribute NS API should defined undefined namespace as null

should treat?
Comment 4 Chris Dumez 2015-09-16 18:25:12 PDT
Committed r189893: <http://trac.webkit.org/changeset/189893>