W3C home > Mailing lists > Public > www-style@w3.org > October 2006

[css3-selectors] Namespace name lookup mechanisms

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Fri, 06 Oct 2006 08:12:51 +0200
To: www-style@w3.org
Message-ID: <tiqbi29uki5t2ldlp2tob90sphifa898l1@hive.bjoern.hoehrmann.de>


  Simon Pieters uncovered a problem with namespace prefix handling in
the Selectors Working Draft when reviewing the XBL2 Working Draft. It
is currently left to higher level specifications how to look up the
namespace name that corresponds to a prefix in a selector. This lack
of a definition results in errors in specifications that use selectors,
for example,

  * http://www.w3.org/TR/2006/WD-xbl-20060907/ - XBL 2.0 defines that
    implementations must use the bindings (as declared using the means
    defined in Namespaces in XML) in scope of the attribute that con-
    tains the selector, but does not explain how to resolve conflicts
    between namespace prefixes in selectors being case-insensitive,
    and prefixes in Namespaces in XML being case-sensitive.

  * http://www.w3.org/TR/2006/WD-selectors-api-20060926/ - the mis-
    named "Selectors API" draft defines that implementations must pass
    the prefixes in the selector to a function implemented by the user,
    but does not define how to handle case diferences either, though
    it assumes in some examples that the case of the prefix is retained
    or that prefixes are converted to lower-case.

Both specifications are incomplete as they stand, and it is likely that
future specifications will initially contain similar errors. In XBL 2.0
the problem will currently be addressed by specifically explaining how
how to find one binding of the many possible bindings that would match
the prefix using a case-insensitive comparison. Other specifications are
likely to duplicate such a definition and possibly introduce errors and
differences in doing so.

As this is highly undesirable, the Selectors specification should both
explain this problem and address the common cases directly. A possible
solution would be as follows: specifications must define a lookup mech-
anism. If the mechanism is an algorithm, the Selector implementation
must pass the prefix (transformed to lower-case) to the algorithm. If
the mechanism is a hash with case-insensitive keys, the key that equals
the prefix identifies the namespace name. If the mechanism is a hash
with case-sensitive keys, the keys are put in some order and the first
key that matches the prefix case-insensitively identifies the namespace
name (the order would have to be defined). Specifications may define
other lookup mechanisms. If no mechanism is defined, or the mechanism
fails to identify a namespace name, the given prefix is considered not
declared for the purposes of the specification.

Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Friday, 6 October 2006 06:12:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:26 UTC