Bug 52485 - make line selection have a extend only from where you start the selection in the code review tool
Summary: make line selection have a extend only from where you start the selection in ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Ojan Vafai
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-14 15:26 PST by Ojan Vafai
Modified: 2011-01-20 11:21 PST (History)
4 users (show)

See Also:


Attachments
Patch (3.28 KB, patch)
2011-01-14 15:26 PST, Ojan Vafai
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>