Created 2011 February 28. Modified 2011 March 1.
Inspired by PPK's article A Tale of Two Viewports and subsequent forays into the mobile web started me thinking about viewports and what they are.
So, what makes a viewport?
The eye is our viewport to the world of everything we see. The eye has a surface which captures what we see and we can zoom by moving toward and further away from an object.
Let's say an eye has a width and a height equal to 1 pupil, and that it looks at an object 1 pupil wide and high (The retina would be more realistically the viewport of the eye, but hey lets go with this).
At 100% zoom the field of vision would be entirely filled with the object. At 50% zoom the object would fill only a quarter of the field of vision; the width of the object appearing to halve, so too would the height, leaving an area one quarter the original size.
At 50% zoom we can fit two objects left to right in the field of vision. This equates to a resolution of 2 (field of vision) pupils per (eye) pupil, which sounds odd, but is the essence of resolution, I think.
The further away the eye gets from the object the lower the zoom value and the higher the resolution. The surface, and therefore field of view, normally remain constant.
What follows is probably a completely floored and futile attempt to figure out the resolution of the eye reading off a screen... but I was curious.
Reading Wikipedia a pupil ranges from 3-4 mm in light and to 4-9 mm in dark. Taking a value of 4 mm as average and a typical distance from a 72 dpi monitor of 25.4 cm we should be able to figure out the resolution of the eye. 4 mm = 4/25.4 inches = 0.15748031496063 inches. At 100% zoom looking at a 72 dpi screen we get 72×0.15748031496063 pixels = 11.338582677165354 pixels. With the monitor 25 cm away we get a zoom of 0.15748031496063/10, which gives a resolution of 11.338582677165354×10/0.15748031496063 = 720 dpi for the eye.
The screen is the viewport to the computer display. Its surface has a width and height, and it has a resolution. Resolution now sounds a little strange, what happened to zoom? However, on desktops and laptops we can change the resolution of the screen. When this is done the net result is a computer display that has zoomed.
A field of view also sounds a strange concept for a screen. Is the screen really looking at something? Yes, its view usually filled (at 100% zoom) with the operating system.
The computer display is the viewport to the operating system. It is usually transparent: its surface is the same as the screen and hasn't been zoomed. However the operating system can be zoomed. On OSX CTRL in combination with the scroll wheel zooms the operating system and hence changes the resolution (less pixels are shown within the field of view). Interestingly zooming out from 100% is not possible. What lies beyond the boundaries of the operating system will be left a mystery.
The Operating System can have elements to show in its own right like the taskbar or dock, but it mainly has a viewport to Application World.
Application World is a place where 1 or more applications can be seen. We're familiar with windows and having several open in different sizes and places on the screen. On mobile because the space is limited there is often only one application in application world.
An application again can have elements so show like menus etc. but again they mainly are about a viewport to a document.
In browsers we typically have an option to zoom into the document.
A document is a viewport to Element World. There are examples of course where there is also a document world above this where 1 or more document live within an application.
Element World is a place where 1 or more elements can be seen.
With HTML elements like iframes, elements become viewports to another document. Also, if zoom can applied to any element then that element would have a property of a viewport.
Suddenly anything and everything seems to turn into a viewport. It's a bit useless to get to a point where anything and everything is something; where definitions melt away like sugar paper in the mouth, yum. Maybe though it would make for a good school class excercise... to take any definition and dissolve it into nothingness/everythingness. And then resolve it to become useful again. hmm, not sure I'd know how to do that last part, anyway...
It would be great if this now nicely resolved back to how this relates to the mobile web etc. Maybe I'll get round to that.