OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html style="font-size: 16px"> | 2 <html style="font-size: 16px"> |
3 <head> | 3 <head> |
4 | 4 |
5 <meta name="viewport" content="width=800"> | 5 <meta name="viewport" content="width=800"> |
6 <style> | 6 <style> |
7 body { | 7 body { |
8 width: 800px; | 8 width: 800px; |
9 margin: 0; | 9 margin: 0; |
10 overflow-y: hidden; | 10 overflow-y: hidden; |
11 } | 11 } |
| 12 /* Avoid complications from scrollbar changing the width which changes the |
| 13 * text autosizing multiplier. Mobile uses overlay scrollbars anyway. |
| 14 */ |
| 15 textarea::-webkit-scrollbar { |
| 16 display: none; |
| 17 } |
12 </style> | 18 </style> |
13 | 19 |
14 <script> | 20 <script> |
15 if (window.internals) { | 21 if (window.internals) { |
16 window.internals.settings.setTextAutosizingEnabled(true); | 22 window.internals.settings.setTextAutosizingEnabled(true); |
17 window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); | 23 window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480); |
18 } else if (window.console && console.warn) { | 24 } else if (window.console && console.warn) { |
19 console.warn("This test depends on the Text Autosizing setting being true, s
o run it in DumpRenderTree, or manually enable Text Autosizing, and either use a
mobile device with 320px device-width (like Nexus S or iPhone), or define HACK_
FORCE_TEXT_AUTOSIZING_ON_DESKTOP."); | 25 console.warn("This test depends on the Text Autosizing setting being true, s
o run it in DumpRenderTree, or manually enable Text Autosizing, and either use a
mobile device with 320px device-width (like Nexus S or iPhone), or define HACK_
FORCE_TEXT_AUTOSIZING_ON_DESKTOP."); |
20 } | 26 } |
21 </script> | 27 </script> |
22 | 28 |
23 </head> | 29 </head> |
24 <body> | 30 <body> |
25 | 31 |
26 <textarea rows="12" style="width: 100%; font-size: 16px"> | 32 <textarea rows="12" style="width: 100%; font-size: 16px"> |
27 The text inside this textarea should be autosized to 40px computed font-size (16
* 800/320). Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do ei
usmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim venia
m, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo conse
quat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolo
re eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sun
t in culpa qui officia deserunt mollit anim id est laborum. | 33 The text inside this textarea should be autosized to 40px computed font-size (16
* 800/320). Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do ei
usmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim venia
m, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo conse
quat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolo
re eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sun
t in culpa qui officia deserunt mollit anim id est laborum. |
28 </textarea> | 34 </textarea> |
29 | 35 |
30 </body> | 36 </body> |
31 </html> | 37 </html> |
OLD | NEW |