Community
Participate
Working Groups
This is NOT a side-effect of Friday's changes, it happens before them as well. - save the file below to your local file system - connect to a Crossfire server - navigate to the locally-saved page from below - open its source - the only place where a breakpoint is allowed to be set is to double-click beside line 1 (the <html> tag), which places the breakpoint beside the "theFunctionOne" function in the editor -> showing the breakpoint beside "theFunctionOne" function seems wrong (FWIW the setbreakpoint Crossfire request contains "line: 1") -> attempting to put a breakpoint anywhere else fails //file: repeat.html <html> <head> <script> function theFunctionTwo(z) { var d = 2; alert(d); var e = 'asdf'; alert(e); var f = null; alert(f); var g = true; alert(g); var h = false; alert(h); var i = 3.567; alert(i); var j = 'jkl;'; alert(j); var k = ''; alert(k); var l = window; alert(l); var m = [3]; alert(m); var n = document; alert(n); var o = l; alert(o); } function theFunctionOne() { alert("hi"); setTimeout("theFunctionOne()", 5000); var a = 2; var b = 2; theFunctionTwo(3); var c = 2; } window.onload=theFunctionOne; </script> </head> <body> hi </body> </html>
This is because we currently do not have a support story for handling script blocks in the HTML code, and Crossfire sends the entire file as the source for the script. For testing to be able to view the source, the crossfire support is hacked up to wrap the html in a js file. For example: 1. if the source URI reported for the html page is '/' then a new document will be created called 'page.js' to show the source 2. if there is a source URI the html page is still wrapped in a js file like <html file name>.js. So in your example you see 'repeat.html.js' This problem is a symptom of a much larger issue of properly handling script blocks in HTML pages. Should we do processing locally to only display source blocks? Should we just find a way to handle the block in the HTML files? Should we update crossfire to only return script block source? My personal vote would be to properly support the script blocks within the HTML.
(In reply to comment #1) > My personal vote would be to properly support the script blocks within the > HTML. What would that entail?
(In reply to comment #2) > (In reply to comment #1) > > My personal vote would be to properly support the script blocks within the > > HTML. > > What would that entail? A way to seamlessly use/generate ASTs to better support our breakpoint location story / step into selection / hyper-link debugging / variable hover, etc. for starts.
+1 for this. Not being able to set breakpoints and step through scripts in the HTML file is counter-intuitive and a little frustrating. A way to circumvent this using Firebug is to set the breakpoints within Firebug itself. We can then step through the code in the JSDT. However we then get another issue: the debugger does not have the correct values of the variables. No hovering works, nor does the variable windows show anything useful (shows empty objects). Tested with: - Firefox 24.0 - Firebug 1.12.3 - Eclipse Kepler