[Webkit-unassigned] [Bug 22958] Attribute namespaces are serialized as if they were element ones

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 18 16:24:16 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=22958





--- Comment #6 from Alex Milowski <alex at milowski.com>  2013-06-18 16:22:54 PST ---
Looking at the source, the problem is two fold:

  1. A prefix is not generated for the qualified name when it is missing.

  2. The attribute prefix, when set, is not passed properly to appendNamespace().


For (1), at MarkupAccumulator.cpp:455:

       QualifiedName prefixedName = attribute.name();
        if (attribute.namespaceURI() == XLinkNames::xlinkNamespaceURI) {
            if (!attribute.prefix())
                prefixedName.setPrefix(xlinkAtom);
        } else if (attribute.namespaceURI() == XMLNames::xmlNamespaceURI) {
            if (!attribute.prefix())
                prefixedName.setPrefix(xmlAtom);
        } else if (attribute.namespaceURI() == XMLNSNames::xmlnsNamespaceURI) {
            if (attribute.name() != XMLNSNames::xmlnsAttr && !attribute.prefix())
                prefixedName.setPrefix(xmlnsAtom);
        }
        result.append(prefixedName.toString());

There are an infinite number of cases that need to be handled here by a check for:

   } else if (attribute.namespaceURI() && !attribute.prefix()) {
       // generate a prefix ...
   }

and that is missing.

For (2), the actually prefix used (either what was set or what was given) needs to be tracked and passed later on to appendNamespace() instead of attribute.prefix() as that field may remain null in the case of generated or set prefixes.

Because you have to generate namespaces, it is unclear to me as of yet whether the current method of tracking in-scope namespaces will work properly.

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


More information about the webkit-unassigned mailing list