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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/dom/path-queries-pathLength.html

Issue 1376523002: Support 'pathLength' for stroking operations on <path> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove double space Created 4 years, 10 months 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 <!DOCTYPE html>
2 <title>SVGPathElement path metrics query w/ pathLength</title>
3 <script src=../../resources/testharness.js></script>
4 <script src=../../resources/testharnessreport.js></script>
5 <script>
6 setup(function() {
7 window.path = document.createElementNS('http://www.w3.org/2000/svg', 'path') ;
8 path.setAttribute('d', 'M0,0L100,0L100,100');
9 path.setAttribute('pathLength', '1000');
10 });
11
12 test(function() {
13 assert_approx_equals(path.getTotalLength(), 200, 1e-5);
14 }, document.title+', getTotalLength');
15
16 test(function() {
17 var point = path.getPointAtLength(50);
18 assert_approx_equals(point.x, 50, 1e-5);
19 assert_approx_equals(point.y, 0, 1e-5);
20 var point = path.getPointAtLength(150);
21 assert_approx_equals(point.x, 100, 1e-5);
22 assert_approx_equals(point.y, 50, 1e-5);
23 }, document.title+', getPointAtLength');
24
25 test(function() {
26 assert_equals(path.getPathSegAtLength(50), 1);
27 assert_equals(path.getPathSegAtLength(150), 2);
28 }, document.title+', getPathSegAtLength');
29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698