Index: LayoutTests/svg/text/getcharnumatposition-multiple-fragments.html |
diff --git a/LayoutTests/svg/text/getcharnumatposition-multiple-fragments.html b/LayoutTests/svg/text/getcharnumatposition-multiple-fragments.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6af2bfcad8018ca5ad26267082e3984a36e5646e |
--- /dev/null |
+++ b/LayoutTests/svg/text/getcharnumatposition-multiple-fragments.html |
@@ -0,0 +1,21 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<svg height="0"> |
+ <defs><path id="p" d="M0,20h100"/></defs> |
+ <text y="20" font-size="20" font-family="Ahem"><textPath xlink:href="#p">AAAA</textPath></text> |
+</svg> |
+<script> |
+test(function() { |
+ var text = document.querySelector('text'); |
+ var extents = text.getExtentOfChar(0); |
+ var point = document.querySelector('svg').createSVGPoint(); |
+ point.x = extents.width / 2; |
+ point.y = 10; |
+ for (var i = 0; i < 4; ++i) { |
+ assert_equals(text.getCharNumAtPosition(point), i); |
+ |
+ point.x += extents.width; |
+ } |
+}, 'SVGTextContentElement.getCharNumAtPosition w/ multiple fragments per text box.'); |
+</script> |