Bug 9547 - Resize corner does not track the mouse accurately
Summary: Resize corner does not track the mouse accurately
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-22 13:35 PDT by mitz
Modified: 2006-06-24 08:56 PDT (History)
0 users

See Also:


Attachments
Proposed fix (28.71 KB, patch)
2006-06-22 13:50 PDT, mitz
mitz: review-
Details | Formatted Diff | Diff
Proposed fix (31.10 KB, patch)
2006-06-23 05:16 PDT, mitz
no flags Details | Formatted Diff | Diff
Patch (31.10 KB, patch)
2006-06-24 01:23 PDT, mitz
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2006-06-22 13:35:23 PDT
There are two problems with the way the resize control tracks the mouse:

1) It does not take into account the point within the resize control where dragging started, always behaving as if the user is dragging the bottom-right pixel of the control.

2) It messes up when there are borders or padding.

I am going to attach a patch that includes a test case.
Comment 1 mitz 2006-06-22 13:50:29 PDT
Created attachment 8969 [details]
Proposed fix
Comment 2 mitz 2006-06-22 13:57:37 PDT
Comment on attachment 8969 [details]
Proposed fix

This is still off by 1 for textareas the first time you resize them.
Comment 3 mitz 2006-06-23 05:16:40 PDT
Created attachment 8977 [details]
Proposed fix

Fixed problems in the previous version. Added code to lift the intrinsic margins into the style, to prevent textareas from jumping when you first resize them.
Comment 4 mitz 2006-06-23 05:17:24 PDT
Forgot to mention that the new patch has another couple of cases in the test.
Comment 5 Darin Adler 2006-06-23 21:29:50 PDT
Comment on attachment 8977 [details]
Proposed fix

An offset should be an IntSize, not an IntPoint.

If this was an IntSize, then this:

+    currentPoint.move(offsetFromResizeCorner.x(), offsetFromResizeCorner.y());

would be:

    currentPoint += offsetFromResizeCorner;

This otherwise looks good to me. I think I'm going to mark it review+ -- if you decide to do a new patch with IntSize, then you can clear the review flag on this one.
Comment 6 mitz 2006-06-24 00:48:49 PDT
Comment on attachment 8977 [details]
Proposed fix

Going to change the offset to IntSize.
Comment 7 mitz 2006-06-24 01:23:00 PDT
Created attachment 8996 [details]
Patch

Changed the offset into an IntSize.
Comment 8 Darin Adler 2006-06-24 07:34:47 PDT
Comment on attachment 8996 [details]
Patch

r=me
Comment 9 Alexey Proskuryakov 2006-06-24 08:56:52 PDT
Committed revision 15014.