This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21163 - Advice about use of CSS namespaces in polyglot markup
Summary: Advice about use of CSS namespaces in polyglot markup
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML/XHTML Compatibility Authoring Guide (ed: Eliot Graff) (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Eliot Graff
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-01 03:49 UTC by Leif Halvard Silli
Modified: 2013-04-24 02:12 UTC (History)
4 users (show)

See Also:


Attachments

Description Leif Halvard Silli 2013-03-01 03:49:14 UTC
The prefixed attributes, such as xml:lang="", are "namespaced" within XHTML, SVG and MathML. Thus, they can be styled via CSS3 namespaces.

http://www.w3.org/TR/css3-namespace/

As for the HTML serialization, then xml:lang does not have the xml namespace effect. This means that a style such as

<style type="text/css">
@namespace xml   "http://www.w3.org/XML/1998/namespace";
*[xml|lang]{background:lime;}
</style>

would work XHTML, SVG and Math, it would not work in HTML.

While authors might seldom use this way of styling, the spec should explain whether it can be used.
Comment 1 Eliot Graff 2013-04-24 02:12:48 UTC
Added section:

7.3.2 Attributes Styled Using CSS Namespaces

The prefixed attributes, such as xml:lang="", are "namespaced" within XHTML, SVG and MathML. Thus, they can be styled via CSS3 namespaces. [CSS3NAMESPACE] However, for the HTML serialization, xml:lang would then not have the xml namespace effect. A style such as the following is valid in XHTML, SVG, and MathML, it does not work in HTML and is therefore not used in polyglot markup. 


Example 11
<style type="text/css">
@namespace xml   "http://www.w3.org/XML/1998/namespace";
*[xml|lang]{background:lime;}
</style>


new revision: 1.101; previous revision: 1.100