[Webkit-unassigned] [Bug 25195] using keyboard to extend selection after a selection using mouse extends character selection in reverse order as FF and IE

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 26 18:02:27 PDT 2009


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





------- Comment #8 from xji at chromium.org  2009-06-26 18:02 PDT -------
FYI: how to write layout test to emulate a mouse selection event

>From Mitz:

The way drag-selection works is that the base position of the selection is not
decided on mouse down, but rather on the first mouse move (which is a mouse
drag) after that. This is arguably a bug in EventHandler, and normally it
doesn’t make a difference (because when a user drags, the first mouse move is
very close to the mouse down). The way we work around this issue in layout
tests is that we do another mouseMoveTo with the same coordinates after the
mouseDown:

            eventSender.mouseMoveTo(x, y);
            eventSender.mouseDown();
            eventSender.mouseMoveTo(x, y);


==== My original question send to him
=========================================================

I am trying to create a layout test for webkit issue 25195 patch.
In Windows platform, I commented out the m_sel's base/extent reset part
mentioned in comment #4.

The code change makes difference. But I do not know how to emulate a mouse
selection event in layout test.

I tried the following:

function positionsExtendingInDirection(sel, direction, granularity) {
            var positions = [];

            var start = document.getElementById("start");
            x = start.offsetLeft;
            y = start.offsetTop + 10;
            eventSender.mouseMoveTo(x, y);
            eventSender.mouseDown();
            positions.push({ node: sel.extentNode, begin: sel.baseOffset, end:
sel.extentOffset });

            var end = document.getElementById("end");
            x = end.offsetLeft;
            y = end.offsetTop + 10;
            eventSender.mouseMoveTo(x, y);
            eventSender.mouseUp();
            positions.push({ node: sel.extentNode, begin: sel.baseOffset, end:
sel.extentOffset });

            sel.modify("extend", direction, granularity);
            positions.push({ node: sel.extentNode, begin: sel.baseOffset, end:
sel.extentOffset });
            return positions;
}
</script>
<body>
.....one <span id="start">two<span id="end"> three...
</body>


But such layout does not make any difference in Windows and Mac. Seems
"mouseDown" + "mouseMoveTo" is not the same as mouse-drag. 


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list