tl;dr? Looking for a way to enable GPU acceleration on Android Chrome & default browser for the mechanism shown in the link below.
UPDATE 2 (2014-01-13 13:25:30Z): As per bref.it's comment, the issue was resolved with Android 4.4 KitKat but my previous fix now breaks it!
UPDATE 1 (2012-11-01 17:54:09Z): The problem seems to be related to the transformation matrix reported by the computed style of the transformed element, which returns a pixel value. Will attempt to create a Modernizr test to explore potential solutions.
I have devised a method to slide a container to reveal horizontally aligned sub-sections, essentially sliding tabs. To minimize the use of JavaScript and utilize CSS for stylistic aspects, I have kept the JS involvement minimal by only modifying an attribute on the wrapper:
(w/ left)http://jsfiddle.net/barney/VPJuq/ (on mobile devices, append /show/ to the fiddle URL to view the results independently)
Explanation on how this operates: treating the tabs as inline-block elements allows me to specify white-space: nowrap (remaining code collapses whitespace between tabs) and stack them horizontally without clearing or returning while maintaining full width within their parent. Additionally, setting a negative left offset to the wrapper achieves the desired effect. Pretty neat, isn't it?
Providing some context: the interface is intended for native mobile applications where core functionality relies on cutting-edge mobile-specific technology through a UIWebView, currently supported only on Android.
The primary issue is that transform: translate works smoother than left or margin-left transitions, especially on Android where non-translated transitions are sluggish even on modern devices with the latest OS versions. However, Android appears to interpret the box model differently when utilizing translate. For demonstration, here's a transform-based version that functions similarly to the earlier example and works on browsers supporting translate3d...
(w/ translate)http://jsfiddle.net/barney/EJ7ve
When tested on iPhone or Firefox on Android, improved frame rates are observed. Yet, on Chrome and the default Android browser, the translateX offset of -100% refers to the entire space occupied by all three tabs, resulting in the wrapper sliding partially, making none of the tabs visible. This discrepancy is puzzling as transform percentages should relate to the full box model of the element being transformed based on computed styles.
Is this behavior best described as a bug?
No pure-CSS approach seems viable for identifying and resolving this issue. One potential solution involves selectively applying rules based on the User-Agent string for Android, which unfortunately limits cross-browser compatibility. Another workaround could involve adjusting the percentage calculations specifically for Android, although this may lead to browser-specific behavior and entail knowing the number of tabs in advance.
(w/ translate — for Android update: unnecessary and breaks on Android 4.4 KitKat)http://jsfiddle.net/barney/nFt5t/
Despite these efforts, the problem persists under certain conditions such as orientation changes, where the offset behaves correctly in other browsers but not consistently in Android. Experimentation with applying translations directly to the tabs yielded no improvement, particularly on Android's browser.
(w/ translate, working on Android's theory, not working on Android at all)
http://jsfiddle.net/barney/EJ7ve/9
Your insights or suggestions for a comprehensive cross-browser resolution would be greatly appreciated.