| Index: LayoutTests/fast/events/mouse-cursor-style-change-iframe.html
|
| diff --git a/LayoutTests/fast/events/mouse-cursor-style-change-iframe.html b/LayoutTests/fast/events/mouse-cursor-style-change-iframe.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..30b3a1adc8afcecbee6370e7046fe457f8c663cf
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/events/mouse-cursor-style-change-iframe.html
|
| @@ -0,0 +1,83 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../resources/js-test.js"></script>
|
| +<style type="text/css">
|
| + #container {
|
| + padding: 30px;
|
| + cursor: pointer;
|
| + border: 1px solid blue;
|
| + }
|
| + .wait {
|
| + cursor: wait !important;
|
| + }
|
| + iframe {
|
| + width: 300px;
|
| + }
|
| +</style>
|
| +</head>
|
| +<body>
|
| +<p id="description"></p>
|
| +<div id="container">
|
| + <iframe id="frame" srcdoc="<body style='height: 500px; cursor: text;'></body>"></iframe>
|
| +</div>
|
| +<div id="console"></div>
|
| +<script>
|
| + // Must be at least the value of cursorUpdateInterval from EventHandler.cpp
|
| + // which is used to throttle update requests.
|
| + var CURSOR_UPDATE_DELAY = 50;
|
| +
|
| + description("Test that a cursor change that occurs due only to a style change correctly considers iframes.");
|
| +
|
| + if (!window.eventSender) {
|
| + testFailed('This test requires DumpRenderTree');
|
| + }
|
| +
|
| + if (window.testRunner) {
|
| + testRunner.dumpAsText();
|
| + testRunner.waitUntilDone();
|
| + window.jsTestIsAsync = true;
|
| + }
|
| +
|
| + var container = document.getElementById('container');
|
| +
|
| + var y;
|
| + var frame;
|
| +
|
| + if (window.eventSender) {
|
| + debug('Mouse moved to cursor changing div');
|
| + eventSender.mouseMoveTo(100, container.offsetTop + 5);
|
| + debug('Cursor Info: ' + window.internals.getCurrentCursorInfo(document));
|
| + shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=Hand hotSpot=0,0');
|
| +
|
| + debug('Changing cursor style');
|
| + container.classList.add('wait');
|
| + setTimeout(function() {
|
| + shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=Wait hotSpot=0,0');
|
| + debug('');
|
| +
|
| + debug('Now move mouse onto iframe above cursor changing div');
|
| + frame = document.getElementById('frame');
|
| + y = frame.offsetTop + 10;
|
| + eventSender.mouseMoveTo(100, y);
|
| + shouldBe('document.elementFromPoint(100, y)', 'frame');
|
| + shouldBeTrue('document.elementsFromPoint(100, y).indexOf(container) > 0');
|
| + shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=IBeam hotSpot=0,0');
|
| + debug('');
|
| +
|
| + debug('Changing cursor style of the background should not affect the cursor as it sits over the iframe');
|
| + container.classList.remove('wait');
|
| + setTimeout(function() {
|
| + shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=IBeam hotSpot=0,0');
|
| + finishJSTest();
|
| + }, CURSOR_UPDATE_DELAY);
|
| + }, CURSOR_UPDATE_DELAY);
|
| +
|
| + } else {
|
| + function toggleCursorInMainFrame() {
|
| + container.classList.toggle('cursor');
|
| + requestAnimationFrame(toggleCursorInMainFrame);
|
| + }
|
| + requestAnimationFrame(toggleCursorInMainFrame);
|
| + }
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|