forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSelectAll.html
36 lines (32 loc) · 995 Bytes
/
SelectAll.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
<!DOCTYPE html>
<html>
<body>
<script src="../resources/runner.js"></script>
<script>
PerfTestRunner.prepareToMeasureValuesAsync({
unit: 'ms',
done: function () {
var iframe = document.querySelector('iframe');
iframe.parentNode.removeChild(iframe);
}
});
function runTest() {
var iframe = document.querySelector('iframe');
iframe.contentWindow.getSelection().removeAllRanges();
iframe.contentDocument.body.offsetTop;
setTimeout(function () {
var startTime = PerfTestRunner.now();
iframe.contentDocument.execCommand('SelectAll');
iframe.contentDocument.body.offsetTop;
setTimeout(function () {
if (!PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime))
return;
PerfTestRunner.gc();
setTimeout(runTest, 0);
}, 0);
}, 0);
}
</script>
<iframe src="../Parser/resources/html5.html" onload="runTest()" width="800" height="600">
</body>
</html>