[webkit-dev] iPhone Orientation and Scaling

Christopher Allen ChristopherA at iPhoneWebDev.com
Tue Jul 3 20:50:24 PDT 2007

On 7/3/07, Jacob Basham <jacob.basham at gmail.com> wrote:
> I'm not too familiar with this particular topic, but why/should you
> need to know when safari scales? If I'm interpreting scaling
> correctly, your refering to zooming in and out. That should only be
> the browser scaling and not effect any GUI changes correct?

It has a severe effect on webapps that are trying to emulate the
iPhone UI at native resolution. All of a sudden buttons that were in
easy to tap are hidden off-screen, UI that was designed to fit in the
320x480 or 480x320 cease to function properly. In addition, having
control over scaling is often useful for other purposes beyond webaps,
for instance when you want to focus the page on something new after an
action by the user, for instance, after you do text entry in a
section, you may want to focus the user on the save button.

Apple demonstrated a native resolution webapp at the WWDC keynote, but
note that they didn't show what happened when you turned that app
landscape, or how it probably broke when you entered text into a field
and the page scaled. We are trying to solve those problems.

Some of the threads related to this topic in iPhoneWebDev:

We have figured out how best to detect orientation change and change
UI for landscape vs portrait -- see

A lot of discussion about best practices re: viewport -- see

Dealing with various problems of scaling -- see

The best way to hide the URL bar -- see

We are also figuring out how to create objects that drag using
two-finger drag since many mouse events are not passed to the iPhone's
javascript  -- see

-- Christopher Allen

More information about the webkit-dev mailing list