Bug 1465070 [wpt PR 11228] - Clamp argument to SVGGeometryElement.getPointAtLength to [0, length], a=testonly
authorFredrik Söderquist <fs@opera.com>
Wed, 06 Jun 2018 16:34:28 +0000
changeset 476425 6424db14b6d5ab082bb7006836003de754ac1f67
parent 476424 bcd9d100884297d59bfb2c8766ee18d5d56669b9
child 476426 8b458f3d30b63afa745527bc31744f4971749224
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1465070, 11228, 847198, 1075332, 562422
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1465070 [wpt PR 11228] - Clamp argument to SVGGeometryElement.getPointAtLength to [0, length], a=testonly Automatic update from web-platform-testsClamp argument to SVGGeometryElement.getPointAtLength to [0, length] Per: https://svgwg.org/svg2-draft/types.html#__svg__SVGGeometryElement__getPointAtLength Bug: 847198 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I9067ce9f196453bd54560d5119ebc38d35c8ac86 Reviewed-on: https://chromium-review.googlesource.com/1075332 Reviewed-by: Stephen Chenney <schenney@chromium.org> Commit-Queue: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#562422} -- wpt-commits: a0061d718ef5e40e7b8107ebb60818c4a1f262df wpt-pr: 11228
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-01.svg
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -369589,16 +369589,22 @@
     ]
    ],
    "svg/types/scripted/SVGAnimatedRect.html": [
     [
      "/svg/types/scripted/SVGAnimatedRect.html",
      {}
     ]
    ],
+   "svg/types/scripted/SVGGeometryElement.getPointAtLength-01.svg": [
+    [
+     "/svg/types/scripted/SVGGeometryElement.getPointAtLength-01.svg",
+     {}
+    ]
+   ],
    "svg/types/scripted/SVGLength-px-with-context.html": [
     [
      "/svg/types/scripted/SVGLength-px-with-context.html",
      {}
     ]
    ],
    "svg/types/scripted/SVGLength-px.html": [
     [
@@ -608522,16 +608528,20 @@
   "svg/types/scripted/SVGAnimatedPreserveAspectRatio.html": [
    "e2667461c918fceecc4aca58ff5713a98df347c0",
    "testharness"
   ],
   "svg/types/scripted/SVGAnimatedRect.html": [
    "dfc7ec677df247b015ef360793c7e5f0c926e45f",
    "testharness"
   ],
+  "svg/types/scripted/SVGGeometryElement.getPointAtLength-01.svg": [
+   "73c1c15179f02b637a68939ba08faa4f90af8e5b",
+   "testharness"
+  ],
   "svg/types/scripted/SVGLength-px-with-context.html": [
    "a605dba2368aa00a3cd3343739c05cdbbd930205",
    "testharness"
   ],
   "svg/types/scripted/SVGLength-px.html": [
    "bb59838c8535eb21cae98d741e5be4a0368e06cb",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-01.svg
@@ -0,0 +1,44 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+     xmlns:xlink="http://www.w3.org/1999/xlink"
+     xmlns:html="http://www.w3.org/1999/xhtml">
+  <title>SVGGeometryElement.prototype.getPointAtLength clamps its argument to [0, length]</title>
+  <metadata>
+    <html:link rel="help" href="https://svgwg.org/svg2-draft/types.html#__svg__SVGGeometryElement__getPointAtLength"/>
+    <html:meta name="assert" content="SVGGeometryElement.prototype.getPointAtLength clamps its argument."/>
+  </metadata>
+  <g stroke="blue">
+    <line id="line" x1="50" y1="60" x2="100" y2="60"/>
+    <path id="path" d="M40,70L110,70"/>
+  </g>
+  <html:script src="/resources/testharness.js"/>
+  <html:script src="/resources/testharnessreport.js"/>
+  <script><![CDATA[
+  test(function() {
+    let line = document.getElementById('line');
+    let point = line.getPointAtLength(-10);
+    assert_equals(point.x, 50, 'starting x');
+    assert_equals(point.y, 60, 'starting y');
+  }, document.title+', less than zero (SVGLineElement).');
+  test(function() {
+    let path = document.getElementById('path');
+    let point = path.getPointAtLength(-10);
+    assert_equals(point.x, 40, 'starting x');
+    assert_equals(point.y, 70, 'starting y');
+  }, document.title+', less than zero (SVGPathElement).');
+
+  test(function() {
+    let line = document.getElementById('line');
+    assert_less_than(line.getTotalLength(), 80);
+    let point = line.getPointAtLength(80);
+    assert_equals(point.x, 100, 'ending x');
+    assert_equals(point.y, 60, 'ending y');
+  }, document.title+', greater than \'length\' (SVGLineElement).');
+  test(function() {
+    let path = document.getElementById('path');
+    assert_less_than(path.getTotalLength(), 80);
+    let point = path.getPointAtLength(80);
+    assert_equals(point.x, 110, 'ending x');
+    assert_equals(point.y, 70, 'ending y');
+  }, document.title+', greater than \'length\' (SVGPathElement).');
+  ]]></script>
+</svg>