X

iPhone 1.1.1 Safari has improved JavaScript performance; other new features

iPhone 1.1.1 Safari has improved JavaScript performance; other new features

Ben Wilson
3 min read

Apple's newly launched iPhone Dev Center (concerning the development of Web apps -- currently there's no information about native applications) for ADC members includes a section detailing changes in the version of Safari included with iPhone software/firmware 1.1.1. Among the "fixed problems" is a vague reference mentioning "improved performance of JavaScript."

In early July, we noted that JavaScript performance on the iPhone is (was) downright sluggish in most respects. Celtic Kane online offers a Javascript benchmark that tests various Javascript. In our informal tests, a MacBook Pro running at 1.83GHz with Mac OS X 10.4.10 and a Safari 3.x beta delivered test times of ~300 ms on average. Our in-house iPhones, at the time running iPhone software/firmware 1.0.x, delivered test times in excess of 9000 ms on average. Of course, benchmarks are benchmarks, so we tested a few of the most intensive AJAX Web apps in existence: games. While they all delivered smooth play on our MacBook Pro, they were virtually unplayable on the iPhone, exhibiting lazy movement and slow response to cursor input.

We tried running the same benchmarks on a non-hacked iPhone running software/firmware 1.1.1, and unfortunately, got similar results. Total duration for the benchmark gamut was still in excess of 9000 ms. We also tried some of the JavaScript-intensive games from our previous test, and they were still unplayable.

If you've found better performance on any JavaScript-intensive pages after the update, please let us know.

Other purported enhancements in the new version of 1.1.1 version of MobileSafari include:

  • Added device-width and device-height constants to the viewport meta tag to replace 320 and 480 screen dimensions respectively.
  • Now uses the lang property to select a keyboard to support localization. Deprecated.
  • Added debugging console to Safari on iPhone?turn on the console using the Safari > Developer settings.
  • Added onorientationchange property to the element, and orientation property to the window object in JavaScript to support orientation events. For example, you can now change the layout when the user changes from portrait to landscape orientation.
  • Added autocorrect and autocapitalize attributes to control whether or not automatic correction or capitalization are used in forms.
  • Added format-detection meta tag to control whether or not Safari on iPhone automatically detects telephone numbers on a webpage.
  • Added -webkit-tap-highlight-color CSS property to control the color of callout bubbles.
  • The onscroll event is now sent when the user pans the page.
  • The window.scrollTo() and window.scrollBy() methods work correctly.
  • The window.pageXOffset and window.pageYOffset properties return the correct values as opposed to always returning (0, 0).
  • The window.innerWidth and window.innerHeight properties also return the correct values (the size of the visible area).
  • Lessened restrictions on granting focus to form elements. Specifically, a page can now focus on an element in response to a user action, such as a tap.
  • Significant improvements to viewport meta tag. Changing the meta tag and tapping reload should now update the viewport of the page correctly.
  • Added window.console to print to the console (just like in Safari on the desktop).

For more undocumented features in iPhone software/firmware 1.1.1, see our special report.

Feedback? info@iphoneatlas.com.