| <!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> |