That would solve a lot of compatibility problems. For example, less than 10% of my visitors use 800 X 600 display so I design for 1024 X 768. But I still hate to make my site difficult for even a small number of visitors.
With a function as I described above you could have 2 or 3 different site versions for different displays. I know you can design with percentages but that has its own set of problems. My idea would be ideal.