Title: [86782] trunk/LayoutTests
- Revision
- 86782
- Author
- [email protected]
- Date
- 2011-05-18 12:35:25 -0700 (Wed, 18 May 2011)
Log Message
2011-05-18 Erik Arvidsson <[email protected]>
Reviewed by Ojan Vafai.
Expand layout test for testing the coords of a click on a label element
https://bugs.webkit.org/show_bug.cgi?id=61080
This expands the existing test to click on a label inside a scrolled element.
* fast/events/simulated-click-coords-expected.txt:
* fast/events/simulated-click-coords.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (86781 => 86782)
--- trunk/LayoutTests/ChangeLog 2011-05-18 19:30:48 UTC (rev 86781)
+++ trunk/LayoutTests/ChangeLog 2011-05-18 19:35:25 UTC (rev 86782)
@@ -1,3 +1,15 @@
+2011-05-18 Erik Arvidsson <[email protected]>
+
+ Reviewed by Ojan Vafai.
+
+ Expand layout test for testing the coords of a click on a label element
+ https://bugs.webkit.org/show_bug.cgi?id=61080
+
+ This expands the existing test to click on a label inside a scrolled element.
+
+ * fast/events/simulated-click-coords-expected.txt:
+ * fast/events/simulated-click-coords.html:
+
2011-05-18 Abhishek Arya <[email protected]>
Reviewed by Beth Dakin.
Modified: trunk/LayoutTests/fast/events/simulated-click-coords-expected.txt (86781 => 86782)
--- trunk/LayoutTests/fast/events/simulated-click-coords-expected.txt 2011-05-18 19:30:48 UTC (rev 86781)
+++ trunk/LayoutTests/fast/events/simulated-click-coords-expected.txt 2011-05-18 19:35:25 UTC (rev 86782)
@@ -1,6 +1,7 @@
Ensure that simulated click on label elements uses the original mouse coordinates.
Click Me
+ Click Me
PASS: event.clientX is same for both real and simulated event.
PASS: event.clientY is same for both real and simulated event.
PASS: event.layerX is same for both real and simulated event.
@@ -12,3 +13,14 @@
PASS: event.x is same for both real and simulated event.
PASS: event.y is same for both real and simulated event.
+PASS: event.clientX is same for both real and simulated event.
+PASS: event.clientY is same for both real and simulated event.
+PASS: event.layerX is same for both real and simulated event.
+PASS: event.layerY is same for both real and simulated event.
+PASS: event.pageX is same for both real and simulated event.
+PASS: event.pageY is same for both real and simulated event.
+PASS: event.screenX is same for both real and simulated event.
+PASS: event.screenY is same for both real and simulated event.
+PASS: event.x is same for both real and simulated event.
+PASS: event.y is same for both real and simulated event.
+
Modified: trunk/LayoutTests/fast/events/simulated-click-coords.html (86781 => 86782)
--- trunk/LayoutTests/fast/events/simulated-click-coords.html 2011-05-18 19:30:48 UTC (rev 86781)
+++ trunk/LayoutTests/fast/events/simulated-click-coords.html 2011-05-18 19:35:25 UTC (rev 86782)
@@ -1,11 +1,30 @@
<!DOCTYPE html>
<html>
<head>
+<style>
+
+.scroll {
+ height: 100px;
+ overflow: auto;
+}
+
+.filler {
+ height: 200px;
+}
+
+</style>
</head>
<body>
<p>Ensure that simulated click on label elements uses the original mouse coordinates.</p>
<input type="checkbox" id="target" _onclick_="validateEventProperties(event)">
<label for="" _onclick_="storeEvent(event)">Click Me</label>
+
+<div class="scroll">
+ <div class="filler"></div>
+ <input type="radio" id="target2" _onclick_="validateEventProperties(event)">
+ <label for="" _onclick_="storeEvent(event)">Click Me</label>
+</div>
+
<pre id="out"></pre>
<script>
@@ -16,9 +35,9 @@
{
if (!window.eventSender)
return;
-
- var x = element.offsetLeft + element.offsetWidth / 2;
- var y = element.offsetTop + element.offsetHeight / 2;
+ var rect = element.getBoundingClientRect();
+ var x = rect.left + rect.width / 2;
+ var y = rect.top + rect.height / 2;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
@@ -62,6 +81,10 @@
clickOn(document.querySelector('label'));
+print('');
+document.querySelector('.scroll').scrollTop = 999;
+clickOn(document.querySelector('.scroll label'));
+
</script>
</body>
</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes