Bug 5921 - Hit-testing text in overflows does not take scrolling into account
Summary: Hit-testing text in overflows does not take scrolling into account
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Adele Peterson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-02 15:30 PST by mitz
Modified: 2005-12-16 00:21 PST (History)
0 users

See Also:


Attachments
testcase (999 bytes, text/html)
2005-12-02 15:31 PST, mitz
no flags Details
suggested patch (6.96 KB, patch)
2005-12-02 23:49 PST, mitz
no flags Details | Formatted Diff | Diff
suggested patch (6.96 KB, patch)
2005-12-02 23:49 PST, mitz
darin: review-
Details | Formatted Diff | Diff
revised patch (7.07 KB, patch)
2005-12-03 09:58 PST, mitz
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2005-12-02 15:30:01 PST
When trying to select text that's a direct descendant of a block with overflow:auto or scroll, scrolling is 
ignored, so you end up selecting text above or to the left of where you're pointing or dragging.

To reproduce, open the testcase, scroll each overflow down or to the right, and the drag across the text to 
make a selection. Note that this happens only with text that's directly inside the block with overflow (top 
two examples).
Comment 1 mitz 2005-12-02 15:31:00 PST
Created attachment 4912 [details]
testcase
Comment 2 Dave Hyatt 2005-12-02 17:26:01 PST
This is wrong in shipping Safari also, but it's differently wrong. :)
Comment 3 mitz 2005-12-02 23:49:37 PST
Created attachment 4913 [details]
suggested patch
Comment 4 mitz 2005-12-02 23:49:38 PST
Created attachment 4914 [details]
suggested patch
Comment 5 Darin Adler 2005-12-03 08:57:37 PST
Comment on attachment 4914 [details]
suggested patch

This looks like a really great fix to me. However, I think that
containingBlock() can be a relatively complicated calculation, so it should be
put in a local variable since we're using it three times in a row.
Comment 6 mitz 2005-12-03 09:58:17 PST
Created attachment 4918 [details]
revised patch
Comment 7 mitz 2005-12-03 09:59:32 PST
Comment on attachment 4918 [details]
revised patch

Put containingBlock() into a local variable as Darin suggested.
Comment 8 Adele Peterson 2005-12-14 10:44:42 PST
I've committed this.