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

Side by Side Diff: LayoutTests/svg/custom/resources/focus-event-handling.js

Issue 14859016: Don't force layout for mouse event hit tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix review comment Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 var focusinSeen = ""; 1 var focusinSeen = "";
2 var focusoutSeen = ""; 2 var focusoutSeen = "";
3 3
4 var rectElement = document.getElementById("rect1"); 4 var rectElement = document.getElementById("rect1");
5 var gElement = document.getElementById("g"); 5 var gElement = document.getElementById("g");
6 var useElement = document.getElementById("use"); 6 var useElement = document.getElementById("use");
7 var useElement2 = document.getElementById("usesymbol"); 7 var useElement2 = document.getElementById("usesymbol");
8 var switchElement = document.getElementById("switch"); 8 var switchElement = document.getElementById("switch");
9 var imgElement = document.getElementById("img"); 9 var imgElement = document.getElementById("img");
10 description("Test whether focusin and focusout events are dispatched and seen in the focusin/focusout event handlers: "); 10 description("Test whether focusin and focusout events are dispatched and seen in the focusin/focusout event handlers: ");
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 imgElement.setAttribute("onfocusout", "focusoutHandler(evt)"); 42 imgElement.setAttribute("onfocusout", "focusoutHandler(evt)");
43 43
44 function clickAt(x, y) 44 function clickAt(x, y)
45 { 45 {
46 eventSender.mouseMoveTo(x, y); 46 eventSender.mouseMoveTo(x, y);
47 eventSender.mouseDown(); 47 eventSender.mouseDown();
48 eventSender.mouseUp(); 48 eventSender.mouseUp();
49 } 49 }
50 50
51 if (window.eventSender) { 51 if (window.eventSender) {
52 // Mouse events only work after an initial layout
53 document.documentElement.offsetLeft;
52 54
53 // cause focusin and focusout 55 // cause focusin and focusout
54 clickAt(50, 50); 56 clickAt(50, 50);
55 clickAt(150, 250); 57 clickAt(150, 250);
56 shouldBeEqualToString('focusinSeen', 'rect1'); 58 shouldBeEqualToString('focusinSeen', 'rect1');
57 shouldBeEqualToString('focusoutSeen', 'rect1'); 59 shouldBeEqualToString('focusoutSeen', 'rect1');
58 60
59 clearFocusSeen(); 61 clearFocusSeen();
60 62
61 // cause focusin and focusout 63 // cause focusin and focusout
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 shouldBeEqualToString('focusinSeen', 'img'); 98 shouldBeEqualToString('focusinSeen', 'img');
97 shouldBeEqualToString('focusoutSeen', 'img'); 99 shouldBeEqualToString('focusoutSeen', 'img');
98 100
99 successfullyParsed = true; 101 successfullyParsed = true;
100 successfullyParsed = true; 102 successfullyParsed = true;
101 103
102 if (window.testRunner) 104 if (window.testRunner)
103 testRunner.notifyDone(); 105 testRunner.notifyDone();
104 } else 106 } else
105 alert("This test must be run via DRT!"); 107 alert("This test must be run via DRT!");
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/polyline-hittest.svg ('k') | LayoutTests/svg/custom/stroke-width-click.svg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698