Commit 35f007a7 authored by darin's avatar darin

Reviewed by Darin.

        Improved test to check offsetX/Y after dispatching instead of before.

        * fast/dom/window-xy-properties.html:
        * fast/dom/window-xy-properties-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a7ae2c3b
2006-06-28 Rob Buis <buis@kde.org>
Reviewed by Darin.
Improved test to check offsetX/Y after dispatching instead of before.
* fast/dom/window-xy-properties.html:
* fast/dom/window-xy-properties-expected.txt:
2006-06-27 Rob Buis <buis@kde.org>
Reviewed by Darin.
......@@ -33,6 +33,6 @@ PASS ev.pageX is 550
PASS ev.pageY is 550
PASS ev.layerX is 550
PASS ev.layerY is 550
PASS ev.offsetX is 550
PASS ev.offsetY is 550
PASS ev.offsetX is 542
PASS ev.offsetY is 542
......@@ -24,7 +24,7 @@ function mouseev(event) {
shouldBe("event.offsetX", "42");
shouldBe("event.offsetY", "542");
nrmouseclicks++;
} else {
} else if (nrmouseclicks == 2) {
shouldBe("event.clientX", "50");
shouldBe("event.clientY", "50");
shouldBe("event.pageX", "550");
......@@ -33,19 +33,23 @@ function mouseev(event) {
shouldBe("event.layerY", "50");
shouldBe("event.offsetX", "542");
shouldBe("event.offsetY", "42");
nrmouseclicks++;
// test initMouseEvent
window.scrollTo(500, 500);
ev = document.createEvent("MouseEvent");
ev.initMouseEvent("click", true, true, document.defaultView, 1, 50, 50, 50, 50, false, false, false, false, 0, document);
ev.initMouseEvent("mousedown", true, true, document.defaultView, 1, 50, 50, 50, 50, false, false, false, false, 0, document);
var child = document.getElementById('target');
child.dispatchEvent(ev);
} else {
shouldBe("ev.clientX", "50");
shouldBe("ev.clientY", "50");
shouldBe("ev.pageX", "550");
shouldBe("ev.pageY", "550");
shouldBe("ev.layerX", "550");
shouldBe("ev.layerY", "550");
shouldBe("ev.offsetX", "550");
shouldBe("ev.offsetY", "550");
shouldBe("ev.offsetX", "542");
shouldBe("ev.offsetY", "542");
}
}
function test() {
......@@ -70,7 +74,7 @@ function test() {
</script>
</head>
<body onload="test()">
<div style="background: red; width:2000px; height: 2000px" onmousedown="mouseev(event)">
<div id="target" style="background: red; width:2000px; height: 2000px" onmousedown="mouseev(event)">
</div>
<div id="console"></div>
</body>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment