Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / text-autosizing / resize-window.html
blobd2ed704356485ffa55dcf5b9287859340fa938cd
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <style>
5 #autosize {
6 font-size: 10px;
8 </style>
9 <script src="resources/autosizingTest.js"></script>
10 <script>
11 function test() {
12 var fontSizeOriginal = getAutosizedFontSize();
13 setWindowSizeOverride(520, 480);
14 var fontSizeUpdated = getAutosizedFontSize();
16 if (fontSizeOriginal != fontSizeUpdated)
17 document.write('PASS');
18 else
19 document.write('FAIL. Expected font size to change but it stayed at ' + fontSizeOriginal);
20 if (window.testRunner)
21 testRunner.dumpAsText();
24 function getAutosizedFontSize() {
25 var autosizeContainer = document.getElementById('autosize');
26 var forceLayout = autosizeContainer.offsetWidth;
27 return parseInt(window.getComputedStyle(autosizeContainer).fontSize);
29 </script>
30 </head>
31 <body onload="test()">
32 <div id="autosize">
33 This test passes if this text changes size due to autosizing after a dynamic window size change occurs. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize.
34 </div>
35 </body>
36 </html>