Upstream version 10.38.220.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / text-autosizing / removing-clusters-while-disabled.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4
5 <meta name="viewport" content="width=800">
6 <style>
7 html { font-size: 16px; }
8 body { width: 800px; margin: 0; overflow-y: hidden; }
9 </style>
10
11 <script src="resources/autosizingTest.js"></script>
12
13 </head>
14 <body>
15 <script>
16
17 function enableAutosizing(enabled) {
18     if (window.internals)
19         window.internals.settings.setTextAutosizingEnabled(enabled);
20 }
21
22 function addCluster() {
23     var cluster = '<table><tr><td>' +
24             'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut' +
25             'labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco' +
26             'laboris ni si ut aliquip ex ea commodo consequat.' +
27         '</td></tr></table>';
28     document.body.innerHTML += cluster;
29 }
30
31 function removeCluster() {
32     var tables = document.getElementsByTagName('table');
33     if (tables.length)
34         tables[tables.length - 1].parentElement.removeChild(tables[tables.length - 1]);
35 }
36
37 addCluster();
38 addCluster();
39 var forceLayout1 = document.body.offsetTop;
40 enableAutosizing(false);
41 removeCluster();
42 removeCluster();
43 var forceLayout2 = document.body.offsetTop;
44 enableAutosizing(true);
45 addCluster();
46 var forceLayout3 = document.body.offsetTop;
47 document.body.innerHTML = "PASS";
48
49 if (window.testRunner)
50     testRunner.dumpAsText();
51 </script>
52 </body>
53 </html>