5 div.block { height:
400px; border:
1px solid black; margin:
10px; }
10 Following actions must not emit resize events: page load, dynamic content generation, and page scaling.
<br/>
12 The spec DOM Level
2 Events states that the resize event occurs when document view size (a.k.a layout size) is changed. Refer to http://www.w3.org/TR/DOM-Level-
2-Events/events.html
<br/>
13 However, showing/hiding scrollbars shouldn't be considered a layout size change. Refer to webkit.org/b/
80242<br/>
15 <div id=expandingblock
>
17 <pre id=
"console"></pre>
18 <script src=
"../../resources/js-test.js"></script>
20 var resizeEventCount
= 0;
21 window
.onresize = function() {
25 if (window
.testRunner
) {
26 testRunner
.dumpAsText();
27 testRunner
.waitUntilDone();
30 setTimeout(showScrollbar
, 20);
32 // Add many div blocks to increase document height more than view height.
33 function showScrollbar() {
34 for (var i
= 0; i
< 10; i
++) {
35 var el
= document
.createElement('div');
36 el
.setAttribute('class','block');
37 document
.getElementById('expandingblock').appendChild(el
);
39 setTimeout(scalePage
, 20);
41 function scalePage() {
43 window
.internals
.setPageScaleFactor(3);
44 setTimeout(finish
, 20);
47 // No resize events are acceptable.
48 shouldBe("resizeEventCount", "0");
49 if (window
.testRunner
)
50 testRunner
.notifyDone();