Bug 113138

Summary: Web Inspector: OverviewGrid. Dragged window may change its width due to accumulating rounding error
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Ilya Tikhonovsky <loislo>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch pfeldman: review+

Description Ilya Tikhonovsky 2013-03-23 09:51:03 PDT
use case:
record a timeline
select small window in overview pane
drag it slowly

patch to follow
Comment 1 Ilya Tikhonovsky 2013-03-23 09:57:48 PDT
Created attachment 194709 [details]
Patch
Comment 2 Pavel Feldman 2013-03-25 01:07:53 PDT
Comment on attachment 194709 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=194709&action=review

> Source/WebCore/ChangeLog:8
> +        The old version had problem with rounding because it recalculates the window size on each event.

Why would this be a problem?

> Source/WebCore/inspector/front-end/OverviewGrid.js:320
> +        var delta = (event.pageX - this._dragStartPoint) / this._parentElement.clientWidth;

I am not sure we need more complexity in this code.
Comment 3 Ilya Tikhonovsky 2013-03-26 01:06:13 PDT
Created attachment 195025 [details]
Patch
Comment 4 Ilya Tikhonovsky 2013-03-26 01:16:33 PDT
(In reply to comment #2)
> (From update of attachment 194709 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=194709&action=review
> 
> > Source/WebCore/ChangeLog:8
> > +        The old version had problem with rounding because it recalculates the window size on each event.
> 
> Why would this be a problem?

As we found in the offline discussion the rounding was the root of problem.

> 
> > Source/WebCore/inspector/front-end/OverviewGrid.js:320
> > +        var delta = (event.pageX - this._dragStartPoint) / this._parentElement.clientWidth;
> 
> I am not sure we need more complexity in this code.

I eliminated moveWindow code so the code became clear.
Comment 5 Ilya Tikhonovsky 2013-03-26 04:26:06 PDT
Committed r146866: <http://trac.webkit.org/changeset/146866>