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

Side by Side Diff: LayoutTests/fast/dom/replaced-image-map.html

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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x html1/DTD/xhtml1-strict.dtd"> 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x html1/DTD/xhtml1-strict.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head> 3 <head>
4 <title>Image map bug</title> 4 <title>Image map bug</title>
5 <script type="text/javascript"> 5 <script type="text/javascript">
6 if (window.testRunner) 6 if (window.testRunner)
7 testRunner.dumpAsText(); 7 testRunner.dumpAsText();
8 8
9 function changeMap() { 9 function changeMap() {
10 var i = document.getElementById('img'); 10 var i = document.getElementById('img');
11 var h = document.getElementById('mapHolder'); 11 var h = document.getElementById('mapHolder');
12 i.useMap = ''; 12 i.useMap = '';
13 h.innerHTML = '<map name="map"><area shape="rect" coords="0,0,300,200" alt=" " href="javascript:success()"></map>'; 13 h.innerHTML = '<map name="map"><area shape="rect" coords="0,0,300,200" alt=" " href="javascript:success()"></map>';
14 i.useMap = '#map'; 14 i.useMap = '#map';
15 } 15 }
16 16
17 function test() { 17 function test() {
18 changeMap(); 18 changeMap();
19 if (window.eventSender) { 19 if (window.eventSender) {
20 // Mouse events only work after an initial layout
21 document.body.offsetLeft;
20 eventSender.mouseMoveTo(100, 100); 22 eventSender.mouseMoveTo(100, 100);
21 eventSender.mouseDown(); 23 eventSender.mouseDown();
22 eventSender.mouseUp(); 24 eventSender.mouseUp();
23 } else 25 } else
24 document.getElementById("log").innerHTML = "Please click the image"; 26 document.getElementById("log").innerHTML = "Please click the image";
25 } 27 }
26 28
27 function success() { 29 function success() {
28 document.getElementById("log").innerHTML = "SUCCESS"; 30 document.getElementById("log").innerHTML = "SUCCESS";
29 } 31 }
30 32
31 function fail() { 33 function fail() {
32 document.getElementById("log").innerHTML = "FAIL"; 34 document.getElementById("log").innerHTML = "FAIL";
33 } 35 }
34 </script> 36 </script>
35 </head> 37 </head>
36 <body onload="test()"> 38 <body onload="test()">
37 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=9504">bug 9504</a>: img tag rewritten by innerHTML doesn't use image map.</p> 39 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=9504">bug 9504</a>: img tag rewritten by innerHTML doesn't use image map.</p>
38 <div id=log>Testing...</div> 40 <div id=log>Testing...</div>
39 <div> 41 <div>
40 <img id="img" width="300" height="200" usemap="#map" alt="" src="data:image/png; base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUC NdjYKhnAAABAgCAbV7tZwAAAABJRU5ErkJggg=="/> 42 <img id="img" width="300" height="200" usemap="#map" alt="" src="data:image/png; base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAAxJREFUC NdjYKhnAAABAgCAbV7tZwAAAABJRU5ErkJggg=="/>
41 </div> 43 </div>
42 <div id="mapHolder"><map name="map"><area shape="rect" coords="0,0,300,200" alt= "" title="First" href="javascript:fail()"></map></div> 44 <div id="mapHolder"><map name="map"><area shape="rect" coords="0,0,300,200" alt= "" title="First" href="javascript:fail()"></map></div>
43 </body> 45 </body>
44 </html> 46 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/Window/window-xy-properties.html ('k') | LayoutTests/fast/events/capture-on-target.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698