1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/imptests/editing/selecttest/test-iframe.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +<!doctype html> 1.5 +<title>Selection test iframe</title> 1.6 +<link rel=author title="Aryeh Gregor" href=ayg@aryeh.name> 1.7 +<body> 1.8 +<script src=common.js></script> 1.9 +<script> 1.10 +"use strict"; 1.11 + 1.12 +// This script only exists because we want to evaluate the range endpoints 1.13 +// in each iframe using that iframe's local variables set up by common.js. It 1.14 +// just creates a range with the endpoints given by 1.15 +// eval(window.testRangeInput), and assigns the result to window.testRange. If 1.16 +// there's an exception, it's assigned to window.unexpectedException. 1.17 +// Everything else is to be done by the script that created the iframe. 1.18 +window.unexpectedException = null; 1.19 + 1.20 +function run() { 1.21 + window.unexpectedException = null; 1.22 + try { 1.23 + window.testRange = rangeFromEndpoints(eval(window.testRangeInput)); 1.24 + } catch(e) { 1.25 + window.unexpectedException = e; 1.26 + } 1.27 +} 1.28 + 1.29 +// Remove the scripts so they don't run repeatedly when the iframe is 1.30 +// reinitialized 1.31 +[].forEach.call(document.querySelectorAll("script"), function(script) { 1.32 + script.parentNode.removeChild(script); 1.33 +}); 1.34 + 1.35 +testDiv.style.display = "none"; 1.36 +</script>