Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / only-child-pseudo-class.html
blobb7db4d791debed97ee4cae29e84a040ffd2532a9
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
6 <title>:only-child</title>
8 <style type='text/css'>
9 <!--
11 body { background: #fff; color: 000; font-family: Arial, Helvetica, sans-serif; }
12 pre { background: #fff; padding: 0.5em; }
13 li { background: #aaa; padding: 1em; width: 80%; margin: 0 0 3em; }
14 .test { display: block; padding: 0.75em; }
15 .base, .defaultgreen { background-color: #090; }
16 .defaultred { background-color: #900; }
18 .defaultred :only-child {
19 background-color: #090;
22 .defaultgreen :only-child {
23 background-color: #900;
26 -->
27 </style>
28 </head>
30 <body>
31 <p>This page is part of the <a href="http://www.css3.info">CSS3.info</a> <a href="http://www.css3.info/selectors-test/">CSS selectors test</a>. See more info on <a href="http://www.css3.info/preview/attribute-selectors.html">CSS3 selectors</a>.</p>
33 <div class='base'></div>
35 <ol>
36 <li>
37 <div class='defaultred'>
38 <div class='test required'></div>
39 </div>
41 <pre>div :only-child {
44 &lt;div&gt;
45 &lt;div&gt;&lt;/div&gt;
46 &lt;/div&gt;</pre>
48 <p>
49 The CSS selector should match the inner div element, because it is the only child of the outer div element
50 </p>
51 </li>
53 <li>
54 <div class='defaultred'>
55 <div class='test'></div>
56 <!-- Just a comment -->
57 </div>
59 <pre>div :only-child {
62 &lt;div&gt;
63 &lt;div&gt;&lt;/div&gt;
64 &lt;!-- Just a comment --&gt;
65 &lt;/div&gt;</pre>
67 <p>
68 The CSS selector should match the inner div element, because it is the only child of the outer div element
69 </p>
70 </li>
72 <li>
73 <div class='defaultred'>
74 <div class='test'></div>
76 </div>
78 <pre>div :only-child {
81 &lt;div&gt;
82 &lt;div&gt;&lt;/div&gt;
83 How about regular text...
84 &lt;/div&gt;</pre>
86 <p>
87 The CSS selector should match the inner div element, because it is the only child of the outer div element
88 </p>
89 </li>
91 <li>
92 <div class='defaultgreen'>
93 <div class='test default required'></div>
94 <blockquote></blockquote>
95 </div>
97 <pre>div :only-child {
100 &lt;div&gt;
101 &lt;div&gt;&lt;/div&gt;
102 &lt;blockquote&gt;&lt;/blockquote&gt;
103 &lt;/div&gt;</pre>
106 The CSS selector should not match the inner div element, because it not the only child
107 </p>
108 </li>
111 <li>
112 <div class='defaultgreen'>
113 <div id='appendChild' class='test default'></div>
114 </div>
116 <script type="text/javascript">
117 <!--
119 var ib = document.getElementById('appendChild');
120 ib.parentNode.appendChild(document.createElement("div"));
122 //-->
123 </script>
125 <pre>div :only-child {
128 &lt;div&gt;
129 &lt;div id='appendChild'&gt;&lt;/div&gt;
130 &lt;/div&gt;
132 var ib = document.getElementById('appendChild');
133 ib.parentElement.appendChild(document.createElement("div"));</pre>
136 The CSS selector should not match the original div element, because it is
137 not the only child anymore after another child is append by the Javascript code.
138 </p>
139 </li>
140 </ol>
141 </body>
142 </html>