css3-selectors-lang-006

:lang(es-MX), lang="es"

WeasyPrint

This browser

Flags
script

Source

 1 <!DOCTYPE html>
 2 <html lang="en"><head>
 3 <meta charset="utf-8">
 4 <title>:lang(es-MX), lang="es"</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  		#colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
12 		#colonlangcontroltest:lang(xx) { display:none; }
13 #box:lang(es-MX) { width: 100px; }
14 </style>
15 </head>
16 <body>
17 
18 
19 
20 <div class="test"><div lang="es" id="box">&nbsp;</div></div>
21 <p lang="xx" id="colonlangcontroltest">This test failed because it relies on :lang for results, but :lang is not supported by this browser.
22 
23 
24 <!--Notes:
25 This tests a detail related to :lang support. If :lang is not supported, a message will appear and the test will fail.
26 -->
27 <script>
28 test(function() {
29 assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
30 assert_equals(document.getElementById('box').offsetWidth, 50);
31 }, "A :lang value will NOT match a lang attribute value when the former contains more subtags.");
32 </script>
33 
34 </p><div id="log"></div>
35 
36 
37 
38 </body></html>