open-features-tokenization-screenx-screeny.html (1913B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>HTML: window.open `features`: tokenization -- legacy position features `screenx`, `screeny`</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 [ 'screenx=141', 20 ' screenx = 141', 21 'screenx==141', 22 '\nscreenx= 141', 23 ',screenx=141,,', 24 'SCREENX=141', 25 'screenX=141' 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.left, 141); 32 })); 33 var win = window.open(prefixedMessage.url(windowURL) + '&expected_screenX=141', '', width + height + features); 34 }, `${format_value(features)} should set left position of opened window`); 35 }); 36 37 [ 'screeny=142', 38 ' screeny = 142', 39 'screeny==142', 40 '\nscreeny= 142', 41 ',screeny=142,,', 42 'SCREENY=142', 43 'screenY=142' 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.top, 142); 50 })); 51 var win = window.open(prefixedMessage.url(windowURL) + '&expected_screenY=142', '', width + height + features); 52 }, `${format_value(features)} should set top position of opened window`); 53 }); 54 55 </script>