Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>SVG elements accessible roles</title> |
michael@0 | 5 | <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 6 | |
michael@0 | 7 | <script type="application/javascript" |
michael@0 | 8 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | |
michael@0 | 10 | <script type="application/javascript" |
michael@0 | 11 | src="../common.js"></script> |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="../role.js"></script> |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../attributes.js"></script> |
michael@0 | 16 | |
michael@0 | 17 | <script type="application/javascript"> |
michael@0 | 18 | function doTests() |
michael@0 | 19 | { |
michael@0 | 20 | testRole("svg", ROLE_DIAGRAM); |
michael@0 | 21 | testRole("rect", ROLE_GRAPHIC); |
michael@0 | 22 | testRole("circle", ROLE_GRAPHIC); |
michael@0 | 23 | testRole("ellipse", ROLE_GRAPHIC); |
michael@0 | 24 | testRole("line", ROLE_GRAPHIC); |
michael@0 | 25 | testRole("polygon", ROLE_GRAPHIC); |
michael@0 | 26 | testRole("polyline", ROLE_GRAPHIC); |
michael@0 | 27 | testRole("path", ROLE_GRAPHIC); |
michael@0 | 28 | testRole("image", ROLE_GRAPHIC); |
michael@0 | 29 | |
michael@0 | 30 | SimpleTest.finish(); |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 34 | addA11yLoadEvent(doTests); |
michael@0 | 35 | </script> |
michael@0 | 36 | </head> |
michael@0 | 37 | <body> |
michael@0 | 38 | |
michael@0 | 39 | <a target="_blank" |
michael@0 | 40 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=822983" |
michael@0 | 41 | title="Map SVG graphic elements to accessibility API"> |
michael@0 | 42 | Bug 822983 |
michael@0 | 43 | </a> |
michael@0 | 44 | |
michael@0 | 45 | <p id="display"></p> |
michael@0 | 46 | <div id="content" style="display: none"></div> |
michael@0 | 47 | <pre id="test"> |
michael@0 | 48 | </pre> |
michael@0 | 49 | |
michael@0 | 50 | <svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg" |
michael@0 | 51 | xmlns:xlink="http://www.w3.org/1999/xlink"> |
michael@0 | 52 | <rect width="300" height="100" id="rect" |
michael@0 | 53 | style="fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)"/> |
michael@0 | 54 | <circle cx="100" cy="50" r="40" stroke="black" id="circle" |
michael@0 | 55 | stroke-width="2" fill="red"/> |
michael@0 | 56 | <ellipse cx="300" cy="80" rx="100" ry="50" id="ellipse" |
michael@0 | 57 | style="fill:yellow;stroke:purple;stroke-width:2"/> |
michael@0 | 58 | <line x1="0" y1="0" x2="200" y2="200" id="line" |
michael@0 | 59 | style="stroke:rgb(255,0,0);stroke-width:2"/> |
michael@0 | 60 | <polygon points="200,10 250,190 160,210" id="polygon" |
michael@0 | 61 | style="fill:lime;stroke:purple;stroke-width:1"/> |
michael@0 | 62 | <polyline points="20,20 40,25 60,40 80,120 120,140 200,180" id="polyline" |
michael@0 | 63 | style="fill:none;stroke:black;stroke-width:3" /> |
michael@0 | 64 | <path d="M150 0 L75 200 L225 200 Z" id="path"/> |
michael@0 | 65 | <image x1="25" y1="80" width="50" height="20" id="image" |
michael@0 | 66 | xlink:href="../moz.png"/> |
michael@0 | 67 | </svg> |
michael@0 | 68 | |
michael@0 | 69 | </body> |
michael@0 | 70 | </html> |