blob: 9c4952cb60f7e518f794770ec0912a7577cca5c5 [file] [log] [blame]
SVG 1.1 dynamic update tests
Tests dynamic updates of the '-webkit-transform' on SVG element
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Also, to pass the test, the rectangles should be rotated with 45deg
Transform via style attribute
PASS rect1.style.webkitTransform is "translate(100px, 25px) scale(2) rotate(45deg)"
PASS dumpMatrix(rect1.getCTM()) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect1.style.webkitTransform)) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect1.style.webkitTransform)) is dumpMatrix(rect1.getCTM())
PASS rect1.transform.baseVal.numberOfItems is 0
PASS rect1.getAttribute('transform') is null
PASS dumpMatrix(rect2.getCTM()) is "[0.0 1.0 -1.0 0.0 1000.0 1000.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect2.style.webkitTransform)) is "[1.0 0.0 0.0 1.0 0.0 0.0]"
PASS rect2.style.webkitTransform is "translate(100px, 25px) scale(2) rotate(45deg)"
PASS dumpMatrix(rect2.getCTM()) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect2.style.webkitTransform)) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect2.style.webkitTransform)) is dumpMatrix(rect2.getCTM())
PASS rect2.transform.baseVal.numberOfItems is 2
PASS rect2.getAttribute('transform') is "translate(1000, 1000) rotate(90)"
PASS dumpTransform(rect2.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 1000.0 1000.0]"
PASS dumpTransform(rect2.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"
Transform via CSS
PASS rect3.style.webkitTransform is "translate(100px, 25px) scale(2) rotate(45deg)"
PASS dumpMatrix(rect3.getCTM()) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect3.style.webkitTransform)) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect3.style.webkitTransform)) is dumpMatrix(rect3.getCTM())
PASS rect3.transform.baseVal.numberOfItems is 0
PASS rect3.getAttribute('transform') is null
PASS dumpMatrix(rect2.getCTM()) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect2.style.webkitTransform)) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS rect4.style.webkitTransform is "translate(100px, 25px) scale(2) rotate(45deg)"
PASS dumpMatrix(rect4.getCTM()) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect4.style.webkitTransform)) is "[1.4 1.4 -1.4 1.4 100.0 25.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect4.style.webkitTransform)) is dumpMatrix(rect4.getCTM())
PASS rect4.transform.baseVal.numberOfItems is 2
PASS rect4.getAttribute('transform') is "translate(1000, 1000) rotate(90)"
PASS dumpTransform(rect4.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 1000.0 1000.0]"
PASS dumpTransform(rect4.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"
Transform on wrapper div
PASS rect5.style.webkitTransform is ""
PASS dumpMatrix(rect5.getCTM()) is "[1.0 0.0 0.0 1.0 0.0 0.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect5.style.webkitTransform)) is "[1.0 0.0 0.0 1.0 0.0 0.0]"
PASS dumpMatrix(new WebKitCSSMatrix(rect5.style.webkitTransform)) is dumpMatrix(rect5.getCTM())
PASS rect5.transform.baseVal.numberOfItems is 0
PASS rect5.getAttribute('transform') is null
PASS successfullyParsed is true
TEST COMPLETE