Bug 149184 - Document.createElement(localName) does not handle correctly missing or null parameter
Summary: Document.createElement(localName) does not handle correctly missing or null p...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://dom.spec.whatwg.org/#interfac...
Keywords: InRadar, WebExposed
Depends on:
Blocks:
 
Reported: 2015-09-15 14:48 PDT by Chris Dumez
Modified: 2015-09-15 20:37 PDT (History)
5 users (show)

See Also:


Attachments
Patch (14.49 KB, patch)
2015-09-15 15:13 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-mavericks (674.79 KB, application/zip)
2015-09-15 15:49 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews106 for mac-mavericks-wk2 (1.02 MB, application/zip)
2015-09-15 15:49 PDT, Build Bot
no flags Details
Patch (16.34 KB, patch)
2015-09-15 18:52 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.