css-style-attr/Overview.src.html

Tue, 23 Feb 2010 01:56:06 +0000

author
Elika Etemad <fantasai.cvs@inkedblade.net>
date
Tue, 23 Feb 2010 01:56:06 +0000
changeset 1657
43999683c7d0
parent 1656
dbcbf818976c
child 1911
b3bd56529c72
permissions
-rwxr-xr-x

Clarify that comment convention is normative <http://lists.w3.org/Archives/Public/www-style/2010Feb/0041.html>

fantasai@1564 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
fantasai@1564 2 <html lang="en">
fantasai@1564 3 <head>
fantasai@1564 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
fantasai@1617 5 <title>CSS Styling Attributes Level 1</title>
fantasai@1620 6 <link rel="stylesheet" type="text/css" href="default.css">
fantasai@1563 7
fantasai@1564 8 <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED">
fantasai@1563 9 </head>
fantasai@1563 10
fantasai@1564 11 <div class="head">
fantasai@1564 12 <!--logo-->
fantasai@1563 13
fantasai@1617 14 <h1>CSS Styling Attributes Level 1</h1>
fantasai@1563 15
fantasai@1564 16 <h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
fantasai@1564 17 <dl>
fantasai@1564 18 <dt>This version:</dt>
fantasai@1620 19 <dd><dd><a href="http://www.w3.org/TR/[YEAR]/WD-css-style-attr-[CDATE]/">http://www.w3.org/TR/[YEAR]/WD-css-style-attr-[CDATE]/</a></dd>
fantasai@1620 20 <!-- <dd><a href="http://dev.w3.org/csswg/css-style-attr/">http://dev.w3.org/csswg/css-style-attr/</a> -->
fantasai@1564 21 <dt>Latest version:
fantasai@1564 22 <dd><a href="http://www.w3.org/TR/css-style-attr">http://www.w3.org/TR/css-style-attr</a>
fantasai@1564 23 <dt>Previous version:
fantasai@1564 24 <dd><a href="http://www.w3.org/TR/2002/WD-css-style-attr-20020515">http://www.w3.org/TR/2002/WD-css-style-attr-20020515</a>
fantasai@1564 25 <dt>Editor:
fantasai@1621 26 <dd><a href="http://fantasai.inkedblade.net/contact">Elika J. Etemad</a>
fantasai@1564 27 <dt>Previous Editors:
fantasai@1564 28 <dd><span lang="tr">Tantek &Ccedil;elik</span> (<a href="http://www.microsoft.com/">Microsoft</a>), &lt;<a href="mailto:tantekc@microsoft.com">tantekc@microsoft.com</a>&gt;
fantasai@1564 29 <dd><a href="http://www.w3.org/People/Bos/">Bert Bos</a> (<a href="http://www.w3.org/">W3C</a>), &lt;<a href="mailto:bert@w3.org">bert@w3.org</a>&gt;
fantasai@1564 30 <dd>Marc Attinasi (AOL/Netscape), &lt;<a href="mailto:attinasi@netscape.com">attinasi@netscape.com</a>&gt;
fantasai@1564 31 </dl>
fantasai@1564 32 <!--begin-copyright-->
fantasai@1564 33 <p>[Here will be included the file "../copyright.inc"]</p>
fantasai@1564 34 <!--end-copyright-->
fantasai@1563 35
fantasai@1563 36 <hr title="Separator for header">
fantasai@1563 37 </div>
fantasai@1563 38
fantasai@1563 39 <h2 class="no-num no-toc" id="abstract">Abstract</h2>
fantasai@1563 40
fantasai@1624 41 <p>Markup languages such as HTML [[HTML40]] and SVG [[SVG11]] provide a styling
fantasai@1655 42 attribute on most elements, to hold inline style information that applies
fantasai@1624 43 to those elements. One of the possible style sheet languages is CSS. This
fantasai@1624 44 draft describes the syntax and interpretation of the CSS fragment that can
fantasai@1624 45 be used in such styling attributes.
fantasai@1563 46
fantasai@1563 47 <h2 class="no-num no-toc" id="status">Status of this document</h2>
fantasai@1564 48 <!--status-->
fantasai@1617 49 <p>This specification is a <strong>Last Call Working Draft</strong>. All
fantasai@1617 50 persons are encouraged to review this document and <strong>send comments
fantasai@1617 51 to the <a
fantasai@1617 52 href="http://lists.w3.org/Archives/Public/www-style/">www-style</a>
fantasai@1617 53 mailing list</strong> as described above. The <strong>deadline for
fantasai@1617 54 comments</strong> is <strong>9 February 2010</strong>.
fantasai@1617 55
fantasai@1617 56 <p>A CSS Styling Attribute <a href="http://www.w3.org/Style/CSS/Test/">Test
fantasai@1617 57 Suite</a> will be developed during the Candidate Recommendation phase of
fantasai@1617 58 this CSS Styling Attribute specification.
fantasai@1563 59
fantasai@1564 60 <h2 class="no-num no-toc" id="contents">Table of contents</h2>
fantasai@1564 61 <!--toc-->
fantasai@1563 62
fantasai@1564 63 <h2 id="intro">Introduction</h2>
fantasai@1563 64
fantasai@1610 65 <p>Some document formats have a <dfn>styling attribute</dfn> to permit
fantasai@1610 66 the author to directly apply style information to specific elements
fantasai@1610 67 in documents. If a document format defines a styling attribute and the
fantasai@1624 68 attribute accepts CSS as its value, then this specification defines that
fantasai@1616 69 <dfn>CSS styling attribute</dfn>&rsquo;s syntax and interpretation.
fantasai@1563 70
fantasai@1564 71 <div class="example">
fantasai@1564 72 <p>The following example shows the use of the <code>style</code> attribute
fantasai@1624 73 in HTML [[HTML40]]:</p>
fantasai@1564 74 <pre>&lt;p style="<em>color: #090; line-height: 1.2</em>"&gt;...&lt;/p&gt;</pre>
fantasai@1564 75 </div>
fantasai@1563 76
fantasai@1565 77 <h2 id="conformance">Conformance</h2>
fantasai@1565 78
fantasai@1617 79 <p>A document or implementation cannot conform to CSS Styling Attributes
fantasai@1617 80 Level 1 alone, but can claim conformance to CSS Styling Attributes Level 1
fantasai@1571 81 if it satisfies the conformance requirements in this specification when
fantasai@1610 82 implementing CSS together with styling attribute handling as defined in a
fantasai@1610 83 document language that has CSS styling attributes.</p>
fantasai@1571 84
fantasai@1617 85 <p>Conformance to CSS Styling Attributes Level 1 is defined for two
fantasai@1610 86 classes:
fantasai@1571 87 <dl>
fantasai@1571 88 <dt><dfn>document</dfn></dt>
fantasai@1610 89 <dd>A document represented in a document language that defines a styling
fantasai@1571 90 attribute for one or more of its elements.
fantasai@1571 91 <dt><dfn>interpreter</dfn></dt>
fantasai@1571 92 <dd>Someone or something that interprets the semantics of a document and
fantasai@1571 93 its associated style information.
fantasai@1571 94 (Most CSS <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">user
fantasai@1571 95 agents</a> fall under this category.)</dd>
fantasai@1571 96 </dl>
fantasai@1571 97
fantasai@1565 98 <p>The conformance requirements are expressed with a combination of
fantasai@1565 99 descriptive assertions and RFC 2119 terminology. The key words "MUST",
fantasai@1565 100 "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
fantasai@1565 101 "RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
fantasai@1565 102 document are to be interpreted as described in RFC 2119.
fantasai@1565 103 However, for readability, these words do not appear in all uppercase
fantasai@1565 104 letters in this specification. All of the text of this specification is
fantasai@1565 105 normative except sections explicitly marked as non-normative, examples,
fantasai@1565 106 and notes. [[!RFC2119]]</p>
fantasai@1565 107
fantasai@1565 108 <p>Examples in this specification are introduced with the words "for example"
fantasai@1565 109 or are set apart from the normative text with <code>class="example"</code>,
fantasai@1565 110 like this:
fantasai@1565 111
fantasai@1565 112 <div class="example">
fantasai@1565 113 <p>This is an example of an informative example.</p>
fantasai@1565 114 </div>
fantasai@1565 115
fantasai@1565 116 <p>Informative notes begin with the word "Note" and are set apart from the
fantasai@1565 117 normative text with <code>class="note"</code>, like this:
fantasai@1565 118
fantasai@1565 119 <p class="note">Note, this is an informative note.</p>
fantasai@1565 120
fantasai@1610 121 <h2 id="syntax">Syntax and Parsing</h2>
fantasai@1610 122
fantasai@1610 123 <p>The value of the styling attribute must match the syntax of the contents of
fantasai@1610 124 a CSS <a href="http://www.w3.org/TR/CSS21/syndata.html#rule-sets">declaration
fantasai@1657 125 block</a>, whose formal grammar is given below in the terms and conventions of the
fantasai@1616 126 <a href="http://www.w3.org/TR/CSS21/syndata.html#syntax">CSS core grammar</a>:
fantasai@1616 127
fantasai@1616 128 <pre>
fantasai@1616 129 declaration-list
fantasai@1619 130 : S* declaration? [ ';' S* declaration? ]*
fantasai@1616 131 ;
fantasai@1616 132 </pre>
fantasai@1616 133
fantasai@1616 134 <p class="note">Note that following the CSS2.1 convention, comment tokens
fantasai@1616 135 are not shown in the rule above.
fantasai@1616 136
fantasai@1616 137 <p>The interpreter must parse the styling attribute's value using the
fantasai@1610 138 same forward-compatible parsing rules that apply to parsing declaration block
fantasai@1610 139 contents in a normal CSS style sheet. See
fantasai@1610 140 <a href="http://www.w3.org/TR/CSS21/syndata.html">chapter 4 of the CSS2.1
fantasai@1616 141 specification</a> for details. [[!CSS21]]
fantasai@1610 142
fantasai@1610 143 <p class="note">Note that because there is no open brace delimiting the
fantasai@1610 144 declaration list in the CSS styling attribute syntax, a close brace
fantasai@1610 145 (<code>}</code>) in the styling attribute's value does not terminate the
fantasai@1610 146 style data: it is merely an invalid token.</p>
fantasai@1610 147
fantasai@1610 148 <h2 id="interpret">Cascading and Interpretation</h2>
fantasai@1610 149
fantasai@1610 150 <p>The declarations in a styling attribute apply to the element to which
fantasai@1656 151 the attribute belongs. In the cascade, these declarations are considered
fantasai@1656 152 to have author origin and a specificity higher than any selector.
fantasai@1656 153 CSS2.1 <a href="http://www.w3.org/TR/CSS21/cascade.html#specificity">defines</a>
fantasai@1610 154 how style sheets and styling attributes are cascaded together. [[!CSS21]]
fantasai@1610 155 Relative URLs in the style data must be resolved relative to the styling
fantasai@1610 156 attribute's element (or to the document if per-element resolution is not
fantasai@1612 157 defined) when the attribute's value is parsed<!-- so dynamic changes to
fantasai@1612 158 the base URL don't affect the CSS ~Hixie -->.
fantasai@1610 159
fantasai@1610 160 <p>Aside from the differences in cascading, the declarations in a styling
fantasai@1610 161 attribute must be interpreted exactly as if they were given in a CSS
fantasai@1610 162 style rule that applies to the element.
fantasai@1610 163
fantasai@1610 164 <p>The CSS Working Group strongly recommends that document languages do
fantasai@1610 165 not allow multiple CSS styling attributes on a single element. If a document
fantasai@1610 166 language allows multiple CSS styling attributes, each must be parsed
fantasai@1610 167 independently and treated as a separate style rule, the ordering of which
fantasai@1610 168 should be defined by the document language, else is undefined.
fantasai@1610 169
fantasai@1564 170 <h2 id="ack">Acknowledgments</h2>
fantasai@1563 171
fantasai@1563 172 <p>Thanks to feedback from Daniel Glazman, Ian Hickson, Eric A. Meyer,
fantasai@1563 173 Bj&ouml;rn H&ouml;hrmann.
fantasai@1563 174
fantasai@1564 175 <h2 id="references">References
fantasai@1563 176
fantasai@1564 177 <h3 class="no-num" id="normative-references">Normative references</h3>
fantasai@1563 178
fantasai@1564 179 <!--begin-normative-->
fantasai@1564 180 <p>[Here will be inserted the file "normative.inc"]</p>
fantasai@1564 181 <!--end-normative-->
fantasai@1563 182
fantasai@1564 183 <h3 class="no-num" id="informative-references">Informative references</h3>
fantasai@1563 184
fantasai@1564 185 <!--begin-informative-->
fantasai@1564 186 <p>[Here will be inserted the file "informative.inc"]</p>
fantasai@1564 187 <!--end-informative-->
fantasai@1563 188
fantasai@1563 189 </body>
fantasai@1563 190 </html>
fantasai@1563 191 <!-- Keep this comment at the end of the file
fantasai@1563 192 Local variables:
fantasai@1563 193 mode: sgml
fantasai@1563 194 sgml-declaration:"~/SGML/HTML4.decl"
fantasai@1563 195 sgml-default-doctype-name:"html"
fantasai@1563 196 sgml-minimize-attributes:t
fantasai@1563 197 sgml-nofill-elements:("pre" "style" "br")
fantasai@1563 198 End:
fantasai@1563 199 -->

mercurial