Bug 34359 - REGRESSION(canvas editor): Syntax highlighting in source view of Resources pane stops half-way
Summary: REGRESSION(canvas editor): Syntax highlighting in source view of Resources pa...
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: Pavel Feldman
URL: http://webkit.org/
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2010-01-29 18:14 PST by Mark Rowe (bdash)
Modified: 2010-02-01 10:45 PST (History)
9 users (show)

See Also:


Attachments
Screenshot (235.86 KB, image/png)
2010-01-29 18:14 PST, Mark Rowe (bdash)
no flags Details
[PATCH] Proposed fix. (37.41 KB, patch)
2010-02-01 08:19 PST, Pavel Feldman
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Rowe (bdash) 2010-01-29 18:14:53 PST
Created attachment 47754 [details]
Screenshot

When viewing the source for the main resource of <http://webkit.org/> in the source view in the Resources pane in r54084, only the first 50 lines or so are highlighted.  The remainder of the source is rendered in plain black text.  This doesn't happen in a build of WebKit from earlier in the week.
Comment 1 Mark Rowe (bdash) 2010-01-29 18:43:59 PST
<rdar://problem/7594371>
Comment 2 Pavel Feldman 2010-02-01 08:19:44 PST
Created attachment 47845 [details]
[PATCH] Proposed fix.
Comment 3 Timothy Hatcher 2010-02-01 09:19:07 PST
Comment on attachment 47845 [details]
[PATCH] Proposed fix.

>  2010-02-01  Pavel Feldman  <pfeldman@chromium.org>
>  
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Web Inspector: Syntax highlighting in source view of Resources pane stops half-way.
> +
> +        https://bugs.webkit.org/show_bug.cgi?id=34359
> +
> +        * inspector/front-end/NativeTextViewer.js:
> +        (WebInspector.NativeTextViewer.prototype._createLineDivs):
> +        (WebInspector.NativeTextViewer.prototype._lineHeight):
> +        (WebInspector.NativeTextViewer.prototype.initFontMetrics):
> +        * inspector/front-end/SourceFrame.js:
> +        (WebInspector.SourceFrame.prototype._createEditorIfNeeded):
> +        * inspector/front-end/SourceHTMLTokenizer.js:
> +        (WebInspector.SourceHTMLTokenizer):
> +        (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
> +        * inspector/front-end/SourceHTMLTokenizer.re2js:
> +        * inspector/front-end/TextEditor.js:
> +        (WebInspector.TextEditor.prototype.initFontMetrics):
> +        (WebInspector.TextEditor.prototype._registerShortcuts):
> +        * inspector/front-end/inspectorSyntaxHighlight.css:

You should describe what the problem was and how it was fixed in the ChangeLog.

Especially for these cryptic lexer changes.
Comment 4 Pavel Feldman 2010-02-01 10:45:51 PST
ChangeLog landed with following contents:

        Reviewed by Timothy Hatcher.

        Web Inspector: Syntax highlighting in source view of
        Resources pane stops half-way.

        There were two problems here: (1) styles for html highlighter were not
        added into the css file (they used to be injected manually in the
        SourceFrame before). (2) 'Tag' needed to be lexer's state, not parser's.
        Otherwise unbalanced quotes in the text nodes were matching too match
        into the string tokens.

Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/NativeTextViewer.js
	M	WebCore/inspector/front-end/SourceFrame.js
	M	WebCore/inspector/front-end/SourceHTMLTokenizer.js
	M	WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
	M	WebCore/inspector/front-end/TextEditor.js
	M	WebCore/inspector/front-end/inspectorSyntaxHighlight.css
Committed r54139