summaryrefslogtreecommitdiffstats
path: root/layout/reftests/font-face/resize-detector-iframe.html
blob: 5283f22c082360f610065d6425b96ea8b59e8af3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE HTML>
<html>
<head>
	<title>Resize-notifying IFRAME</title>
	<script type="application/ecmascript">

	var gTarget;

	/* the test is done after the next resize */
	function arm() {
		gTarget = -1;
		window.addEventListener("resize", got_resize, false);
	}

	/* the test is done after the next resize to wider than the current width */
	function arm_for_wider() {
		gTarget = window.innerWidth;
		window.addEventListener("resize", got_resize, false);
	}

	function got_resize() {
		if (window.innerWidth > gTarget) {
			// Remove the class="reftest-wait" from the top window
			window.top.document.documentElement.removeAttribute("class");
		}
	}

	</script>
</head>
<body>
</body>
</html>