4 <link rel="stylesheet" href="resources/regions.css" type="text/css"></link>
5 <script src="../resources/runner.js"></script>
6 <script src="resources/regions.js"></script>
7 <style type="text/css">
16 function performSelection(paragraphCount) {
17 var paragraphs = document.getElementsByClassName("contentParagraph");
18 var selection = getSelection();
20 selection.collapse(paragraphs[0], 0);
22 for (var i = 1; i < paragraphCount; i++)
23 selection.extend(paragraphs[i], 0);
26 function createRegionsSelectionTest(regionCount) {
27 var article = createArticle(regionCount, 1);
28 article.className = "articleInFlow";
29 var regions = createRegions("600px", "auto", regionCount, "auto");
30 document.body.appendChild(article);
31 document.body.appendChild(regions);
33 description: "Testing selection with " + regionCount + " regions. Select text from first region to last one passing through all the regions.",
35 performSelection(regionCount);
38 window.getSelection().removeAllRanges();
41 document.body.removeChild(article);
42 document.body.removeChild(regions);
43 templateParagraph = null;
44 templateRegion = null;
49 PerfTestRunner.measureTime(createRegionsSelectionTest(100));