diff options
Diffstat (limited to 'dom/svg/test')
-rw-r--r-- | dom/svg/test/getCTM-helper.svg | 2 | ||||
-rw-r--r-- | dom/svg/test/test_getCTM.html | 38 |
2 files changed, 21 insertions, 19 deletions
diff --git a/dom/svg/test/getCTM-helper.svg b/dom/svg/test/getCTM-helper.svg index 835efc5067..5a21feb99f 100644 --- a/dom/svg/test/getCTM-helper.svg +++ b/dom/svg/test/getCTM-helper.svg @@ -1,6 +1,7 @@ <?xml version="1.0"?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100" height="100" viewBox="-11 -22 100 100"> + <g id="base"> <g transform="translate(3, 4)"> <svg x="1" y="2" width="888" height="999"> <g> @@ -44,4 +45,5 @@ </g> </svg> </g> + </g> </svg> diff --git a/dom/svg/test/test_getCTM.html b/dom/svg/test/test_getCTM.html index 57ea79c861..332d935811 100644 --- a/dom/svg/test/test_getCTM.html +++ b/dom/svg/test/test_getCTM.html @@ -28,36 +28,36 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=366697 SimpleTest.waitForExplicitFinish(); function runTest() { - var doc = $("svg").contentWindow.document; + let doc = $("svg").contentWindow.document; /* Minimal */ - var buggy = doc.getElementById("buggy"); + let buggy = doc.getElementById("buggy"); is(buggy.getCTM().e, 30, "buggy.getCTM().e"); is(buggy.getCTM().f, 40, "buggy.getCTM().f"); - var transrect1 = document.getElementById("transrect1"); + let transrect1 = document.getElementById("transrect1"); is(transrect1.getCTM().a, 2, "transrect1.getCTM().a"); is(transrect1.getCTM().d, 3, "transrect1.getCTM().d"); - var padsvg1 = document.getElementById("padsvg1"); - var ctm = padsvg1.getScreenCTM(); - var rect = padsvg1.getBoundingClientRect(); + let padsvg1 = document.getElementById("padsvg1"); + let ctm = padsvg1.getScreenCTM(); + let rect = padsvg1.getBoundingClientRect(); // Use isfuzzy to ignore some miniscule floating-point precision error on // certain platforms: isfuzzy(ctm.e - rect.x, 27, 0.0001, "padsvg1.getScreenCTM().e"); is(ctm.f - rect.y, 43, "padsvg1.getScreenCTM().f"); - var root = doc.documentElement; - var inner = doc.getElementById("inner"); - var g1 = doc.getElementById("g1"); - var outer = doc.getElementById("outer"); - var outer2 = doc.getElementById("outer2"); - var g2 = doc.getElementById("g2"); - var g3 = doc.getElementById("g3"); - var g4 = doc.getElementById("g4"); - var g5 = doc.getElementById("g5"); - var symbolRect = doc.getElementById("symbolRect"); - var fO = doc.getElementById("fO"); + let root = doc.documentElement; + let inner = doc.getElementById("inner"); + let g1 = doc.getElementById("g1"); + let outer = doc.getElementById("outer"); + let outer2 = doc.getElementById("outer2"); + let g2 = doc.getElementById("g2"); + let g3 = doc.getElementById("g3"); + let g4 = doc.getElementById("g4"); + let g5 = doc.getElementById("g5"); + let symbolRect = doc.getElementById("symbolRect"); + let fO = doc.getElementById("fO"); /* Tests the consistency with nearestViewportElement (code is from test_viewport.html) */ // root.nearestViewportElement == null @@ -102,8 +102,8 @@ function runTest() { is((function() { try { return outer.getScreenCTM().e; } catch (e) { return e; } })(), 46, "outer.getScreenCTM().e"); is((function() { try { return outer.getScreenCTM().f; } catch (e) { return e; } })(), 69, "outer.getScreenCTM().f"); // outer.farthestViewportElement == null (but actually == root) - is((function() { try { return outer2.getScreenCTM().e; } catch (e) { return e; } })(), -19, "outer2.getScreenCTM().e"); - is((function() { try { return outer2.getScreenCTM().f; } catch (e) { return e; } })(), -8, "outer2.getScreenCTM().f"); + is((function() { try { return outer2.getScreenCTM().e; } catch (e) { return e; } })(), -4, "outer2.getScreenCTM().e"); + is((function() { try { return outer2.getScreenCTM().f; } catch (e) { return e; } })(), 19, "outer2.getScreenCTM().f"); // g2.farthestViewportElement == outer (but actually == root) is((function() { try { return g2.getScreenCTM().e; } catch (e) { return e; } })(), 646, "g2.getScreenCTM().e"); is((function() { try { return g2.getScreenCTM().f; } catch (e) { return e; } })(), 769, "g2.getScreenCTM().f"); |