css3-selectors-lang-002

:lang(es), lang="es" on parent

WeasyPrint

This browser

Flags
script

Source

 1 <!DOCTYPE html>
 2 <html lang="en"><head>
 3 <meta charset="utf-8">
 4 <title>:lang(es), lang="es" on parent</title>
 5 <link href="mailto:ishida@w3.org" rel="author" title="Richard Ishida">
 6 <link href="http://www.w3.org/TR/css3-selectors/#lang-pseudo" rel="help">
 7 <script src="/resources/testharness.js"></script>
 8 <script src="/resources/testharnessreport.js"></script>
 9 <style type="text/css">
10 .test div { width: 50px; }
11 #box:lang(es) { width: 100px; }
12 </style>
13 </head>
14 <body>
15 
16 
17 
18 <div lang="es" class="test"><div id="box">&nbsp;</div></div>
19 
20 
21 <script>
22 test(function() {
23 assert_equals(document.getElementById('box').offsetWidth, 100);
24 }, "A :lang value that matches an identical lang attribute value on a parent element will produce styling.");
25 </script>
26 
27 <div id="log"></div>
28 
29 
30 
31 </body></html>