Bug 149184

Summary: Document.createElement(localName) does not handle correctly missing or null parameter
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, buildbot, commit-queue, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
URL: https://dom.spec.whatwg.org/#interface-document
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews101 for mac-mavericks
none
Archive of layout-test-results from ews106 for mac-mavericks-wk2
none
Patch none

Description Chris Dumez 2015-09-15 14:48:18 PDT
Document.createElement(localName) does not handle correct missing or null parameter:
https://dom.spec.whatwg.org/#interface-document

As per the specification, the parameter is a non-nullable DOMString and is mandatory. Therefore, as per Web IDL, we should have the following behavior:
1. If the parameter is missing, we should throw an exception
2. If the parameter is null, we should convert it to the "null" string and create a <null> element.

Chrome and Firefox behave according to the specification. However, WebKit does:
1. Create a <undefined> element
2. Throw an exception
Comment 1 Chris Dumez 2015-09-15 14:49:08 PDT
rdar://problem/22550255
Comment 2 Chris Dumez 2015-09-15 15:13:23 PDT
Created attachment 261245 [details]
Patch
Comment 3 Build Bot 2015-09-15 15:49:12 PDT
Comment on attachment 261245 [details]
Patch

Attachment 261245 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/174558

New failing tests:
svg/dom/vkern-element-crash.html
fast/dom/node-iterator-reference-node-moved-crash.html
Comment 4 Build Bot 2015-09-15 15:49:14 PDT
Created attachment 261252 [details]
Archive of layout-test-results from ews101 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 5 Build Bot 2015-09-15 15:49:14 PDT
Created attachment 261253 [details]
Archive of layout-test-results from ews106 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 6 Chris Dumez 2015-09-15 18:52:18 PDT
Created attachment 261279 [details]
Patch
Comment 7 WebKit Commit Bot 2015-09-15 20:37:10 PDT
Comment on attachment 261279 [details]
Patch

Clearing flags on attachment: 261279

Committed r189842: <http://trac.webkit.org/changeset/189842>
Comment 8 WebKit Commit Bot 2015-09-15 20:37:15 PDT
All reviewed patches have been landed.  Closing bug.