Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: third_party/WebKit/LayoutTests/fast/html/area-coords.html

Issue 1618373002: Add tests for HTMLAreaElement coords/shape and processing model (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment in W3CImportExpectations. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/html/area-coords.html
diff --git a/third_party/WebKit/LayoutTests/fast/html/area-coords.html b/third_party/WebKit/LayoutTests/fast/html/area-coords.html
new file mode 100644
index 0000000000000000000000000000000000000000..7ea8dfde04a49d684e1a948a2c6628e2a4627794
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/html/area-coords.html
@@ -0,0 +1,47 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLAreaElement coords parsing</title>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<style>
+ body { margin: 0 }
+</style>
+<img src=resources/images/blue-border.png usemap=#x id=img width=300 height=300>
+<map name=x><area id=area></map>
+<script src=resources/hit-test.js></script>
+<script>
+tests = [
+ {desc: 'COMMA', shape: 'rect', coords: "2,2,10,10", hit: hitRect},
+ {desc: 'SEMICOLON', shape: 'rect', coords: "2;2;10;10", hit: hitRect},
+ {desc: 'SPACE', shape: 'rect', coords: "2 2 10 10", hit: hitRect},
+ {desc: 'TAB', shape: 'rect', coords: "2\t2\t10\t10", hit: hitRect},
+ {desc: 'FORM FEED', shape: 'rect', coords: "2\f2\f10\f10", hit: hitRect},
+ {desc: 'LINE FEED', shape: 'rect', coords: "2\n2\n10\n10", hit: hitRect},
+ {desc: 'CARRIGAGE RETURN', shape: 'rect', coords: "2\r2\r10\r10", hit: hitRect},
+ {desc: 'LINE TABULATION', shape: 'rect', coords: "2\u000b2\u000b10\u000b10", hit: hitNone},
+ {desc: 'LINE NEXT', shape: 'rect', coords: "2\u00852\u008510\u008510", hit: hitNone},
+ {desc: 'EN QUAD', shape: 'rect', coords: "2\u20002\u200010\u200010", hit: hitNone},
+ {desc: 'abc between numbers', shape: 'rect', coords: "2a2b20c20,2,10,10", hit: hitRect},
+ {desc: 'COLON between numbers', shape: 'rect', coords: "2:2:20:20,2,10,10", hit: hitRect},
+ {desc: 'U+0000 between numbers', shape: 'rect', coords: "2\u00002\u000020\u000020,2,10,10", hit: hitRect},
+ {desc: 'leading COMMA', shape: 'rect', coords: ",2,2,10,10", hit: hitRect},
+ {desc: 'leading SPACE', shape: 'rect', coords: " 2,2,10,10", hit: hitRect},
+ {desc: 'leading SEMICOLON', shape: 'rect', coords: ";2,2,10,10", hit: hitRect},
+ {desc: 'trailing COMMA', shape: 'rect', coords: "2,2,10,", hit: hitNone},
+ {desc: 'trailing SPACE', shape: 'rect', coords: "2,2,10 ", hit: hitNone},
+ {desc: 'trailing SEMICOLON', shape: 'rect', coords: "2,2,10;", hit: hitNone},
+ {desc: 'PERCENT', shape: 'rect', coords: "2%,2%,10%,10%", hit: hitRect},
+ {desc: 'CSS units', shape: 'rect', coords: "2in,2in,10cm,10cm", hit: hitRect},
+ {desc: 'float', shape: 'rect', coords: "1.4,1.4,10,10", hit: hitRect},
+ {desc: 'number starting with PERIOD', shape: 'rect', coords: ".4,.4,10,10", hit: [[area, 1, 1], [img, 0, 0]]},
+ {desc: 'sci-not', shape: 'rect', coords: "2,2,1e1,1e1", hit: hitRect},
+ {desc: 'leading/trailing garbage', shape: 'rect', coords: "='2,2,10,10' ", hit: hitRect},
+ {desc: 'non-ascii garbage', shape: 'rect', coords: "“2,2,10,10\"", hit: hitRect},
+ {desc: 'URL garbage with number', shape: 'rect', coords: "2,2,10ls/spain/holidays/regions/10/Canary+Islands/Canary+Islands.html", hit: hitNone},
+ {desc: 'consecutive COMMAs', shape: 'rect', coords: "2,,10,10", hit: hitNone},
+ {desc: 'consecutive SPACEs', shape: 'rect', coords: "2 10,10", hit: hitNone},
+ {desc: 'consecutive SEMICOLONs', shape: 'rect', coords: "2;;10,10", hit: hitNone},
+ {desc: 'several consecutive separators', shape: 'rect', coords: ",,2;,;2,;,10 \t\r\n10;;", hit: hitRect},
+ {desc: 'one too many numbers, trailing COMMA', shape: 'poly', coords: "100,100,120,100,100,120,300,", hit: hitPoly},
+];
+</script>

Powered by Google App Engine
This is Rietveld 408576698