Re: [css-style-attr][css3-namespace] Namespace prefixes in style attributes?

On Tue, Oct 16, 2012 at 6:10 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> With the new, generalized attr() function from css3-values, CSS qualified
> names can appear not only in selectors but also in property declarations.
> These qualified names depend on prefix declared in @namespace rules.
>
> What prefix declarations should apply to style attributes? For example:
>
> <foo xmlns:xlink="http://www.w3.org/1999/xlink"
>      xlink:href="the_target.bar"
>      style="content: '[' attr(xlink|href) ']';"/>
>
> I see two possibilities:
>
> * None. As if the declarations were in an implicit stylesheet that has
>   no @namespace rule.
> * If the host language has namespace prefixes (like XML does), "inherit"
>   the namespace declarations from the element.
>
> Either are fine IMO, but this should be defined somewhere.

Right now the answer is the same as for querySelector() (where the
problem you mention already exists): no namespaces, your first option.

The rule in a style attribute doesn't have a parent stylesheet to
inherit namespaces from, so by direct implication, any namespace
prefixes you use are invalid.

~TJ

Received on Tuesday, 16 October 2012 17:37:44 UTC