WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
22265
Inconsistent handling of empty versus nil NSStrings for namespaceURI
https://bugs.webkit.org/show_bug.cgi?id=22265
Summary
Inconsistent handling of empty versus nil NSStrings for namespaceURI
Kai Brüning
Reported
2008-11-14 08:46:35 PST
-[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.
Attachments
Add attachment
proposed patch, testcase, etc.
Mark Rowe (bdash)
Comment 1
2008-11-14 15:58:53 PST
<
rdar://problem/6373807
>
Ahmad Saleem
Comment 2
2022-07-21 16:27:30 PDT
I think WPT has coverage for these cases:
https://wpt.fyi/results/dom/nodes/Node-lookupNamespaceURI.html?label=master&label=experimental&aligned&q=namespaceURI
and Safari 15.6 passes all test here. If I am understanding it wrong, please ignore my comment. Otherwise, if needed, please can this bug be marked as "RESOVLED WONTFIX" or "RESOLVED CONFIGURATION CHANGED". Thanks!
Alexey Proskuryakov
Comment 3
2022-07-22 11:06:48 PDT
This bug is about Objective-C API, which WPT doesn't test. At this point, this API is deprecated, and we don't intend to keep improving it. Please use the modern WebKit API.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug