Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / PerformanceTests / DOM / click_webkit_user_select_none.html
blob7f9bc58d7a913a61c2cd5a44013d886325d8f4be
1 <!DOCTYPE html>
2 <script src="../resources/runner.js"></script>
3 <div id="container" style="-webkit-user-select:none;"></div>
4 <textarea id="text"></textarea>
5 <script>
6 const NUMBER_OF_NODES = 10000;
8 var shadowRoot = container.createShadowRoot();
9 for (var i = 0; i < NUMBER_OF_NODES; i++) {
10 var child = document.createElement("div");
11 shadowRoot.appendChild(child);
13 var middle = shadowRoot.childNodes[NUMBER_OF_NODES / 2];
14 middle.textContent = "textToClick";
16 function clickNode(node) {
17 eventSender.mouseMoveTo(node.offsetLeft + 5, node.offsetTop+5);
18 eventSender.mouseDown();
19 eventSender.mouseUp();
21 clickNode(text);
23 PerfTestRunner.measureTime({
24 description: `Measures performance of clicking a -webkit-user-select:none DOM node which contains ${NUMBER_OF_NODES} children.`,
25 run: function () {
26 clickNode(text);
27 clickNode(middle);
29 });
30 </script>