Bug 107531 - Web Inspector: do not highlight really long lines in DTE.
Summary: Web Inspector: do not highlight really long lines in DTE.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Lushnikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-22 02:20 PST by Andrey Lushnikov
Modified: 2013-01-22 06:45 PST (History)
9 users (show)

See Also:


Attachments
Patch (8.10 KB, patch)
2013-01-22 02:25 PST, Andrey Lushnikov
no flags Details | Formatted Diff | Diff
Patch (8.09 KB, patch)
2013-01-22 04:03 PST, Andrey Lushnikov
no flags Details | Formatted Diff | Diff
Patch (9.82 KB, patch)
2013-01-22 06:18 PST, Andrey Lushnikov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Lushnikov 2013-01-22 02:20:55 PST
This functionality had been implemented but was lost due to inaccurate refactoring. So one needs to:
- implement this one more time
- cover this with a layout test to avoid this in future.
Comment 1 Andrey Lushnikov 2013-01-22 02:25:17 PST
Created attachment 183940 [details]
Patch
Comment 2 Pavel Feldman 2013-01-22 03:41:53 PST
Comment on attachment 183940 [details]
Patch

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

> Source/WebCore/inspector/front-end/TextEditorHighlighter.js:82
> +        syntaxTokenHighligh.ranges.sort(comparator);

I thought we don't need sorting anymore.

> Source/WebCore/inspector/front-end/TextEditorHighlighter.js:85
> +        return syntaxTokenHighligh.ranges.slice(0, lastIndex);

Tokenizer should not produce these at the first place, you are trimming them too late. And you produce a lot of garbage (in 99% of cases you are cloning array with no good reason).
Comment 3 Andrey Lushnikov 2013-01-22 03:55:53 PST
Comment on attachment 183940 [details]
Patch

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

>> Source/WebCore/inspector/front-end/TextEditorHighlighter.js:82
>> +        syntaxTokenHighligh.ranges.sort(comparator);
> 
> I thought we don't need sorting anymore.

fixed.

>> Source/WebCore/inspector/front-end/TextEditorHighlighter.js:85
>> +        return syntaxTokenHighligh.ranges.slice(0, lastIndex);
> 
> Tokenizer should not produce these at the first place, you are trimming them too late. And you produce a lot of garbage (in 99% of cases you are cloning array with no good reason).

I removed excessive cloning; what do you mean by "trimming too late"?
Comment 4 Andrey Lushnikov 2013-01-22 04:03:25 PST
Created attachment 183961 [details]
Patch
Comment 5 Pavel Feldman 2013-01-22 05:53:59 PST
> I removed excessive cloning; what do you mean by "trimming too late"?

I mean that you trim the data you've just collected. Why collecting it?
Comment 6 Andrey Lushnikov 2013-01-22 06:18:58 PST
Created attachment 183980 [details]
Patch
Comment 7 WebKit Review Bot 2013-01-22 06:45:07 PST
Comment on attachment 183980 [details]
Patch

Clearing flags on attachment: 183980

Committed r140421: <http://trac.webkit.org/changeset/140421>
Comment 8 WebKit Review Bot 2013-01-22 06:45:11 PST
All reviewed patches have been landed.  Closing bug.