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

Side by Side Diff: LayoutTests/fast/events/mouse-focus-imagemap.html

Issue 15508003: Revert "Don't force layout for mouse event hit tests" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../js/resources/js-test-pre.js"></script> 4 <script src="../js/resources/js-test-pre.js"></script>
5 <body id="body"> 5 <body id="body">
6 6
7 <img id="image" usemap="#map" src="data:image/gif;base64,R0lGODlhAQABAIAAAOTm7AA AACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width="1000" height="1000" alt="" style=" border:1px solid black;"> 7 <img id="image" usemap="#map" src="data:image/gif;base64,R0lGODlhAQABAIAAAOTm7AA AACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width="1000" height="1000" alt="" style=" border:1px solid black;">
8 <map name="map" id="map"> 8 <map name="map" id="map">
9 9
10 <area id="focusable-area" tabindex="0" shape="rect" coords="0,0,500,500" hre f="#" role="img" title="Example 1"> 10 <area id="focusable-area" tabindex="0" shape="rect" coords="0,0,500,500" hre f="#" role="img" title="Example 1">
11 <area id="nonfocusable-area" tabindex="-1" shape="rect" coords="500,500,1000 ,1000" href="#" role="img" title="Example 2"> 11 <area id="nonfocusable-area" tabindex="-1" shape="rect" coords="500,500,1000 ,1000" href="#" role="img" title="Example 2">
12 </map> 12 </map>
13 13
14 <p id="description"></p> 14 <p id="description"></p>
15 <div id="console"></div> 15 <div id="console"></div>
16 16
17 <script> 17 <script>
18 18
19 description("This tests that a link in an image map with tabindex < 0 is not mouse focusable."); 19 description("This tests that a link in an image map with tabindex < 0 is not mouse focusable.");
20 20
21 // Mouse events only work after an initial layout
22 document.body.offsetLeft;
23
24 // First try to focus on the <area> that is focusable. 21 // First try to focus on the <area> that is focusable.
25 eventSender.mouseMoveTo(100, 100); 22 eventSender.mouseMoveTo(100, 100);
26 eventSender.mouseDown(); 23 eventSender.mouseDown();
27 eventSender.mouseUp(); 24 eventSender.mouseUp();
28 25
29 shouldBe("document.activeElement.id", "'focusable-area'"); 26 shouldBe("document.activeElement.id", "'focusable-area'");
30 27
31 // Try to focus on the <area> that is NOT focusable. Focus should still rema in on focusable-area. 28 // Try to focus on the <area> that is NOT focusable. Focus should still rema in on focusable-area.
32 eventSender.mouseMoveTo(700, 700); 29 eventSender.mouseMoveTo(700, 700);
33 eventSender.mouseDown(); 30 eventSender.mouseDown();
34 eventSender.mouseUp(); 31 eventSender.mouseUp();
35 32
36 // Some platforms (QT) set focus to the body if clicking on a non-focusable area. 33 // Some platforms (QT) set focus to the body if clicking on a non-focusable area.
37 shouldBe("document.activeElement.id == 'focusable-area' || document.activeEl ement.id == 'body'", "true"); 34 shouldBe("document.activeElement.id == 'focusable-area' || document.activeEl ement.id == 'body'", "true");
38 </script> 35 </script>
39 36
40 <script src="../js/resources/js-test-post.js"></script> 37 <script src="../js/resources/js-test-post.js"></script>
41 </body> 38 </body>
42 </html> 39 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/frame-click-focus.html ('k') | LayoutTests/fast/events/mouseclick-target-and-positioning.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698