the-lang-attribute-010.html (1491B)
1 <!DOCTYPE html> 2 <html lang="" > 3 <head> 4 <meta charset="utf-8"/> 5 <meta http-equiv="Content-Language" content="ko" > 6 <title>lang="" vs meta Content-Language</title> 7 <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> 8 <link rel='help' href='https://html.spec.whatwg.org/multipage/#the-lang-and-xml:lang-attributes'> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <meta name='flags' content='dom'> 12 <style type='text/css'> 13 #colonlangcontroltest { color: red; font-weight: bold; width: 400px; } 14 #colonlangcontroltest:lang(xx) { display:none; } 15 .test div { width: 50px; } 16 #box:lang(ko) { width: 100px; } 17 </style> 18 </head> 19 <body> 20 21 22 23 <div class="test"><div id="box"> </div></div> 24 <p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p> 25 26 27 <!--Notes: 28 29 This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail. 30 31 --> 32 <script> 33 test(function() { 34 assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0) 35 assert_equals(document.getElementById('box').offsetWidth, 50); 36 }, "If the meta Content-Language element contains a language declaration but the html element uses an empty lang value, the UA will not recognize the language declared in the meta Content-Language element."); 37 </script> 38 39 <div id='log'></div> 40 41 </body> 42 </html>