Thursday 15 January 2015

javascript - Tests for "preserve-3d" are not working on Android (via Browserstack)? -


According to caniuse.com, CSS 3D conversion completely changes since Android version 3, according to

When I run one of the tests below (e.g., Android 4.1, at Samsng Galaxy), they are right back. However, when I see a page that uses 3D conversion and Protected-3D it does not work. For example:

Test 1:

  (function (model, win) {modernizr.addTest ('csstransformspreserve3d', function () {Var prop = modernizr.prefixed ('transformstyle'); var val = 'preserve-3d'; var computedStyle; if (! Sahara) return false; prop = prop.replace (/ ([AZ]) / g, function ( Str, M1) {Returns' - '+ M 1. Loller Sees ();}). (/ ^ Ms - /,' - ms- '); ModernJerm testStyles (' # modernizr {'+ prop +': '+ Val +';} ', function (L, rule) {computedStyle = win.getComputedStyle? GetComputedStyle (el, null) .getPropertyValue (support):' ';}); return (computedStyle === val);} );} (Modern, window));   

Test 2:

  Modernizr.addTest ('csstransformspreserve3d', function () {var prop, val, cssText, ret; prop = 'transform- Style '; if (' webkitTransformStyle 'in document.documentElement.style) {prop =' -webkit- '+ prop;} val =' preserve-3d '; cssText =' #modernizr {'+ prop +': '+ val + ';}'; Modernizr.testStyles (cssText, function (L, rules) {ret = window.getComputedStyle? GetComputedStyle (el, null) .getPropertyValue (prop): '';}); return (ret === val );});   

Now I do not know what the problem is. What tests do not work? Does Android 4.1 not support "Protected-3D"? Or something else wrong?

There is a flaw in the emulator that you are experiencing; Your test case works fine on actual devices running Android 4.0.4 and 4.1.2. The Android emulator is simulated in GPU software which does not apply all necessary 3D functionality, which is why the rendering is incorrect despite the Feature Test being successful. (Browser supports them, but does not emulate underlying GPU.)

No comments:

Post a Comment