OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../htmlrunner.js"></script> | 3 <script src="../htmlrunner.js"></script> |
4 <script src="../lib/jquery.js"></script> | 4 <script src="../lib/jquery.2.0.3.js"></script> |
5 <script> | 5 <script> |
6 window.onload = function(){ | 6 window.onload = function(){ |
7 startTest("jslib-traverse-jquery", 'c67d0b8e'); | 7 startTest("jslib-traverse-jquery", '66e690c0'); |
8 | 8 |
9 // Try to force real results | 9 // Try to force real results |
10 var ret, tmp, div, dd; | 10 var ret, tmp, div, dd; |
11 | 11 |
12 var html = document.body.innerHTML; | 12 var html = document.body.innerHTML; |
13 | 13 |
14 prep(function(){ | 14 prep(function(){ |
15 div = jQuery("div"); | 15 div = jQuery("div"); |
16 dd = jQuery("dd"); | 16 dd = jQuery("dd"); |
17 var tmp = document.createElement("div"); | 17 var tmp = document.createElement("div"); |
18 tmp.innerHTML = html; | 18 tmp.innerHTML = html; |
19 document.body.appendChild( tmp ); | 19 document.body.appendChild( tmp ); |
20 }); | 20 }); |
21 » | 21 |
22 test("jQuery - parent x10", function(){ | 22 test("jQuery - parent x10", function(){ |
23 for ( var i = 0; i < 100; i++ ) | 23 for ( var i = 0; i < 100; i++ ) |
24 ret = div.parent().length; | 24 ret = div.parent().length; |
25 }); | 25 }); |
26 | 26 |
27 test("jQuery - parents x10", function(){ | 27 test("jQuery - parents x10", function(){ |
28 for ( var i = 0; i < 100; i++ ) | 28 for ( var i = 0; i < 100; i++ ) |
29 ret = div.parents().length; | 29 ret = div.parents().length; |
30 }); | 30 }); |
31 | 31 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 specification, these have been described in terms of CSS2.1. <a | 308 specification, these have been described in terms of CSS2.1. <a |
309 href="#refsCSS21">[CSS21]</a></p> | 309 href="#refsCSS21">[CSS21]</a></p> |
310 | 310 |
311 <h3><a name=terminology></a>1.2. Terminology</h3> | 311 <h3><a name=terminology></a>1.2. Terminology</h3> |
312 | 312 |
313 <p>All of the text of this specification is normative except | 313 <p>All of the text of this specification is normative except |
314 examples, notes, and sections explicitly marked as | 314 examples, notes, and sections explicitly marked as |
315 non-normative.</p> | 315 non-normative.</p> |
316 | 316 |
317 <h3><a name=changesFromCSS2></a>1.3. Changes from CSS2</h3> | 317 <h3><a name=changesFromCSS2></a>1.3. Changes from CSS2</h3> |
318 | 318 |
319 <p><em>This section is non-normative.</em></p> | 319 <p><em>This section is non-normative.</em></p> |
320 | 320 |
321 <p>The main differences between the selectors in CSS2 and those in | 321 <p>The main differences between the selectors in CSS2 and those in |
322 Selectors are: | 322 Selectors are: |
323 | 323 |
324 <ul> | 324 <ul> |
325 | 325 |
326 <li>the list of basic definitions (selector, group of selectors, | 326 <li>the list of basic definitions (selector, group of selectors, |
327 simple selector, etc.) has been changed; in particular, what was | 327 simple selector, etc.) has been changed; in particular, what was |
328 referred to in CSS2 as a simple selector is now called a sequence | 328 referred to in CSS2 as a simple selector is now called a sequence |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 | 1491 |
1492 | 1492 |
1493 <h5><a name=indeterminate>The :indeterminate pseudo-class</a></h5> | 1493 <h5><a name=indeterminate>The :indeterminate pseudo-class</a></h5> |
1494 | 1494 |
1495 <div class="note"> | 1495 <div class="note"> |
1496 | 1496 |
1497 <p>Radio and checkbox elements can be toggled by the user, but are | 1497 <p>Radio and checkbox elements can be toggled by the user, but are |
1498 sometimes in an indeterminate state, neither checked nor unchecked. | 1498 sometimes in an indeterminate state, neither checked nor unchecked. |
1499 This can be due to an element attribute, or DOM manipulation.</p> | 1499 This can be due to an element attribute, or DOM manipulation.</p> |
1500 | 1500 |
1501 <p>A future version of this specification may introduce an | 1501 <p>A future version of this specification may introduce an |
1502 <code>:indeterminate</code> pseudo-class that applies to such elements. | 1502 <code>:indeterminate</code> pseudo-class that applies to such elements. |
1503 <!--While the <code>:indeterminate</code> pseudo-class is dynamic in | 1503 <!--While the <code>:indeterminate</code> pseudo-class is dynamic in |
1504 nature, and is altered by user action, since it can also be based on | 1504 nature, and is altered by user action, since it can also be based on |
1505 the presence of an element attribute, it applies to all media.</p> | 1505 the presence of an element attribute, it applies to all media.</p> |
1506 | 1506 |
1507 <p>Components of a radio-group initialized with no pre-selected choice | 1507 <p>Components of a radio-group initialized with no pre-selected choice |
1508 are an example of :indeterminate state.--></p> | 1508 are an example of :indeterminate state.--></p> |
1509 | 1509 |
1510 </div> | 1510 </div> |
1511 | 1511 |
1512 | 1512 |
1513 <h4><a name=structural-pseudos>6.6.5. Structural pseudo-classes</a></h4> | 1513 <h4><a name=structural-pseudos>6.6.5. Structural pseudo-classes</a></h4> |
1514 | 1514 |
1515 <p>Selectors introduces the concept of <dfn>structural | 1515 <p>Selectors introduces the concept of <dfn>structural |
1516 pseudo-classes</dfn> to permit selection based on extra information that lies in | 1516 pseudo-classes</dfn> to permit selection based on extra information that lies in |
1517 the document tree but cannot be represented by other simple selectors or | 1517 the document tree but cannot be represented by other simple selectors or |
1518 combinators. | 1518 combinators. |
1519 | 1519 |
1520 <p>Note that standalone pieces of PCDATA (text nodes in the DOM) are | 1520 <p>Note that standalone pieces of PCDATA (text nodes in the DOM) are |
1521 not counted when calculating the position of an element in the list of | 1521 not counted when calculating the position of an element in the list of |
1522 children of its parent. When calculating the position of an element in | 1522 children of its parent. When calculating the position of an element in |
1523 the list of children of its parent, the index numbering starts at 1. | 1523 the list of children of its parent, the index numbering starts at 1. |
1524 | 1524 |
1525 | 1525 |
1526 <h5><a name=root-pseudo>:root pseudo-class</a></h5> | 1526 <h5><a name=root-pseudo>:root pseudo-class</a></h5> |
1527 | 1527 |
1528 <p>The <code>:root</code> pseudo-class represents an element that is | 1528 <p>The <code>:root</code> pseudo-class represents an element that is |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 <p>Examples:</p> | 1700 <p>Examples:</p> |
1701 <p>The following selector represents a <code>p</code> element that is | 1701 <p>The following selector represents a <code>p</code> element that is |
1702 the first child of a <code>div</code> element:</p> | 1702 the first child of a <code>div</code> element:</p> |
1703 <pre>div > p:first-child</pre> | 1703 <pre>div > p:first-child</pre> |
1704 <p>This selector can represent the <code>p</code> inside the | 1704 <p>This selector can represent the <code>p</code> inside the |
1705 <code>div</code> of the following fragment:</p> | 1705 <code>div</code> of the following fragment:</p> |
1706 <pre><p> The last P before the note.</p> | 1706 <pre><p> The last P before the note.</p> |
1707 <div class="note"> | 1707 <div class="note"> |
1708 <p> The first P inside the note.</p> | 1708 <p> The first P inside the note.</p> |
1709 </div></pre>but cannot represent the second <code>p</code> in the followin
g | 1709 </div></pre>but cannot represent the second <code>p</code> in the followin
g |
1710 fragment: | 1710 fragment: |
1711 <pre><p> The last P before the note.</p> | 1711 <pre><p> The last P before the note.</p> |
1712 <div class="note"> | 1712 <div class="note"> |
1713 <h2> Note </h2> | 1713 <h2> Note </h2> |
1714 <p> The first P inside the note.</p> | 1714 <p> The first P inside the note.</p> |
1715 </div></pre> | 1715 </div></pre> |
1716 <p>The following two selectors are usually equivalent:</p> | 1716 <p>The following two selectors are usually equivalent:</p> |
1717 <pre>* > a:first-child /* a is first child of any element */ | 1717 <pre>* > a:first-child /* a is first child of any element */ |
1718 a:first-child /* Same (assuming a is not the root element) */</pre> | 1718 a:first-child /* Same (assuming a is not the root element) */</pre> |
1719 </div> | 1719 </div> |
1720 | 1720 |
1721 <h5><a name=last-child-pseudo>:last-child pseudo-class</a></h5> | 1721 <h5><a name=last-child-pseudo>:last-child pseudo-class</a></h5> |
1722 | 1722 |
1723 <p>Same as <code>:nth-last-child(1)</code>. The <code>:last-child</code> pseudo-
class | 1723 <p>Same as <code>:nth-last-child(1)</code>. The <code>:last-child</code> pseudo-
class |
1724 represents an element that is the last child of some other element. | 1724 represents an element that is the last child of some other element. |
1725 | 1725 |
1726 <div class="example"> | 1726 <div class="example"> |
1727 <p>Example:</p> | 1727 <p>Example:</p> |
1728 <p>The following selector represents a list item <code>li</code> that | 1728 <p>The following selector represents a list item <code>li</code> that |
1729 is the last child of an ordered list <code>ol</code>. | 1729 is the last child of an ordered list <code>ol</code>. |
1730 <pre>ol > li:last-child</pre> | 1730 <pre>ol > li:last-child</pre> |
1731 </div> | 1731 </div> |
1732 | 1732 |
1733 <h5><a name=first-of-type-pseudo>:first-of-type pseudo-class</a></h5> | 1733 <h5><a name=first-of-type-pseudo>:first-of-type pseudo-class</a></h5> |
1734 | 1734 |
1735 <p>Same as <code>:nth-of-type(1)</code>. The <code>:first-of-type</code> pseudo-
class | 1735 <p>Same as <code>:nth-of-type(1)</code>. The <code>:first-of-type</code> pseudo-
class |
1736 represents an element that is the first sibling of its type in the list of | 1736 represents an element that is the first sibling of its type in the list of |
1737 children of its parent element. | 1737 children of its parent element. |
1738 | 1738 |
1739 <div class="example"> | 1739 <div class="example"> |
1740 <p>Example:</p> | 1740 <p>Example:</p> |
1741 <p>The following selector represents a definition title | 1741 <p>The following selector represents a definition title |
1742 <code>dt</code> inside a definition list <code>dl</code>, this | 1742 <code>dt</code> inside a definition list <code>dl</code>, this |
1743 <code>dt</code> being the first of its type in the list of children of | 1743 <code>dt</code> being the first of its type in the list of children of |
1744 its parent element.</p> | 1744 its parent element.</p> |
1745 <pre>dl dt:first-of-type</pre> | 1745 <pre>dl dt:first-of-type</pre> |
1746 <p>It is a valid description for the first two <code>dt</code> | 1746 <p>It is a valid description for the first two <code>dt</code> |
1747 elements in the following example but not for the third one:</p> | 1747 elements in the following example but not for the third one:</p> |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 | 1906 |
1907 <p>The selector <code>p::first-line</code> does not match any real | 1907 <p>The selector <code>p::first-line</code> does not match any real |
1908 HTML element. It does match a pseudo-element that conforming user | 1908 HTML element. It does match a pseudo-element that conforming user |
1909 agents will insert at the beginning of every paragraph.</p> | 1909 agents will insert at the beginning of every paragraph.</p> |
1910 | 1910 |
1911 <p>Note that the length of the first line depends on a number of | 1911 <p>Note that the length of the first line depends on a number of |
1912 factors, including the width of the page, the font size, etc. Thus, | 1912 factors, including the width of the page, the font size, etc. Thus, |
1913 an ordinary HTML paragraph such as:</p> | 1913 an ordinary HTML paragraph such as:</p> |
1914 | 1914 |
1915 <pre> | 1915 <pre> |
1916 <P>This is a somewhat long HTML | 1916 <P>This is a somewhat long HTML |
1917 paragraph that will be broken into several | 1917 paragraph that will be broken into several |
1918 lines. The first line will be identified | 1918 lines. The first line will be identified |
1919 by a fictional tag sequence. The other lines | 1919 by a fictional tag sequence. The other lines |
1920 will be treated as ordinary lines in the | 1920 will be treated as ordinary lines in the |
1921 paragraph.</P> | 1921 paragraph.</P> |
1922 </pre> | 1922 </pre> |
1923 | 1923 |
1924 <p>the lines of which happen to be broken as follows: | 1924 <p>the lines of which happen to be broken as follows: |
1925 | 1925 |
1926 <pre> | 1926 <pre> |
1927 THIS IS A SOMEWHAT LONG HTML PARAGRAPH THAT | 1927 THIS IS A SOMEWHAT LONG HTML PARAGRAPH THAT |
1928 will be broken into several lines. The first | 1928 will be broken into several lines. The first |
1929 line will be identified by a fictional tag | 1929 line will be identified by a fictional tag |
1930 sequence. The other lines will be treated as | 1930 sequence. The other lines will be treated as |
1931 ordinary lines in the paragraph. | 1931 ordinary lines in the paragraph. |
1932 </pre> | 1932 </pre> |
1933 | 1933 |
1934 <p>This paragraph might be "rewritten" by user agents to include the | 1934 <p>This paragraph might be "rewritten" by user agents to include the |
1935 <em>fictional tag sequence</em> for <code>::first-line</code>. This | 1935 <em>fictional tag sequence</em> for <code>::first-line</code>. This |
1936 fictional tag sequence helps to show how properties are inherited.</p> | 1936 fictional tag sequence helps to show how properties are inherited.</p> |
1937 | 1937 |
1938 <pre> | 1938 <pre> |
1939 <P><b><P::first-line></b> This is a somewhat long HTML | 1939 <P><b><P::first-line></b> This is a somewhat long HTML |
1940 paragraph that <b></P::first-line></b> will be broken into several | 1940 paragraph that <b></P::first-line></b> will be broken into several |
1941 lines. The first line will be identified | 1941 lines. The first line will be identified |
1942 by a fictional tag sequence. The other lines | 1942 by a fictional tag sequence. The other lines |
1943 will be treated as ordinary lines in the | 1943 will be treated as ordinary lines in the |
1944 paragraph.</P> | 1944 paragraph.</P> |
1945 </pre> | 1945 </pre> |
1946 | 1946 |
1947 <p>If a pseudo-element breaks up a real element, the desired effect | 1947 <p>If a pseudo-element breaks up a real element, the desired effect |
1948 can often be described by a fictional tag sequence that closes and | 1948 can often be described by a fictional tag sequence that closes and |
1949 then re-opens the element. Thus, if we mark up the previous paragraph | 1949 then re-opens the element. Thus, if we mark up the previous paragraph |
1950 with a <code>span</code> element:</p> | 1950 with a <code>span</code> element:</p> |
1951 | 1951 |
1952 <pre> | 1952 <pre> |
1953 <P><b><SPAN class="test"></b> This is a somewhat long HTML | 1953 <P><b><SPAN class="test"></b> This is a somewhat long HTML |
1954 paragraph that will be broken into several | 1954 paragraph that will be broken into several |
1955 lines.<b></SPAN></b> The first line will be identified | 1955 lines.<b></SPAN></b> The first line will be identified |
1956 by a fictional tag sequence. The other lines | 1956 by a fictional tag sequence. The other lines |
1957 will be treated as ordinary lines in the | 1957 will be treated as ordinary lines in the |
1958 paragraph.</P> | 1958 paragraph.</P> |
1959 </pre> | 1959 </pre> |
1960 | 1960 |
1961 <p>the user agent could simulate start and end tags for | 1961 <p>the user agent could simulate start and end tags for |
1962 <code>span</code> when inserting the fictional tag sequence for | 1962 <code>span</code> when inserting the fictional tag sequence for |
1963 <code>::first-line</code>. | 1963 <code>::first-line</code>. |
1964 | 1964 |
1965 <pre> | 1965 <pre> |
1966 <P><P::first-line><b><SPAN class="test"></b> This is a | 1966 <P><P::first-line><b><SPAN class="test"></b> This is a |
1967 somewhat long HTML | 1967 somewhat long HTML |
1968 paragraph that will <b></SPAN></b></P::first-line><b><SPAN class=
"test"></b> be | 1968 paragraph that will <b></SPAN></b></P::first-line><b><SPAN class=
"test"></b> be |
1969 broken into several | 1969 broken into several |
1970 lines.<b></SPAN></b> The first line will be identified | 1970 lines.<b></SPAN></b> The first line will be identified |
1971 by a fictional tag sequence. The other lines | 1971 by a fictional tag sequence. The other lines |
1972 will be treated as ordinary lines in the | 1972 will be treated as ordinary lines in the |
1973 paragraph.</P> | 1973 paragraph.</P> |
1974 </pre> | 1974 </pre> |
1975 | 1975 |
1976 <p>In CSS, the <code>::first-line</code> pseudo-element can only be | 1976 <p>In CSS, the <code>::first-line</code> pseudo-element can only be |
1977 attached to a block-level element, an inline-block, a table-caption, | 1977 attached to a block-level element, an inline-block, a table-caption, |
1978 or a table-cell.</p> | 1978 or a table-cell.</p> |
1979 | 1979 |
1980 <p><a name="first-formatted-line"></a>The "first formatted line" of an | 1980 <p><a name="first-formatted-line"></a>The "first formatted line" of an |
1981 element may occur inside a | 1981 element may occur inside a |
1982 block-level descendant in the same flow (i.e., a block-level | 1982 block-level descendant in the same flow (i.e., a block-level |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2100 | 2100 |
2101 <p>The <span class="index-inst" title="fictional tag | 2101 <p>The <span class="index-inst" title="fictional tag |
2102 sequence">fictional tag sequence</span> is:</p> | 2102 sequence">fictional tag sequence</span> is:</p> |
2103 | 2103 |
2104 <pre> | 2104 <pre> |
2105 <P> | 2105 <P> |
2106 <SPAN> | 2106 <SPAN> |
2107 <P::first-letter> | 2107 <P::first-letter> |
2108 T | 2108 T |
2109 </P::first-letter>he first | 2109 </P::first-letter>he first |
2110 </SPAN> | 2110 </SPAN> |
2111 few words of an article in the Economist. | 2111 few words of an article in the Economist. |
2112 </P> | 2112 </P> |
2113 </pre> | 2113 </pre> |
2114 | 2114 |
2115 <p>Note that the <code>::first-letter</code> pseudo-element tags abut | 2115 <p>Note that the <code>::first-letter</code> pseudo-element tags abut |
2116 the content (i.e., the initial character), while the ::first-line | 2116 the content (i.e., the initial character), while the ::first-line |
2117 pseudo-element start tag is inserted right after the start tag of the | 2117 pseudo-element start tag is inserted right after the start tag of the |
2118 block element.</p> </div> | 2118 block element.</p> </div> |
2119 | 2119 |
2120 <p>In order to achieve traditional drop caps formatting, user agents | 2120 <p>In order to achieve traditional drop caps formatting, user agents |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2211 p::first-line { color: blue } | 2211 p::first-line { color: blue } |
2212 | 2212 |
2213 <P>Some text that ends up on two lines</P></pre> | 2213 <P>Some text that ends up on two lines</P></pre> |
2214 | 2214 |
2215 <p>Assuming that a line break will occur before the word "ends", the | 2215 <p>Assuming that a line break will occur before the word "ends", the |
2216 <span class="index-inst" title="fictional tag sequence">fictional tag | 2216 <span class="index-inst" title="fictional tag sequence">fictional tag |
2217 sequence</span> for this fragment might be:</p> | 2217 sequence</span> for this fragment might be:</p> |
2218 | 2218 |
2219 <pre><P> | 2219 <pre><P> |
2220 <P::first-line> | 2220 <P::first-line> |
2221 <P::first-letter> | 2221 <P::first-letter> |
2222 S | 2222 S |
2223 </P::first-letter>ome text that | 2223 </P::first-letter>ome text that |
2224 </P::first-line> | 2224 </P::first-line> |
2225 ends up on two lines | 2225 ends up on two lines |
2226 </P></pre> | 2226 </P></pre> |
2227 | 2227 |
2228 <p>Note that the <code>::first-letter</code> element is inside the <code>::first
-line</code> | 2228 <p>Note that the <code>::first-letter</code> element is inside the <code>::first
-line</code> |
2229 element. Properties set on <code>::first-line</code> are inherited by | 2229 element. Properties set on <code>::first-line</code> are inherited by |
2230 <code>::first-letter</code>, but are overridden if the same property is set on | 2230 <code>::first-letter</code>, but are overridden if the same property is set on |
2231 <code>::first-letter</code>.</p> | 2231 <code>::first-letter</code>.</p> |
2232 </div> | 2232 </div> |
2233 | 2233 |
2234 | 2234 |
2235 <h4><a name=UIfragments>7.3.</a> <a name=selection>The ::selection pseudo-elemen
t</a></h4> | 2235 <h4><a name=UIfragments>7.3.</a> <a name=selection>The ::selection pseudo-elemen
t</a></h4> |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2722 <th>Specification</th> | 2722 <th>Specification</th> |
2723 <td>CSS level 1</td></tr> | 2723 <td>CSS level 1</td></tr> |
2724 <tr> | 2724 <tr> |
2725 <th>Accepts</th> | 2725 <th>Accepts</th> |
2726 <td>type selectors<br>class selectors<br>ID selectors<br>:link, | 2726 <td>type selectors<br>class selectors<br>ID selectors<br>:link, |
2727 :visited and :active pseudo-classes<br>descendant combinator | 2727 :visited and :active pseudo-classes<br>descendant combinator |
2728 <br>::first-line and ::first-letter pseudo-elements</td></tr> | 2728 <br>::first-line and ::first-letter pseudo-elements</td></tr> |
2729 <tr> | 2729 <tr> |
2730 <th>Excludes</th> | 2730 <th>Excludes</th> |
2731 <td> | 2731 <td> |
2732 | 2732 |
2733 <p>universal selector<br>attribute selectors<br>:hover and :focus | 2733 <p>universal selector<br>attribute selectors<br>:hover and :focus |
2734 pseudo-classes<br>:target pseudo-class<br>:lang() pseudo-class<br>all UI | 2734 pseudo-classes<br>:target pseudo-class<br>:lang() pseudo-class<br>all UI |
2735 element states pseudo-classes<br>all structural | 2735 element states pseudo-classes<br>all structural |
2736 pseudo-classes<br>negation pseudo-class<br>all | 2736 pseudo-classes<br>negation pseudo-class<br>all |
2737 UI element fragments pseudo-elements<br>::before and ::after | 2737 UI element fragments pseudo-elements<br>::before and ::after |
2738 pseudo-elements<br>child combinators<br>sibling combinators | 2738 pseudo-elements<br>child combinators<br>sibling combinators |
2739 | 2739 |
2740 <p>namespaces</td></tr> | 2740 <p>namespaces</td></tr> |
2741 <tr> | 2741 <tr> |
2742 <th>Extra constraints</th> | 2742 <th>Extra constraints</th> |
2743 <td>only one class selector allowed per sequence of simple | 2743 <td>only one class selector allowed per sequence of simple |
2744 selectors</td></tr></tbody></table><br><br> | 2744 selectors</td></tr></tbody></table><br><br> |
2745 <table class="tprofile"> | 2745 <table class="tprofile"> |
2746 <tbody> | 2746 <tbody> |
2747 <tr> | 2747 <tr> |
2748 <th class="title" colspan=2>Selectors profile</th></tr> | 2748 <th class="title" colspan=2>Selectors profile</th></tr> |
2749 <tr> | 2749 <tr> |
2750 <th>Specification</th> | 2750 <th>Specification</th> |
2751 <td>CSS level 2</td></tr> | 2751 <td>CSS level 2</td></tr> |
2752 <tr> | 2752 <tr> |
2753 <th>Accepts</th> | 2753 <th>Accepts</th> |
2754 <td>type selectors<br>universal selector<br>attribute presence and | 2754 <td>type selectors<br>universal selector<br>attribute presence and |
2755 values selectors<br>class selectors<br>ID selectors<br>:link, :visited, | 2755 values selectors<br>class selectors<br>ID selectors<br>:link, :visited, |
2756 :active, :hover, :focus, :lang() and :first-child pseudo-classes | 2756 :active, :hover, :focus, :lang() and :first-child pseudo-classes |
2757 <br>descendant combinator<br>child combinator<br>adjacent sibling | 2757 <br>descendant combinator<br>child combinator<br>adjacent sibling |
2758 combinator<br>::first-line and ::first-letter pseudo-elements<br>::before | 2758 combinator<br>::first-line and ::first-letter pseudo-elements<br>::before |
2759 and ::after pseudo-elements</td></tr> | 2759 and ::after pseudo-elements</td></tr> |
2760 <tr> | 2760 <tr> |
2761 <th>Excludes</th> | 2761 <th>Excludes</th> |
2762 <td> | 2762 <td> |
2763 | 2763 |
2764 <p>content selectors<br>substring matching attribute | 2764 <p>content selectors<br>substring matching attribute |
2765 selectors<br>:target pseudo-classes<br>all UI element | 2765 selectors<br>:target pseudo-classes<br>all UI element |
2766 states pseudo-classes<br>all structural pseudo-classes other | 2766 states pseudo-classes<br>all structural pseudo-classes other |
2767 than :first-child<br>negation pseudo-class<br>all UI element | 2767 than :first-child<br>negation pseudo-class<br>all UI element |
2768 fragments pseudo-elements<br>general sibling combinators | 2768 fragments pseudo-elements<br>general sibling combinators |
2769 | 2769 |
2770 <p>namespaces</td></tr> | 2770 <p>namespaces</td></tr> |
2771 <tr> | 2771 <tr> |
2772 <th>Extra constraints</th> | 2772 <th>Extra constraints</th> |
2773 <td>more than one class selector per sequence of simple selectors (CSS1 | 2773 <td>more than one class selector per sequence of simple selectors (CSS1 |
2774 constraint) allowed</td></tr></tbody></table> | 2774 constraint) allowed</td></tr></tbody></table> |
2775 | 2775 |
2776 <p>In CSS, selectors express pattern matching rules that determine which style | 2776 <p>In CSS, selectors express pattern matching rules that determine which style |
2777 rules apply to elements in the document tree. | 2777 rules apply to elements in the document tree. |
2778 | 2778 |
2779 <p>The following selector (CSS level 2) will <b>match</b> all anchors <code>a</c
ode> | 2779 <p>The following selector (CSS level 2) will <b>match</b> all anchors <code>a</c
ode> |
2780 with attribute <code>name</code> set inside a section 1 header <code>h1</code>: | 2780 with attribute <code>name</code> set inside a section 1 header <code>h1</code>: |
2781 <pre>h1 a[name]</pre> | 2781 <pre>h1 a[name]</pre> |
2782 | 2782 |
2783 <p>All CSS declarations attached to such a selector are applied to elements | 2783 <p>All CSS declarations attached to such a selector are applied to elements |
2784 matching it. </div> | 2784 matching it. </div> |
2785 | 2785 |
2786 <div class="profile"> | 2786 <div class="profile"> |
2787 <table class="tprofile"> | 2787 <table class="tprofile"> |
2788 <tbody> | 2788 <tbody> |
2789 <tr> | 2789 <tr> |
2790 <th class="title" colspan=2>Selectors profile</th></tr> | 2790 <th class="title" colspan=2>Selectors profile</th></tr> |
2791 <tr> | 2791 <tr> |
2792 <th>Specification</th> | 2792 <th>Specification</th> |
2793 <td>STTS 3</td> | 2793 <td>STTS 3</td> |
2794 </tr> | 2794 </tr> |
2795 <tr> | 2795 <tr> |
2796 <th>Accepts</th> | 2796 <th>Accepts</th> |
2797 <td> | 2797 <td> |
2798 | 2798 |
2799 <p>type selectors<br>universal selectors<br>attribute selectors<br>class | 2799 <p>type selectors<br>universal selectors<br>attribute selectors<br>class |
2800 selectors<br>ID selectors<br>all structural pseudo-classes<br> | 2800 selectors<br>ID selectors<br>all structural pseudo-classes<br> |
2801 all combinators | 2801 all combinators |
2802 | 2802 |
2803 <p>namespaces</td></tr> | 2803 <p>namespaces</td></tr> |
2804 <tr> | 2804 <tr> |
2805 <th>Excludes</th> | 2805 <th>Excludes</th> |
2806 <td>non-accepted pseudo-classes<br>pseudo-elements<br></td></tr> | 2806 <td>non-accepted pseudo-classes<br>pseudo-elements<br></td></tr> |
2807 <tr> | 2807 <tr> |
2808 <th>Extra constraints</th> | 2808 <th>Extra constraints</th> |
2809 <td>some selectors and combinators are not allowed in fragment | 2809 <td>some selectors and combinators are not allowed in fragment |
2810 descriptions on the right side of STTS declarations.</td></tr></tbody></ta
ble> | 2810 descriptions on the right side of STTS declarations.</td></tr></tbody></ta
ble> |
2811 <form> | 2811 <form> |
2812 <input type="text" name="test10"/> | 2812 <input type="text" name="test10"/> |
(...skipping 15 matching lines...) Expand all Loading... |
2828 <input type="text" name="foo"/> | 2828 <input type="text" name="foo"/> |
2829 <input type="text" name="foo"/> | 2829 <input type="text" name="foo"/> |
2830 <input type="text" name="foo"/> | 2830 <input type="text" name="foo"/> |
2831 <input type="text" name="foo"/> | 2831 <input type="text" name="foo"/> |
2832 <input type="text" name="foo"/> | 2832 <input type="text" name="foo"/> |
2833 <input type="text" name="foo"/> | 2833 <input type="text" name="foo"/> |
2834 <input type="text" name="foo"/> | 2834 <input type="text" name="foo"/> |
2835 <input type="text" name="foo"/> | 2835 <input type="text" name="foo"/> |
2836 <input type="text" name="foo"/> | 2836 <input type="text" name="foo"/> |
2837 </form> | 2837 </form> |
2838 | 2838 |
2839 <p>Selectors can be used in STTS 3 in two different | 2839 <p>Selectors can be used in STTS 3 in two different |
2840 manners: | 2840 manners: |
2841 <ol> | 2841 <ol> |
2842 <li>a selection mechanism equivalent to CSS selection mechanism: declarations | 2842 <li>a selection mechanism equivalent to CSS selection mechanism: declarations |
2843 attached to a given selector are applied to elements matching that selector, | 2843 attached to a given selector are applied to elements matching that selector, |
2844 <li>fragment descriptions that appear on the right side of declarations. | 2844 <li>fragment descriptions that appear on the right side of declarations. |
2845 </li></ol></div> | 2845 </li></ol></div> |
2846 | 2846 |
2847 <h2><a name=Conformance></a>13. Conformance and requirements</h2> | 2847 <h2><a name=Conformance></a>13. Conformance and requirements</h2> |
2848 | 2848 |
2849 <p>This section defines conformance with the present specification only. | 2849 <p>This section defines conformance with the present specification only. |
2850 | 2850 |
2851 <p>The inability of a user agent to implement part of this specification due to | 2851 <p>The inability of a user agent to implement part of this specification due to |
2852 the limitations of a particular device (e.g., non interactive user agents will | 2852 the limitations of a particular device (e.g., non interactive user agents will |
2853 probably not implement dynamic pseudo-classes because they make no sense without | 2853 probably not implement dynamic pseudo-classes because they make no sense without |
2854 interactivity) does not imply non-conformance. | 2854 interactivity) does not imply non-conformance. |
2855 | 2855 |
2856 <p>All specifications reusing Selectors must contain a <a | 2856 <p>All specifications reusing Selectors must contain a <a |
2857 href="#profiling">Profile</a> listing the | 2857 href="#profiling">Profile</a> listing the |
2858 subset of Selectors it accepts or excludes, and describing the constraints | 2858 subset of Selectors it accepts or excludes, and describing the constraints |
2859 it adds to the current specification. | 2859 it adds to the current specification. |
2860 | 2860 |
2861 <p>Invalidity is caused by a parsing error, e.g. an unrecognized token or a toke
n | 2861 <p>Invalidity is caused by a parsing error, e.g. an unrecognized token or a toke
n |
2862 which is not allowed at the current parsing point. | 2862 which is not allowed at the current parsing point. |
2863 | 2863 |
2864 <p>User agents must observe the rules for handling parsing errors: | 2864 <p>User agents must observe the rules for handling parsing errors: |
2865 <ul> | 2865 <ul> |
2866 <li>a simple selector containing an undeclared namespace prefix is invalid</li
> | 2866 <li>a simple selector containing an undeclared namespace prefix is invalid</li
> |
2867 <li>a selector containing an invalid simple selector, an invalid combinator | 2867 <li>a selector containing an invalid simple selector, an invalid combinator |
2868 or an invalid token is invalid. </li> | 2868 or an invalid token is invalid. </li> |
2869 <li>a group of selectors containing an invalid selector is invalid.</li> | 2869 <li>a group of selectors containing an invalid selector is invalid.</li> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2902 | 2902 |
2903 <h2><a name=references>16. References</a></h2> | 2903 <h2><a name=references>16. References</a></h2> |
2904 | 2904 |
2905 <dl class="refs"> | 2905 <dl class="refs"> |
2906 | 2906 |
2907 <dt>[CSS1] | 2907 <dt>[CSS1] |
2908 <dd><a name=refsCSS1></a> Bert Bos, Håkon Wium Lie; "<cite>Cascading Sty
le Sheets, level 1</cite>", W3C Recommendation, 17 Dec 1996, revised 11 Jan 1999 | 2908 <dd><a name=refsCSS1></a> Bert Bos, Håkon Wium Lie; "<cite>Cascading Sty
le Sheets, level 1</cite>", W3C Recommendation, 17 Dec 1996, revised 11 Jan 1999 |
2909 <dd>(<code><a href="http://www.w3.org/TR/REC-CSS1">http://www.w3.org/TR/REC-CS
S1</a></code>) | 2909 <dd>(<code><a href="http://www.w3.org/TR/REC-CSS1">http://www.w3.org/TR/REC-CS
S1</a></code>) |
2910 | 2910 |
2911 <dt>[CSS21] | 2911 <dt>[CSS21] |
2912 <dd><a name=refsCSS21></a> Bert Bos, Tantek Çelik, Ian Hickson, Hå
;kon Wium Lie, editors; "<cite>Cascading Style Sheets, level 2 revision 1</cite>
", W3C Working Draft, 13 June 2005 | 2912 <dd><a name=refsCSS21></a> Bert Bos, Tantek Çelik, Ian Hickson, Hå
;kon Wium Lie, editors; "<cite>Cascading Style Sheets, level 2 revision 1</cite>
", W3C Working Draft, 13 June 2005 |
2913 <dd>(<code><a href="http://www.w3.org/TR/CSS21">http://www.w3.org/TR/CSS21</a>
</code>) | 2913 <dd>(<code><a href="http://www.w3.org/TR/CSS21">http://www.w3.org/TR/CSS21</a>
</code>) |
2914 | 2914 |
2915 <dt>[CWWW] | 2915 <dt>[CWWW] |
2916 <dd><a name=refsCWWW></a> Martin J. Dürst, François Yergeau, Misha
Wolf, Asmus Freytag, Tex Texin, editors; "<cite>Character Model for the World W
ide Web</cite>", W3C Recommendation, 15 February 2005 | 2916 <dd><a name=refsCWWW></a> Martin J. Dürst, François Yergeau, Misha
Wolf, Asmus Freytag, Tex Texin, editors; "<cite>Character Model for the World W
ide Web</cite>", W3C Recommendation, 15 February 2005 |
2917 <dd>(<code><a href="http://www.w3.org/TR/charmod/">http://www.w3.org/TR/charmo
d/</a></code>) | 2917 <dd>(<code><a href="http://www.w3.org/TR/charmod/">http://www.w3.org/TR/charmo
d/</a></code>) |
2918 | 2918 |
2919 <dt>[FLEX] | 2919 <dt>[FLEX] |
2920 <dd><a name="refsFLEX"></a> "<cite>Flex: The Lexical Scanner Generator</cite>"
, Version 2.3.7, ISBN 1882114213 | 2920 <dd><a name="refsFLEX"></a> "<cite>Flex: The Lexical Scanner Generator</cite>"
, Version 2.3.7, ISBN 1882114213 |
2921 | 2921 |
2922 <dt>[HTML4] | 2922 <dt>[HTML4] |
2923 <dd><a name="refsHTML4"></a> Dave Ragget, Arnaud Le Hors, Ian Jacobs, editors;
"<cite>HTML 4.01 Specification</cite>", W3C Recommendation, 24 December 1999 | 2923 <dd><a name="refsHTML4"></a> Dave Ragget, Arnaud Le Hors, Ian Jacobs, editors;
"<cite>HTML 4.01 Specification</cite>", W3C Recommendation, 24 December 1999 |
2924 <dd>(<a href="http://www.w3.org/TR/html4/"><code>http://www.w3.org/TR/html4/</
code></a>) | 2924 <dd>(<a href="http://www.w3.org/TR/html4/"><code>http://www.w3.org/TR/html4/</
code></a>) |
2925 | 2925 |
2926 <dt>[MATH] | 2926 <dt>[MATH] |
2927 <dd><a name="refsMATH"></a> Patrick Ion, Robert Miner, editors; "<cite>Mathema
tical Markup Language (MathML) 1.01</cite>", W3C Recommendation, revision of 7 J
uly 1999 | 2927 <dd><a name="refsMATH"></a> Patrick Ion, Robert Miner, editors; "<cite>Mathema
tical Markup Language (MathML) 1.01</cite>", W3C Recommendation, revision of 7 J
uly 1999 |
2928 <dd>(<code><a href="http://www.w3.org/TR/REC-MathML/">http://www.w3.org/TR/REC
-MathML/</a></code>) | 2928 <dd>(<code><a href="http://www.w3.org/TR/REC-MathML/">http://www.w3.org/TR/REC
-MathML/</a></code>) |
2929 | 2929 |
2930 <dt>[RFC3066] | 2930 <dt>[RFC3066] |
2931 <dd><a name="refsRFC3066"></a> H. Alvestrand; "<cite>Tags for the Identificati
on of Languages</cite>", Request for Comments 3066, January 2001 | 2931 <dd><a name="refsRFC3066"></a> H. Alvestrand; "<cite>Tags for the Identificati
on of Languages</cite>", Request for Comments 3066, January 2001 |
2932 <dd>(<a href="http://www.ietf.org/rfc/rfc3066.txt"><code>http://www.ietf.org/r
fc/rfc3066.txt</code></a>) | 2932 <dd>(<a href="http://www.ietf.org/rfc/rfc3066.txt"><code>http://www.ietf.org/r
fc/rfc3066.txt</code></a>) |
2933 | 2933 |
2934 <dt>[STTS] | 2934 <dt>[STTS] |
2935 <dd><a name=refsSTTS></a> Daniel Glazman; "<cite>Simple Tree Transformation Sh
eets 3</cite>", Electricité de France, submission to the W3C, 11 November
1998 | 2935 <dd><a name=refsSTTS></a> Daniel Glazman; "<cite>Simple Tree Transformation Sh
eets 3</cite>", Electricité de France, submission to the W3C, 11 November
1998 |
2936 <dd>(<code><a href="http://www.w3.org/TR/NOTE-STTS3">http://www.w3.org/TR/NOTE
-STTS3</a></code>) | 2936 <dd>(<code><a href="http://www.w3.org/TR/NOTE-STTS3">http://www.w3.org/TR/NOTE
-STTS3</a></code>) |
2937 | 2937 |
2938 <dt>[SVG] | 2938 <dt>[SVG] |
2939 <dd><a name="refsSVG"></a> Jon Ferraiolo, 藤沢 淳, Dean Jack
son, editors; "<cite>Scalable Vector Graphics (SVG) 1.1 Specification</cite>", W
3C Recommendation, 14 January 2003 | 2939 <dd><a name="refsSVG"></a> Jon Ferraiolo, 藤沢 淳, Dean Jack
son, editors; "<cite>Scalable Vector Graphics (SVG) 1.1 Specification</cite>", W
3C Recommendation, 14 January 2003 |
2940 <dd>(<code><a href="http://www.w3.org/TR/SVG/">http://www.w3.org/TR/SVG/</a></
code>) | 2940 <dd>(<code><a href="http://www.w3.org/TR/SVG/">http://www.w3.org/TR/SVG/</a></
code>) |
2941 | 2941 |
2942 <dt>[UNICODE]</dt> | 2942 <dt>[UNICODE]</dt> |
2943 <dd><a name="refsUNICODE"></a> <cite><a | 2943 <dd><a name="refsUNICODE"></a> <cite><a |
2944 href="http://www.unicode.org/versions/Unicode4.1.0/">The Unicode Standard, Ve
rsion 4.1</a></cite>, The Unicode Consortium. Boston, MA, Addison-Wesley, March
2005. ISBN 0-321-18578-1, as amended by <a href="http://www.unicode.org/versions
/Unicode4.0.1/">Unicode 4.0.1</a> and <a href="http://www.unicode.org/versions/U
nicode4.1.0/">Unicode 4.1.0</a>. | 2944 href="http://www.unicode.org/versions/Unicode4.1.0/">The Unicode Standard, Ve
rsion 4.1</a></cite>, The Unicode Consortium. Boston, MA, Addison-Wesley, March
2005. ISBN 0-321-18578-1, as amended by <a href="http://www.unicode.org/versions
/Unicode4.0.1/">Unicode 4.0.1</a> and <a href="http://www.unicode.org/versions/U
nicode4.1.0/">Unicode 4.1.0</a>. |
2945 <dd>(<code><a href="http://www.unicode.org/versions/">http://www.unicode.org/v
ersions/</a></code>)</dd> | 2945 <dd>(<code><a href="http://www.unicode.org/versions/">http://www.unicode.org/v
ersions/</a></code>)</dd> |
2946 | 2946 |
2947 <dt>[XML10] | 2947 <dt>[XML10] |
2948 <dd><a name="refsXML10"></a> Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve
Maler, François Yergeau, editors; "<cite>Extensible Markup Language (XML
) 1.0 (Third Edition)</cite>", W3C Recommendation, 4 February 2004 | 2948 <dd><a name="refsXML10"></a> Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve
Maler, François Yergeau, editors; "<cite>Extensible Markup Language (XML
) 1.0 (Third Edition)</cite>", W3C Recommendation, 4 February 2004 |
2949 <dd>(<a href="http://www.w3.org/TR/REC-xml/"><code>http://www.w3.org/TR/REC-xm
l/</code></a>) | 2949 <dd>(<a href="http://www.w3.org/TR/REC-xml/"><code>http://www.w3.org/TR/REC-xm
l/</code></a>) |
2950 | 2950 |
2951 <dt>[XMLNAMES] | 2951 <dt>[XMLNAMES] |
2952 <dd><a name="refsXMLNAMES"></a> Tim Bray, Dave Hollander, Andrew Layman, edito
rs; "<cite>Namespaces in XML</cite>", W3C Recommendation, 14 January 1999 | 2952 <dd><a name="refsXMLNAMES"></a> Tim Bray, Dave Hollander, Andrew Layman, edito
rs; "<cite>Namespaces in XML</cite>", W3C Recommendation, 14 January 1999 |
2953 <dd>(<a href="http://www.w3.org/TR/REC-xml-names/"><code>http://www.w3.org/TR/
REC-xml-names/</code></a>) | 2953 <dd>(<a href="http://www.w3.org/TR/REC-xml-names/"><code>http://www.w3.org/TR/
REC-xml-names/</code></a>) |
2954 | 2954 |
2955 <dt>[YACC] | 2955 <dt>[YACC] |
2956 <dd><a name="refsYACC"></a> S. C. Johnson; "<cite>YACC — Yet another com
piler compiler</cite>", Technical Report, Murray Hill, 1975 | 2956 <dd><a name="refsYACC"></a> S. C. Johnson; "<cite>YACC — Yet another com
piler compiler</cite>", Technical Report, Murray Hill, 1975 |
2957 | 2957 |
2958 </dl> | 2958 </dl> |
2959 </body> | 2959 </body> |
2960 </html> | 2960 </html> |
OLD | NEW |