Commit 1d30efea authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2010-03-03 Chad Faragher <wyck@chromium.org>

        Reviewed by Darin Adler.

        Changed the double-click framework code to pass adjusted page
        coordinates for zoomed pages.  Added a new test to expose
        mistreatment of mouse click coordinates during a double-click.

        https://bugs.webkit.org/show_bug.cgi?id=35690

        * fast/events/zoom-dblclick-expected.txt: Added.
        * fast/events/zoom-dblclick.html: Added.
2010-03-03  Chad Faragher  <wyck@chromium.org>

        Reviewed by Darin Adler.
        Changed the double-click framework code to pass adjusted page
        coordinates for zoomed pages.  Added a new test to expose
        mistreatment of mouse click coordinates during a double-click.

        https://bugs.webkit.org/show_bug.cgi?id=35690

        Test: fast/events/zoom-dblclick.html

        * dom/Node.cpp:
        (WebCore::Node::dispatchMouseEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9c148d3c
2010-03-03 Chad Faragher <wyck@chromium.org>
Reviewed by Darin Adler.
Changed the double-click framework code to pass adjusted page
coordinates for zoomed pages. Added a new test to expose
mistreatment of mouse click coordinates during a double-click.
https://bugs.webkit.org/show_bug.cgi?id=35690
* fast/events/zoom-dblclick-expected.txt: Added.
* fast/events/zoom-dblclick.html: Added.
2010-03-03 Dumitru Daniliuc <dumi@chromium.org>
Reviewed by Dimitri Glazkov.
......
Zoomed
PASS event.clientX is 167
PASS event.clientY is 83
PASS event.pageX is 167
PASS event.pageY is 83
PASS successfullyParsed is true
TEST COMPLETE
<!-- based on clientXY-in-zoom-and-scroll.html -->
<link rel="stylesheet" href="../js/resources/js-test-style.css">
<script src="../js/resources/js-test-pre.js"></script>
<script>
function clickHandler(e)
{
// do something
event = e;
var elem = document.getElementById('gizmo');
elem.textContent = "client(" + e.clientX + "," + e.clientY + ") page(" + e.pageX + "," + e.pageY + ")";
}
</script>
<br/>
<div id="console"></div>
<div id="testArea">
<div id="gizmo" style="position: absolute; left: 0px; top: 0px; overflow-x: hidden; overflow-y: hidden; width: 100%; height: 100%; text-align: middle;" onDblClick="clickHandler(event)">Double-click on this page.</div>
</div>
<script>
var event;
function sendDblClick()
{
if (window.eventSender) {
eventSender.leapForward(1000); // drain dblclick timer
eventSender.mouseMoveTo(200, 100); // x and y different for safety
eventSender.mouseDown();
eventSender.mouseUp();
eventSender.mouseDown();
eventSender.mouseUp();
}
}
function zoomPageIn()
{
if (window.eventSender) {
eventSender.zoomPageIn();
}
}
function zoomPageOut()
{
if (window.eventSender) {
eventSender.zoomPageOut();
}
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
// Zoomed.
function zoomed(e)
{
event = e;
debug("\nZoomed");
shouldBe("event.clientX", "167");
shouldBe("event.clientY", "83");
shouldBe("event.pageX", "167");
shouldBe("event.pageY", "83");
}
window.addEventListener("dblclick", zoomed, false);
zoomPageIn();
sendDblClick();
zoomPageOut();
window.removeEventListener("dblclick", zoomed, false);
if (window.layoutTestController) {
var area = document.getElementById('testArea');
area.parentNode.removeChild(area);
layoutTestController.notifyDone();
}
successfullyParsed = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
2010-03-03 Chad Faragher <wyck@chromium.org>
Reviewed by Darin Adler.
Changed the double-click framework code to pass adjusted page
coordinates for zoomed pages. Added a new test to expose
mistreatment of mouse click coordinates during a double-click.
https://bugs.webkit.org/show_bug.cgi?id=35690
Test: fast/events/zoom-dblclick.html
* dom/Node.cpp:
(WebCore::Node::dispatchMouseEvent):
2010-03-03 David Levin <levin@chromium.org>
 
No review, rolling out r55474.
......
......@@ -2865,7 +2865,7 @@ bool Node::dispatchMouseEvent(const AtomicString& eventType, int button, int det
if (eventType == eventNames().clickEvent && detail == 2) {
RefPtr<Event> doubleClickEvent = MouseEvent::create(eventNames().dblclickEvent,
true, cancelable, document()->defaultView(),
detail, screenX, screenY, pageX, pageY,
detail, screenX, screenY, adjustedPageX, adjustedPageY,
ctrlKey, altKey, shiftKey, metaKey, button,
relatedTarget, 0, isSimulated);
doubleClickEvent->setUnderlyingEvent(underlyingEvent.get());
......
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