<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=800"> <style> html { font-size: 16px; } body { width: 800px; margin: 0; overflow-y: hidden; } </style> <script src="resources/autosizingTest.js"></script> </head> <body> <div style="width: 400px; float: left"> <div style="width: 800px; float: left"> This text should be autosized to 40px computed font size (16 * 800/320), since the float:left causes this to be a new cluster, and it is 800px wide.<br> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> <div style="width: 600px"> This text should be autosized to 30px computed font-size (16 * 600/320), since its width:600px makes it wider than the lowest common ancestor of its enclosing cluster, hence it will itself become a cluster.<br> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> <div> This text should be autosized to 20px computed font-size (16 * 400 / 320), since it's not an autosizing cluster itself and its parent element is the enclosing autosizing cluster which is 400px wide.<br> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </div> </div> </body> </html>