tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

area-coords.html (3162B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>HTMLAreaElement coords parsing</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 tests = [
     14  {desc: 'COMMA', shape: 'rect', coords: "2,2,10,10", hit: hitRect},
     15  {desc: 'SEMICOLON', shape: 'rect', coords: "2;2;10;10", hit: hitRect},
     16  {desc: 'SPACE', shape: 'rect', coords: "2 2 10 10", hit: hitRect},
     17  {desc: 'TAB', shape: 'rect', coords: "2\t2\t10\t10", hit: hitRect},
     18  {desc: 'FORM FEED', shape: 'rect', coords: "2\f2\f10\f10", hit: hitRect},
     19  {desc: 'LINE FEED', shape: 'rect', coords: "2\n2\n10\n10", hit: hitRect},
     20  {desc: 'CARRIGAGE RETURN', shape: 'rect', coords: "2\r2\r10\r10", hit: hitRect},
     21  {desc: 'LINE TABULATION', shape: 'rect', coords: "2\u000b2\u000b10\u000b10", hit: hitNone},
     22  {desc: 'LINE NEXT', shape: 'rect', coords: "2\u00852\u008510\u008510", hit: hitNone},
     23  {desc: 'EN QUAD', shape: 'rect', coords: "2\u20002\u200010\u200010", hit: hitNone},
     24  {desc: 'abc between numbers', shape: 'rect', coords: "2a2b20c20,2,10,10", hit: hitRect},
     25  {desc: 'COLON between numbers', shape: 'rect', coords: "2:2:20:20,2,10,10", hit: hitRect},
     26  {desc: 'U+0000 between numbers', shape: 'rect', coords: "2\u00002\u000020\u000020,2,10,10", hit: hitRect},
     27  {desc: 'leading COMMA', shape: 'rect', coords: ",2,2,10,10", hit: hitRect},
     28  {desc: 'leading SPACE', shape: 'rect', coords: " 2,2,10,10", hit: hitRect},
     29  {desc: 'leading SEMICOLON', shape: 'rect', coords: ";2,2,10,10", hit: hitRect},
     30  {desc: 'trailing COMMA', shape: 'rect', coords: "2,2,10,", hit: hitNone},
     31  {desc: 'trailing SPACE', shape: 'rect', coords: "2,2,10 ", hit: hitNone},
     32  {desc: 'trailing SEMICOLON', shape: 'rect', coords: "2,2,10;", hit: hitNone},
     33  {desc: 'PERCENT', shape: 'rect', coords: "2%,2%,10%,10%", hit: hitRect},
     34  {desc: 'CSS units', shape: 'rect', coords: "2in,2in,10cm,10cm", hit: hitRect},
     35  {desc: 'float', shape: 'rect', coords: "1.4,1.4,10,10", hit: hitRect},
     36  {desc: 'number starting with PERIOD', shape: 'rect', coords: ".4,.4,10,10", hit: [[area, 1, 1], [img, 0, 0]]},
     37  {desc: 'sci-not', shape: 'rect', coords: "2,2,1e1,1e1", hit: hitRect},
     38  {desc: 'leading/trailing garbage', shape: 'rect', coords: "='2,2,10,10' ", hit: hitRect},
     39  {desc: 'non-ascii garbage', shape: 'rect', coords: "“2,2,10,10\"", hit: hitRect},
     40  {desc: 'URL garbage with number', shape: 'rect', coords: "2,2,10ls/spain/holidays/regions/10/Canary+Islands/Canary+Islands.html", hit: hitNone},
     41  {desc: 'consecutive COMMAs', shape: 'rect', coords: "2,,10,10", hit: hitNone},
     42  {desc: 'consecutive SPACEs', shape: 'rect', coords: "2  10,10", hit: hitNone},
     43  {desc: 'consecutive SEMICOLONs', shape: 'rect', coords: "2;;10,10", hit: hitNone},
     44  {desc: 'several consecutive separators', shape: 'rect', coords: ",,2;,;2,;,10 \t\r\n10;;", hit: hitRect},
     45  {desc: 'one too many numbers, trailing COMMA', shape: 'poly', coords: "100,100,120,100,100,120,300,", hit: hitPoly},
     46 ];
     47 </script>