area-shape.html (1768B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>HTMLAreaElement shape</title> 4 <script src=/resources/testharness.js></script> 5 <script src=/resources/testharnessreport.js></script> 6 <style> 7 body { margin: 0 } 8 </style> 9 <img src=/images/threecolors.png usemap=#x id=img width=300 height=300> 10 <map name=x><area id=area></map> 11 <script src=support/hit-test.js></script> 12 <script> 13 var tests = [ 14 {desc: 'missing value default', shape: null, coords: "2,2,10,10", hit: hitRect}, 15 {desc: 'missing value default', shape: null, coords: "20,40,10", hit: hitNone}, 16 {desc: 'missing value default', shape: null, coords: null, hit: hitNone}, 17 {desc: 'invalid value default', shape: 'foobar invalid', coords: "2,2,10,10", hit: hitRect}, 18 {desc: 'invalid value default', shape: '', coords: "2,2,10,10", hit: hitRect}, 19 20 {desc: 'empty string', shape: 'default', coords: "", hit: hitAll}, 21 {desc: 'omitted coords', shape: 'DEFAULT', coords: null, hit: hitAll}, 22 23 {desc: 'simple', shape: 'rect', coords: "2,2,10,10", hit: hitRect}, 24 {desc: 'simple', shape: 'rectangle', coords: "2,2,10,10", hit: hitRect}, 25 26 {desc: 'simple', shape: 'circle', coords: "20,40,10", hit: hitCircle}, 27 {desc: 'simple', shape: 'circ', coords: "20,40,10", hit: hitCircle}, 28 {desc: 'simple', shape: 'CIRCLE', coords: "20,40,10", hit: hitCircle}, 29 {desc: 'simple', shape: 'CIRC', coords: "20,40,10", hit: hitCircle}, 30 {desc: 'LATIN CAPITAL LETTER I WITH DOT ABOVE', shape: 'C\u0130RCLE', coords: "20,40,10", hit: hitNone}, 31 {desc: 'LATIN SMALL LETTER DOTLESS I', shape: 'c\u0131rcle', coords: "20,40,10", hit: hitNone}, 32 33 {desc: 'simple', shape: 'poly', coords: "100,100,120,100,100,120", hit: hitPoly}, 34 {desc: 'simple', shape: 'polygon', coords: "100,100,120,100,100,120", hit: hitPoly}, 35 ]; 36 </script>