Does this mean that css attribute based selectors are not working anymore? Sent via BlackBerry from T-Mobile
-----Original Message----- From: Sean Gilligan <[email protected]> Date: Fri, 09 Oct 2009 15:12:18 To: <[email protected]> Subject: WebKit experts: iPhone 3 not updating layout when body[orient="landscape"] attribute changes. This issue has come up in the iUI project but applies to other iPhone webapps as well. It looks like recent changes in iPhone OS (Mobile WebKit) and perhaps in Desktop Safari have broken the technique that iUI was using to indicate phone orientation (landscape or portrait) with CSS. Recent versions of iUI use the onorientationchange event (if present) or a timer event (as a fallback) to detect the orientation of the phone/device. There have been reports of this not working so I investigated, verified that there was a problem, wrote some simple test pages to help reproduce/debug, and made a fix to iUI to resolve the issue. The bug reports have been merged into Issue #138: http://code.google.com/p/iui/issues/detail?id=138 The tests are here: 1) http://iui-js.appspot.com/test/orient-test-attr.html 2) http://iui-js.appspot.com/test/orient-test-class.html The first one uses {{ body[orient="landscape"] }} to detect orientation and the second uses {{ body.landscape }} They both work correctly with the latest (from Mercurial) revision of iui.js -- however the test using {{ body[orient="landscape"] }} will not work on iPhone 3.0 without the recent change to iui.js. The change to iui.js is to set/update the class of landscape/portrait on the body in order for the second test file to work correctly. Ironically, the work to enable test #2 also fixes test #1. Apparently updating the @class attrtbute triggers a layout update which also causes the CSS engine to re-read the @orient attribute. The changes I made to iui.js are visible here (click "diff" to see the differences highlighted): http://code.google.com/p/iui/source/detail?r=638810bc3ef7e79d1dbcef94dfdd25a3e3555eb7 Is this a bug in WebKit or is it a feature? Is the change I made to iui.js the best solution or is there a better one? Thanks, Sean --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en -~----------~----~----~----~------~----~------~--~---
