[Webkit-unassigned] [Bug 14835] New: createElement(x) v. createElementNS(null, x) v. createElementNS(undefined, x)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 31 13:04:22 PDT 2007


http://bugs.webkit.org/show_bug.cgi?id=14835

           Summary: createElement(x) v. createElementNS(null,x) v.
                    createElementNS(undefined,x)
           Product: WebKit
           Version: 522+ (nightly)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: XML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jcostell at tibco.com


The behavior of createElement and createElementNS is confusing. 

1. createElement() creates elements with the xml namespace
"http://www.w3.org/1999/xhtml" even though neither IE or Fx has that behavior.  
2. createElementNS() behaves differently if the first argument is null or
undefined. I think there is an incorrect string conversion occurring in the
underlying code. 

Consider the following examples:

$ var d = window.document.implementation.createDocument("", "", null);
$ d.appendChild(d.createElement("foo"));
$ (new XMLSerializer()).serializeToString(d);
= <foo xmlns="http://www.w3.org/1999/xhtml"></foo>
$ (new XMLSerializer()).serializeToString(e.evaluate("//foo",
d.documentElement, null, null, null).iterateNext());
= 

$ var d = window.document.implementation.createDocument("", "", null);
$ d.appendChild(d.createElementNS(null, "foo"));
$ (new XMLSerializer()).serializeToString(d);
= <foo/>
$ (new XMLSerializer()).serializeToString(e.evaluate("//foo",
d.documentElement, null, null, null).iterateNext());
= <foo/>

$ var d = window.document.implementation.createDocument("", "", null);
$ d.appendChild(d.createElementNS(window.undef, "foo"));
$ (new XMLSerializer()).serializeToString(d);
= <foo xmlns="undefined"/>
$ (new XMLSerializer()).serializeToString(e.evaluate("//foo",
d.documentElement, null, null, null).iterateNext());
=


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list