Bug 52485

Summary: make line selection have a extend only from where you start the selection in the code review tool
Product: WebKit Reporter: Ojan Vafai <ojan>
Component: New BugsAssignee: Ojan Vafai <ojan>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, aroben, eric, mihaip
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch abarth: review+

Description Ojan Vafai 2011-01-14 15:26:34 PST
make line selection have a extend only from where you start the selection in the code review tool
Comment 1 Ojan Vafai 2011-01-14 15:26:59 PST
Created attachment 79012 [details]
Patch
Comment 2 Ojan Vafai 2011-01-14 15:29:54 PST
As requested in bug 52462.
Comment 3 Adam Barth 2011-01-14 17:36:48 PST
Comment on attachment 79012 [details]
Patch

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

This code reads very nicely with all these helper functions to convert between representations.

> Websites/bugs.webkit.org/code-review.js:1067
> +    while (current_index <= last_index) {
> +      $('#line' + current_index).addClass('selected')
> +      current_index++;
> +    }

This looks like it could get expensive with a large selection.  Have you tested a large selection?
Comment 4 Ojan Vafai 2011-01-14 18:27:37 PST
(In reply to comment #3)
> (From update of attachment 79012 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=79012&action=review
> 
> > Websites/bugs.webkit.org/code-review.js:1067
> > +    while (current_index <= last_index) {
> > +      $('#line' + current_index).addClass('selected')
> > +      current_index++;
> > +    }
> 
> This looks like it could get expensive with a large selection.  Have you tested a large selection?

There's only so large of a selection you can make given that we don't scroll. You can get at most 1 screenful of lines. In other words, you can't make a large selection.
Comment 5 Ojan Vafai 2011-01-20 10:49:23 PST
Ping.
Comment 6 Adam Barth 2011-01-20 11:02:46 PST
Comment on attachment 79012 [details]
Patch

Oops.  Sorry.
Comment 7 Ojan Vafai 2011-01-20 11:21:54 PST
Committed r76268: <http://trac.webkit.org/changeset/76268>