Bug 36530

Summary: Web Inspector: Error when highlighting JavaScript with an invalid mime type
Product: WebKit Reporter: Alexander Pavlov (apavlov) <apavlov>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: bweinstein, joepeck, keishi, pfeldman, pmuellr, rik, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed solution
none
[PATCH] Extended solution to cover all scripts, styles, and documents pfeldman: review+

Alexander Pavlov (apavlov)
Reported 2010-03-24 06:50:14 PDT
- Bring up WebInspector on http://code.google.com/p/chromium/issues/list - Open kibbles-1.3.1-comp.js in the Scripts panel - Inspect the WebInspector On Chromium, the console says that there was an attempt to read the property "lexCondition" of undefined in WebInspector.SourceTokenizer.prototype.getLexCondition() The js-file mime type is reported as "application/empty" which causes the default parser to be used, even though the parsing has not been set up properly for that.
Attachments
[PATCH] Proposed solution (3.99 KB, patch)
2010-03-24 07:53 PDT, Alexander Pavlov (apavlov)
no flags
[PATCH] Extended solution to cover all scripts, styles, and documents (3.45 KB, patch)
2010-03-24 08:54 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
Alexander Pavlov (apavlov)
Comment 1 2010-03-24 07:53:59 PDT
Created attachment 51497 [details] [PATCH] Proposed solution
Pavel Feldman
Comment 2 2010-03-24 08:08:45 PDT
Comment on attachment 51497 [details] [PATCH] Proposed solution + if (resource.mimeTypeIsConsistentWithType()) If this thing returns true, we still might end up with no tokenizer. Should this code be moved to the SourceTokenizer where you could handle this case?
Alexander Pavlov (apavlov)
Comment 3 2010-03-24 08:54:48 PDT
Created attachment 51506 [details] [PATCH] Extended solution to cover all scripts, styles, and documents
Alexander Pavlov (apavlov)
Comment 4 2010-03-24 09:57:31 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/inspector/front-end/SourceTokenizer.js M WebCore/inspector/front-end/SourceView.js M WebCore/inspector/front-end/TextEditorHighlighter.js Committed r56444
Note You need to log in before you can comment on or make changes to this bug.