css3-selectors-lang-009.html (1309B)
1 <!DOCTYPE html> 2 <html lang="en" > 3 <head> 4 <meta charset="utf-8"/> 5 <title>:lang(en-GB), lang="en-GB-scouse"</title> 6 <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> 7 <link rel='help' href='http://www.w3.org/TR/css3-selectors/#lang-pseudo'> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <style type='text/css'> 11 .test div { width: 50px; } 12 #colonlangcontroltest { color: red; font-weight: bold; width: 400px; } 13 #colonlangcontroltest:lang(xx) { display:none; } 14 #box:lang(en-GB) { width: 100px; } 15 </style> 16 </head> 17 <body> 18 19 20 21 <div class="test"><div id="box" lang="en-GB-scouse"> </div></div> 22 <p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser. 23 24 25 <!--Notes: 26 This tests a detail related to :lang support. If :lang is not supported, a message will appear and the test will fail. 27 --> 28 <script> 29 test(function() { 30 assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0) 31 assert_equals(document.getElementById('box').offsetWidth, 100); 32 }, "A :lang value with a multiple subtags will match a lang attribute value with multiple subtags as long as the first part is the same."); 33 </script> 34 35 <div id='log'></div> 36 37 </body> 38 </html>