Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / text / getcharnumatposition-multiple-fragments.html
blob6af2bfcad8018ca5ad26267082e3984a36e5646e
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <svg height="0">
5 <defs><path id="p" d="M0,20h100"/></defs>
6 <text y="20" font-size="20" font-family="Ahem"><textPath xlink:href="#p">AAAA</textPath></text>
7 </svg>
8 <script>
9 test(function() {
10 var text = document.querySelector('text');
11 var extents = text.getExtentOfChar(0);
12 var point = document.querySelector('svg').createSVGPoint();
13 point.x = extents.width / 2;
14 point.y = 10;
15 for (var i = 0; i < 4; ++i) {
16 assert_equals(text.getCharNumAtPosition(point), i);
18 point.x += extents.width;
20 }, 'SVGTextContentElement.getCharNumAtPosition w/ multiple fragments per text box.');
21 </script>