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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/svg/dom/path-queries-pathLength.html
diff --git a/third_party/WebKit/LayoutTests/svg/dom/path-queries-pathLength.html b/third_party/WebKit/LayoutTests/svg/dom/path-queries-pathLength.html
new file mode 100644
index 0000000000000000000000000000000000000000..462acfc4ab08f1f1db7d507ff7f8c7ee10ea17c1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/dom/path-queries-pathLength.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<title>SVGPathElement path metrics query w/ pathLength</title>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<script>
+setup(function() {
+ window.path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ path.setAttribute('d', 'M0,0L100,0L100,100');
+ path.setAttribute('pathLength', '1000');
+});
+
+test(function() {
+ assert_approx_equals(path.getTotalLength(), 200, 1e-5);
+}, document.title+', getTotalLength');
+
+test(function() {
+ var point = path.getPointAtLength(50);
+ assert_approx_equals(point.x, 50, 1e-5);
+ assert_approx_equals(point.y, 0, 1e-5);
+ var point = path.getPointAtLength(150);
+ assert_approx_equals(point.x, 100, 1e-5);
+ assert_approx_equals(point.y, 50, 1e-5);
+}, document.title+', getPointAtLength');
+
+test(function() {
+ assert_equals(path.getPathSegAtLength(50), 1);
+ assert_equals(path.getPathSegAtLength(150), 2);
+}, document.title+', getPathSegAtLength');
+</script>

Powered by Google App Engine
This is Rietveld 408576698