[Webkit-unassigned] [Bug 6648] Safari strips-off namespace when using getAttribute()

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Mon Feb 6 05:35:10 PST 2006


------- Comment #11 from boris at backbase.com  2006-02-06 05:35 PDT -------
Yes, thay all behave simmilar, but in the implementation setAttributeNS there
is call to parseQualifiedName, which is fine when the call comes directly from
setAttributeNS DOM dunction, but is not OK when it comes from setAttribute DOM
function. get/has/removeAttributeNS differ in that.

Maybe you didn't understand it because there are few overloaded setAtrribute
methods of ElementImpl.
Try to follow execution flow for the setAttribute('bb:dddd', 'whatever'); DOM

1. ElementImpl::setAttribute(const DOMString &name, const DOMString &value, int
&exception) is called with parametar name that virtualy equals to "bb:dddd"
2. ElementImpl::setAttributeNS(const DOMString &namespaceURI, const DOMString
&qualifiedName, const DOMString &value, int &exception) is called with
namespaceURI that virtualy equals to empty string and qualifiedName (which is
here of type DOMString!) "bb:dddd"
2.a) within the body of method setAttributeNS, method
DocumentImpl::parseQualifiedName is called, and this is the place where things
go wrong. "bb:dddd" is split into prefix "bb" and localName "dddd". According
to DOM specification that shouldn't happen, string should be treated just as it
is full name (colomn is not considered separator, but just another character
that is part of the localName). Implemetation of setAttribute DOM function in
other browsers confirm this.
2.b) void ElementImpl::setAttribute(const QualifiedName& name, const DOMString
&value) is called with name.prefix = "bb" name.localName = "dddd"...

I am attaching nice test case that you can run in different browsers and see
results of their implementation of get/set/has/removeAttribute and

Btw, I tried to include ChangeLog and the layout test case in the patch, but
svn-create-patch script from WebKitTools/Scripts didn't include layout test. I
guess because files are new and not yet in svn. Any further suggestion?

Configure bugmail: http://bugzilla.opendarwin.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