open-features-tokenization-innerheight-innerwidth.html (1945B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>HTML: window.open `features`: tokenization -- legacy size features `innerheight`, `innerwidth`</title> 4 <meta name=timeout content=long> 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/#apis-for-creating-and-navigating-browsing-contexts-by-name"> 6 7 <!-- user agents are not required to support open features other than `noopener` 8 and on some platforms position and size features don't make sense --> 9 <meta name="flags" content="may" /> 10 11 <script src="/resources/testharness.js"></script> 12 <script src="/resources/testharnessreport.js"></script> 13 <script src="/common/PrefixedPostMessage.js"></script> 14 <script> 15 var windowURL = 'resources/message-opener.html'; 16 var width = 'width=401,'; 17 var height = 'height=402,'; 18 19 [ 'innerwidth=401', 20 ' innerwidth = 401', 21 'innerwidth==401', 22 '\ninnerwidth= 401', 23 ',innerwidth=401,,', 24 'INNERWIDTH=401', 25 'innerWidth=401' 26 ].forEach((features, idx, arr) => { 27 async_test(t => { 28 var prefixedMessage = new PrefixedMessageTest(); 29 prefixedMessage.onMessage(t.step_func_done((data, e) => { 30 e.source.close(); 31 assert_equals(data.width, 401); 32 })); 33 var win = window.open(prefixedMessage.url(windowURL) + '&expected_innerWidth=401', '', height + features); 34 }, `${format_value(features)} should set width of opened window`); 35 }); 36 37 [ 'innerheight=402', 38 ' innerheight = 402', 39 'innerheight==402', 40 '\ninnerheight= 402', 41 ',innerheight=402,,', 42 'INNERHEIGHT=402', 43 'innerHeight=402' 44 ].forEach((features, idx, arr) => { 45 async_test(t => { 46 var prefixedMessage = new PrefixedMessageTest(); 47 prefixedMessage.onMessage(t.step_func_done((data, e) => { 48 e.source.close(); 49 assert_equals(data.height, 402); 50 })); 51 var win = window.open(prefixedMessage.url(windowURL) + '&expected_innerHeight=402', '', width + features); 52 }, `${format_value(features)} should set height of opened window`); 53 }); 54 55 </script>