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

Side by Side Diff: LayoutTests/fast/events/mouse-cursor-style-change-iframe.html

Issue 1121433003: Fix mouse cursor update timer to be page-global instead of per-frame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: bokan cr feedback Created 5 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/mouse-cursor-style-change-iframe-expected.txt » ('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/js-test.js"></script>
3 <style type="text/css">
4 #container {
5 padding: 30px;
6 cursor: pointer;
7 border: 1px solid blue;
8 }
9 .wait {
10 cursor: wait !important;
11 }
12 iframe {
13 width: 300px;
14 }
15 </style>
16 </head>
17 <body>
18 <p id="description"></p>
19 <div id="container">
20 <iframe id="frame" srcdoc="<body style='height: 500px; cursor: text;'></body >"></iframe>
21 </div>
22 <div id="console"></div>
23 <script>
24 // Must be at least the value of cursorUpdateInterval from EventHandler.cpp
25 // which is used to throttle update requests.
26 var CURSOR_UPDATE_DELAY = 50;
27
28 description("Test that a cursor change that occurs due only to a style chang e correctly considers iframes.");
29
30 if (!window.eventSender) {
31 testFailed('This test requires DumpRenderTree');
32 }
33
34 if (window.testRunner) {
35 testRunner.dumpAsText();
36 testRunner.waitUntilDone();
37 window.jsTestIsAsync = true;
38 }
39
40 var container = document.getElementById('container');
41
42 var y;
43 var frame;
44
45 if (window.eventSender) {
46 debug('Mouse moved to cursor changing div');
47 eventSender.mouseMoveTo(100, container.offsetTop + 5);
48 debug('Cursor Info: ' + window.internals.getCurrentCursorInfo(document)) ;
49 shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=Hand hotSpot=0,0');
50
51 debug('Changing cursor style');
52 container.classList.add('wait');
53 setTimeout(function() {
54 shouldBeEqualToString('window.internals.getCurrentCursorInfo(documen t)', 'type=Wait hotSpot=0,0');
55 debug('');
56
57 debug('Now move mouse onto iframe above cursor changing div');
58 frame = document.getElementById('frame');
59 y = frame.offsetTop + 10;
60 eventSender.mouseMoveTo(100, y);
61 shouldBe('document.elementFromPoint(100, y)', 'frame');
62 shouldBeTrue('document.elementsFromPoint(100, y).indexOf(container) > 0');
63 shouldBeEqualToString('window.internals.getCurrentCursorInfo(documen t)', 'type=IBeam hotSpot=0,0');
64 debug('');
65
66 debug('Changing cursor style of the background should not affect the cursor as it sits over the iframe');
67 container.classList.remove('wait');
68 setTimeout(function() {
69 shouldBeEqualToString('window.internals.getCurrentCursorInfo(doc ument)', 'type=IBeam hotSpot=0,0');
70 finishJSTest();
71 }, CURSOR_UPDATE_DELAY);
72 }, CURSOR_UPDATE_DELAY);
73
74 } else {
75 function toggleCursorInMainFrame() {
76 container.classList.toggle('cursor');
77 requestAnimationFrame(toggleCursorInMainFrame);
78 }
79 requestAnimationFrame(toggleCursorInMainFrame);
80 }
81 </script>
82 </body>
83 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/mouse-cursor-style-change-iframe-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698