Re: xlink:href test case

On Apr 17, 2010, at 04:14 , Boris Zbarsky wrote:
> On 4/16/10 4:32 AM, Robin Berjon wrote:
>> I'm okay with the first, but the second is a problem because if the prefix is unbound the document cannot then be serialised to XML.
> 
> Why is this an issue?  It's trivial to construct DOMs using setAttributeNS that can't be serialized as XML without fixup.  Actual serializers in browsers munge namespace prefixes as needed to produce well-formed XML that will at least end up with the same localNames and namespaces; prefixes are not considered something that has to round-trip (though it's nice when they do, and serializers try to preserve them when possible).

I know, and I don't see that as a killer issue since there are several other ways of creating DOMs that can't be serialised (or require munging) — I just think that it ought to be avoided when avoidable.

>>   - if there is no such attribute, but there is a namespace in scope for prefix "foo", then a foo:bar attribute is created with that prefix and that namespace
> 
> This isn't compatible with what UAs do now, last I checked.  Are we sure this won't break sites?

This is naturally provisional on UA alignment — I thought that this would go without saying :) But the OP indicated that he wasn't seeing interoperable results anyway (though that might be due to other problems).

>>   - if there is no such attribute and no matching namespace in scope, a "bar" attribute is created, with no prefix and in no namespace
> 
> This will _definitely_ break sites if applied to HTML.

Yeah, I was concerned that that might be the case.

Either way, if we keep going this should probably move to www-dom :)

-- 
Robin Berjon - http://berjon.com/

Received on Tuesday, 20 April 2010 10:28:00 UTC