-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
51 lines (47 loc) · 1.51 KB
/
index.html
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<title>looper demo</title>
<style>
body {
font-family: sans-serif;
}
.modal {
background: grey;
color: white;
padding: 10px;
height: 50px;
line-height: 50px;
text-align: center;
width: 50px;
}
</style>
</head>
<body>
<h1>Looper Demo</h1>
<p>
This page has an example of leaky code. 'Show' and 'Hide' buttons toggle
the visibility of a modal. The show handler makes a new element, but the
hide method never removes it. Looper can help identify leaks by exercising
actions that should be clean.
</p>
<ol>
<li>Open the "Profile" panel of the Webkit Developer Tools.</li>
<li>Select "Take Heap Snapshot" and click "Take Snapshot" to record a fresh snapshot.</li>
<li>Click the "Loop" button on the page and let it finish.</li>
<li>Select "Take Heap Snapshot" and click "Take Snapshot" to record a snapshot after the leak has been introduced.</li>
</ol>
<hr />
<button id="show-modal-button">Show</button>
<button id="hide-modal-button">Hide</button>
<hr />
<button id="start-loop-button">Loop</button>
<input id="count" value="53" />
<label for="count">times</label>
<button id="reset-button">Reset</button>
<button id="looper-loop-button">Looper Loop</button>
<span id="log"></span>
<hr />
<script type="module" src="sample-leaky-app.js"></script>
<script type="module" src="demo.js"></script>
</body>
</html>