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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/image-inside-link.html

Issue 2043433002: Make click targets inside links work. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4
5 <div id="wrapper1">
6 <a href="#"><img id="img1" alt="Delicious cake" src="resources/cake.png"></a >
7 </div>
8
9 <script>
10 async_test(function(t)
11 {
12 var axImg = accessibilityController.accessibleElementById("img1");
13 axImg.addNotificationListener(function(notification) {
14 if (notification == 'Clicked') {
15 document.getElementById("wrapper1").style.display = "none";
16 t.done();
17 }
18 });
19
20 var img = document.getElementById("img1");
21 img.addEventListener("click", function(e)
22 {
23 img.title = "clicked";
24 });
25 img.click();
26 }, "clicking an image via javascript sends an accessible click event");
27 </script>
28
29 <div id="wrapper2">
30 <a href="#"><img id="img2" alt="Delicious cake" src="resources/cake.png"></a >
31 </div>
32
33 <script>
34 async_test(function(t)
35 {
36 var axEvent = false;
37 var domEvent = false;
38 var clickEventHandler = function(e)
39 {
40 if (e == 'Clicked')
41 axEvent = true;
42
43 // "which" is a known property on MouseEvent objects.
44 if (e.which) {
45 img.title = "clicked";
46 domEvent = true;
47 }
48
49 if (axEvent && domEvent) {
50 document.getElementById("wrapper2").style.display = "none";
51 t.done();
52 }
53 };
54
55 var axImg = accessibilityController.accessibleElementById("img2");
56 axImg.addNotificationListener(clickEventHandler);
57 var img = document.getElementById("img2");
58 img.addEventListener("click", clickEventHandler);
59 axImg.press();
60 }, "clicking an image via accessibility sends both an accessible and a DOM click event");
61 </script>
62
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698