RESOLVED FIXED 25162
REGRESSION (r41176-r41242): Drag-selection above/below the line does not select to beginning/end
https://bugs.webkit.org/show_bug.cgi?id=25162
Summary REGRESSION (r41176-r41242): Drag-selection above/below the line does not sele...
Darin Adler
Reported 2009-04-13 14:13:09 PDT
When dragging to select text, dragging below (above) the last line should select through the end (beginning), but it does not. * STEPS TO REPRODUCE 1. Go to <data:text/html,lorem%20ipsum> 2. Start dragging from between the words, and drag downwards * RESULTS The extent of the selection tracks the mouse pointer’s horizontal position. It should immediately snap to the end of the paragraph. Dan strongly suspects <http://trac.webkit.org/changeset/41191>.
Attachments
work in progress (13.18 KB, patch)
2009-04-19 14:53 PDT, Darin Adler
no flags
patch (196.88 KB, patch)
2009-04-21 15:38 PDT, Darin Adler
mitz: review+
Darin Adler
Comment 1 2009-04-13 14:34:25 PDT
Darin Adler
Comment 2 2009-04-13 14:36:57 PDT
It's clear reading the code why this happens. The positionForPointWithInlineChildren function intentionally hit tests nodes by passing them the real X, and a fake Y based on the position of the node. For a text node, this gives the effect we're seeing. In the older code, this was limited to certain cases, but now happens in any case where we hit a block and are trying to figure out which of its inline children was hit. What's the rule we're trying to implement?
Eric Seidel (no email)
Comment 3 2009-04-13 14:50:29 PDT
We're trying to emulate Word behavior where when you click below a line, your selection starts at the x offset of your click, instead of at the end of line. Correct, ojan?
Darin Adler
Comment 4 2009-04-13 15:06:10 PDT
(In reply to comment #3) > We're trying to emulate Word behavior where when you click below a line, your > selection starts at the x offset of your click, instead of at the end of line. This is starting to look like a platform difference. On Windows, applications consistently seem to behave this way. On Mac OS X, that's a quirk of Word that’s not shared by any other major Mac OS X application.
Ojan Vafai
Comment 5 2009-04-13 15:22:51 PDT
Yeah, this does look platform specific. Related to this is what should happen when you hit up/down arrow at the first/last line of an editable area. Which is to say, on Mac it should go to the beginning/end of the line and on windows it should do nothing (don't know about Linux).
Darin Adler
Comment 6 2009-04-13 15:38:00 PDT
For regression testing purposes, I think we should probably make these behaviors be controlled by a setting, and have it default to the appropriate value depending on the platform.
Darin Adler
Comment 7 2009-04-13 15:38:18 PDT
Then we can use DumpRenderTree to have separate tests for each platform's modes.
Darin Adler
Comment 8 2009-04-13 15:39:15 PDT
What's unfortunate here is that it was unconditionally following the Mac OS X style before, but now it's unconditionally following Windows style; that's not great for Safari on Mac.
Eric Seidel (no email)
Comment 9 2009-04-13 15:54:04 PDT
What's extra unfortunate is that Ojan and I didn't realize that this was a platform-specific behavior when fixing it to match Word here. :(
Darin Adler
Comment 10 2009-04-19 14:53:31 PDT
Created attachment 29608 [details] work in progress
Darin Adler
Comment 11 2009-04-21 15:38:33 PDT
Darin Adler
Comment 12 2009-04-21 16:30:41 PDT
Note You need to log in before you can comment on or make changes to this bug.