| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <style type="text/css" media="screen"> |
| .container { |
| height: 100px; |
| width: 100px; |
| margin: 30px; |
| outline: 1px solid black; |
| } |
| .box { |
| height: 100%; |
| width: 100%; |
| background-color: green; |
| } |
| #results { |
| margin-top: 100px; |
| } |
| </style> |
| <script src="../../2d/resources/transform-test-utils.js" type="text/javascript" charset="utf-8"></script> |
| <script type="text/javascript"> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| var gTests = [ |
| { 'transform' : 'translate3d(0, 0, 10px)', 'result' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 10, 1)' }, |
| { 'transform' : 'translateZ(10px)', 'result' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 10, 1)' }, |
| { 'transform' : 'rotate3d(0, 1, 0, 180deg)', 'result' : 'matrix3d(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1)' }, |
| { 'transform' : 'rotate3d(0, 0, 0, 180deg)', 'result' : 'matrix3d(1, 0, 0, 1, 0, 0)' }, |
| { 'transform' : 'translate3d(0, 0, 10px)', 'result' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 10, 1)' }, |
| { 'transform' : 'translate3d(0, 0, 10%)', 'result' : 'none' }, // percentage values not allowed in the z param |
| { 'transform' : 'translate3d(0, 0, 10)', 'result' : 'none' }, // must have units for the z param |
| { 'transform' : 'translateZ(10%)', 'result' : 'none' }, // percentage values not allowed in the z param |
| { 'transform' : 'translateZ(10)', 'result' : 'none' }, // must have units |
| { 'transform' : 'rotate3d(0, 1, 0, 180)', 'result' : 'none' }, // last value must be an angle |
| { 'transform' : 'rotate3d(0, 1, 0, 180px)', 'result' : 'none' }, // last value must be an angle |
| { 'transform' : 'rotate3d(0, 1, 0, 180px)', 'result' : 'none' }, // last value must be an angle |
| { 'transform' : 'perspective(400)', 'result' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)' }, // legacy |
| { 'transform' : 'perspective(400px)', 'result' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)' }, |
| { 'transform' : 'perspective(400em)', 'result' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.00015625, 0, 0, 0, 1)' }, |
| { 'transform' : 'perspective(50%)', 'result' : 'none' }, |
| { 'transform' : 'perspective(-400)', 'result' : 'none' }, |
| { 'transform' : 'perspective(0)', 'result' : 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -1, 0, 0, 0, 1)' }, |
| { 'transform' : 'perspective(none)', 'result' : 'matrix(1, 0, 0, 1, 0, 0)' }, |
| { 'transform' : 'perspective(400deg)', 'result' : 'none' }, // unit must be length |
| { 'transform' : 'perspective(banana)', 'result' : 'none' }, // unit must be length |
| ]; |
| |
| function runTests() |
| { |
| testTransforms(); |
| |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } |
| </script> |
| </head> |
| <body onload="runTests()"> |
| |
| <div class="container"> |
| <div id="test-box" class="box"></div> |
| </div> |
| |
| <div id="results"> |
| </div> |
| </body> |
| </html> |