Closed
Bug 783729
Opened 13 years ago
Closed 13 years ago
Debugger: JS scripts can get HTML syntax highlighting
Categories
(DevTools :: Debugger, defect, P3)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 19
People
(Reporter: espadrine, Assigned: vporof)
References
Details
Attachments
(1 file)
7.95 KB,
patch
|
rcampbell
:
review+
|
Details | Diff | Splinter Review |
When a JS script does not send the content type,
the debugger gives it HTML syntax highlighting.
(debugger-controller.js 962:19)
This behaviour is suboptimal, and all other browsers I have tested
correctly give it a JS syntax highlighting.
I believe simply checking whether the first non-whitespace character is "<"
is enough to determine whether the file is HTML or JS.
Comment 1•13 years ago
|
||
A missing content type should result in the decision being based on the file name extension. Do you have a test case to reproduce the problem?
Reporter | ||
Comment 2•13 years ago
|
||
What a <script> links to is always a script file, even if it doesn't have the extension.
Firefox knows that, and Chrome, Safari and Opera show the correct highlighting.
Also, Opera shows the name in unicode, not URL-escaped, although this is not
directly related to this bug.
Comment 3•13 years ago
|
||
I agree that this is a legitimate issue, I only wanted a test case to pinpoint the right place for the fix. Unfortunately, when the script is transferred through the remote protocol it doesn't contain any indication that it was loaded from a script tag.
Reporter | ||
Comment 4•13 years ago
|
||
Test case: http://espadrine.github.com/%E2%9A%92/
Please note that this bug is of very low priority :)
Updated•13 years ago
|
Priority: -- → P3
Assignee | ||
Comment 5•13 years ago
|
||
When we decide on the content type, we always have the source text fetched, so it should be trivial to simply check if the first character is a "<" or not. I'll play with this a bit.
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•13 years ago
|
||
easy peasy
Assignee | ||
Updated•13 years ago
|
Attachment #675966 -
Flags: review?(rcampbell)
Assignee | ||
Comment 7•13 years ago
|
||
Comment 8•13 years ago
|
||
Comment on attachment 675966 [details] [diff] [review]
v1
+ // Use HTML mode for files in which the first non whitespace character is
+ // <, regardless of extension.
+ this.editor.setMode(SourceEditor.MODES.HTML);
yeah.
... banana.
Attachment #675966 -
Flags: review?(rcampbell) → review+
Assignee | ||
Comment 9•13 years ago
|
||
(In reply to Rob Campbell [:rc] (:robcee) from comment #8)
> Comment on attachment 675966 [details] [diff] [review]
Thanks!
Assignee | ||
Comment 10•13 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Comment 11•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 19
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•