Bug 34144 - Web Inspector: Implement simple highlighter for HTML.
Summary: Web Inspector: Implement simple highlighter for HTML.
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:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-25 11:42 PST by Pavel Feldman
Modified: 2010-01-26 02:19 PST (History)
6 users (show)

See Also:


Attachments
[PATCH] Proposed change. (252.42 KB, patch)
2010-01-25 11:44 PST, Pavel Feldman
no flags Details | Formatted Diff | Diff
[PATCH] Proposed change (style fix). (252.43 KB, patch)
2010-01-25 11:56 PST, Pavel Feldman
no flags Details | Formatted Diff | Diff
[PATCH] Same with better naming and CSS tokenizer bonus. (331.38 KB, patch)
2010-01-25 14:23 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 Pavel Feldman 2010-01-25 11:42:48 PST
This change also introduces parse state that is necessary to keep generated lexer code compact.
Comment 1 Pavel Feldman 2010-01-25 11:44:48 PST
Created attachment 47361 [details]
[PATCH] Proposed change.
Comment 2 WebKit Review Bot 2010-01-25 11:48:20 PST
Attachment 47361 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
Skipping input 'WebCore/inspector/front-end/JavaScriptTokenizer.js': Can't open for reading
WebCore/inspector/front-end/TokenizerForHTML.js:78:  Line contains tab character.  [whitespace/tab] [5]
WebCore/inspector/front-end/TokenizerForHTML.js:79:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 2


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Pavel Feldman 2010-01-25 11:56:56 PST
Created attachment 47364 [details]
[PATCH] Proposed change (style fix).

Please ignore style failures in the removed file.
Comment 4 Timothy Hatcher 2010-01-25 12:09:29 PST
Comment on attachment 47361 [details]
[PATCH] Proposed change.

I prefer HTMLTokenizer over TokenizerForHTML, like you had JavaScriptTokenizer. It is a better class name. (Even though the new name keeps the files together.)

Otherwise r+.
Comment 5 Pavel Feldman 2010-01-25 14:23:32 PST
Created attachment 47368 [details]
[PATCH] Same with better naming and CSS tokenizer bonus.
Comment 6 Timothy Hatcher 2010-01-25 17:29:13 PST
Comment on attachment 47368 [details]
[PATCH] Same with better naming and CSS tokenizer bonus.

> -    this._tokenizer = new WebInspector.JavaScriptTokenizer();
> +    this._tokenizer = new WebInspector.SourceCSSTokenizer();

What tokenizer should this be set to?
Comment 7 Pavel Feldman 2010-01-25 21:41:33 PST
(In reply to comment #6)
> (From update of attachment 47368 [details])
> > -    this._tokenizer = new WebInspector.JavaScriptTokenizer();
> > +    this._tokenizer = new WebInspector.SourceCSSTokenizer();
> 
> What tokenizer should this be set to?

This is going to be determined by the mimeType passed to the editor (simple mapping). Currently just hardcoded for testing.

I think I am one patch away form the editor as a viewer.
Comment 8 Pavel Feldman 2010-01-26 02:19:11 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	R	WebCore/inspector/front-end/JavaScriptTokenizer.js => WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
	R	WebCore/inspector/front-end/JavaScriptTokenizer.re2js => WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
	M	WebCore/ChangeLog
	M	WebCore/WebCore.gypi
	M	WebCore/WebCore.vcproj/WebCore.vcproj
	A	WebCore/inspector/front-end/SourceCSSTokenizer.js
	A	WebCore/inspector/front-end/SourceCSSTokenizer.re2js
	A	WebCore/inspector/front-end/SourceHTMLTokenizer.js
	A	WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
	M	WebCore/inspector/front-end/TextEditorHighlighter.js
	M	WebCore/inspector/front-end/WebKit.qrc
	M	WebCore/inspector/front-end/inspector.html
Committed r53846