Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / mouse-cursor-style-change-iframe.html
blob05bc39f43bedffdcfecb6136327d97965b760576
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <script src="resources/expect-cursor-update.js"></script>
4 <style type="text/css">
5 #container {
6 padding: 30px;
7 cursor: pointer;
8 border: 1px solid blue;
10 .wait {
11 cursor: wait !important;
13 iframe {
14 width: 300px;
16 </style>
17 </head>
18 <body>
19 <p id="description"></p>
20 <div id="container">
21 <iframe id="frame" srcdoc="<body style='height: 500px; cursor: text;'></body>"></iframe>
22 </div>
23 <div id="console"></div>
24 <script>
25 description("Test that a cursor change that occurs due only to a style change correctly considers iframes.");
27 // Ensure the shouldBe calls don't trigger any changes during our testing that could alter behavior.
28 setPrintTestResultsLazily();
30 if (!window.eventSender) {
31 testFailed('This test requires DumpRenderTree');
34 if (window.testRunner) {
35 testRunner.dumpAsText();
36 testRunner.waitUntilDone();
37 window.jsTestIsAsync = true;
40 var container = document.getElementById('container');
42 var y;
43 var frame = document.getElementById('frame');
45 if (window.eventSender) {
46 frame.onload = function() {
47 debug('Mouse moved to cursor changing div');
48 eventSender.mouseMoveTo(100, container.offsetTop + 5);
49 shouldBeEqualToString('window.internals.getCurrentCursorInfo()', 'type=Hand hotSpot=0,0');
51 debug('Changing cursor style');
52 container.classList.add('wait');
53 expectCursorUpdate('type=Wait hotSpot=0,0', function() {
54 debug('');
56 debug('Now move mouse onto iframe above cursor changing div');
57 y = frame.offsetTop + 10;
58 eventSender.mouseMoveTo(100, y);
59 shouldBe('document.elementFromPoint(100, y)', 'frame');
60 shouldBeTrue('document.elementsFromPoint(100, y).indexOf(container) > 0');
61 shouldBeFalse('internals.cursorUpdatePending');
62 shouldBeEqualToString('window.internals.getCurrentCursorInfo()', 'type=IBeam hotSpot=0,0');
63 debug('');
65 debug('Changing cursor style of the background should not affect the cursor as it sits over the iframe');
66 container.classList.remove('wait');
67 expectCursorUpdate('type=IBeam hotSpot=0,0', function() {
68 finishJSTest();
69 });
70 });
73 } else {
74 function toggleCursorInMainFrame() {
75 container.classList.toggle('cursor');
76 requestAnimationFrame(toggleCursorInMainFrame);
78 requestAnimationFrame(toggleCursorInMainFrame);
80 </script>
81 </body>
82 </html>