[Webkit-unassigned] [Bug 22265] New: Inconsistent handling of empty versus nil NSStrings for namespaceURI

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 14 08:46:35 PST 2008


           Summary: Inconsistent handling of empty versus nil NSStrings for
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit API
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: kai at granus.net
                CC: kai at granus.net

-[DOMNode namespaceURI] returns an empty NSString (@"") for "no namespace".
But -[DOMNameNodeMap getNamedItemNS:localName:] does find an attribute without
namespace only if nil is passed for the namespaceURI.

The DOM3-Core specification states: "In programming languages where empty
strings can be differentiated from null, empty strings, when given as a
namespace URI, are converted to null. This is true even though the DOM does no
lexical checking of URIs." (1.3.3 XML Namespaces, page 27 in the pdf version).
Therefore it would probably be correct, if -[DOMNameNodeMap
getNamedItemNS:localName:] converts an empty namespaceURI string to nil before
performing the lookup.

Further, the same spec states about the namespaceURI property of interface
Node: "The namespace URI [p.207] of this node, or null if it is unspecified
(see XML  Namespaces [p.26] ). " (page 61 of the pdf version).
Therefore -[DOMNode namespaceURI] should probably return nil instead of @"" for
"no namespace".

Note: the C++ node actually has a NULL value for the namespaceURI string in
this case. The conversion to @"" happens deep in the conversion code from
WebCore string to NSString.

Configure bugmail: https://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