Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: third_party/WebKit/LayoutTests/svg/dom/script-tests/path-pointAtLength.js

Issue 2413753004: Move getTotalLength and getPointAtLength methods from SVGPathElement to SVGGeometryElement. (Closed)
Patch Set: Align with review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 description("This tests getPointAtLength of SVG path.");
2
3 var pathElement = document.createElementNS("http://www.w3.org/2000/svg", "path") ;
4
5 function pointAtLengthOfPath(string) {
6 pathElement.setAttributeNS(null, "d", string);
7
8 var point = pathElement.getPointAtLength(700);
9 return "(" + Math.round(point.x) + ", " + Math.round(point.y) + ")";
10 }
11
12 shouldBe("pointAtLengthOfPath('M0,20 L400,20 L640,20')", "'(640, 20)'");
13 shouldBe("pointAtLengthOfPath('M0,20 L400,20 L640,20 z')", "'(580, 20)'");
14 shouldBe("pointAtLengthOfPath('M0,20 L400,20 z M 320,20 L640,20')", "'(100, 20)' ");
15 shouldBe("pointAtLengthOfPath('M0,20 L20,40')", "'(20, 40)'");
16
17 var successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698