Bug 9547

Summary: Resize corner does not track the mouse accurately
Product: WebKit Reporter: mitz
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Proposed fix
mitz: review-
Proposed fix
none
Patch darin: review+

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.