Last Comment Bug 309712 - HTML-style comments in the middle of .js file cause part of script to be ignored (treated as XML data)
: HTML-style comments in the middle of .js file cause part of script to be igno...
Status: RESOLVED FIXED
: fixed1.8, js1.6, regression
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: P1 normal (vote)
: mozilla1.8beta5
Assigned To: Brendan Eich [:brendan]
:
: Jason Orendorff [:jorendorff]
Mentors:
http://www.thottbot.com/index.cgi?p=A...
: 309778 309802 309806 (view as bug list)
Depends on:
Blocks: 309242
  Show dependency treegraph
 
Reported: 2005-09-22 22:05 PDT by Jesse Ruderman
Modified: 2006-03-12 18:56 PST (History)
6 users (show)
brendan: blocking1.8b5+
bob: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
wow.js, the file with the HTML-style in the middle (8.00 KB, text/ecmascript)
2005-09-22 23:46 PDT, Jesse Ruderman
no flags Details
Use a more conservative heuristic (1.13 KB, patch)
2005-09-23 00:27 PDT, Brendan Eich [:brendan]
mrbkap: review+
shaver: superreview+
brendan: approval1.8b5+
Details | Diff | Splinter Review

Description Jesse Ruderman 2005-09-22 22:05:49 PDT
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b5) Gecko/20050922
Firefox/1.4

Steps to reproduce:
1. Hover one of the equipment icons in
http://www.thottbot.com/index.cgi?p=Aydsnizzeth.

Result: Nothing happens.

Expected: Info box should appear.

Regression from bug 309242, "E4X should be on by default, while preserving the
comment hiding hack".

Identified by MozillaZine Forum member bizarrojack in
http://forums.mozillazine.org/viewtopic.php?t=321123.
Comment 1 Jesse Ruderman 2005-09-22 22:12:38 PDT
I guess we can...

(1) Back out bug 309242 and go back to requiring opt-in for E4X.

(2) Ask sites that use HTML-style comments in strange ways to change their code.

(3) Change the heuristic introduced by bug 309242 to handle this case as the
author intended.  For example, treat "<!--" as the beginning of XML comment data
iff it does not occur at the beginning of a statement.

Brendan, is (3) realistic?
Comment 2 Jesse Ruderman 2005-09-22 23:46:29 PDT
Created attachment 197150 [details]
wow.js, the file with the HTML-style in the middle

Copy of http://i73.thottbot.com/js/wow.js.
Comment 3 Brendan Eich [:brendan] 2005-09-23 00:27:13 PDT
Created attachment 197152 [details] [diff] [review]
Use a more conservative heuristic

The heuristic is there just to spare people from having to select an E4X
version, via e4x=1, version=1.6, or better than these ineffective MIME type
parameters on application/javascript, perhaps the application/e4x MIME type
that Chris Lilley is proposing.

So if the heuristic is hurting, make it conservative, which may at the margin
require some E4X users to do the right thing, anyway, and request the MIME type
they require.

/be
Comment 4 Blake Kaplan (:mrbkap) 2005-09-23 00:30:40 PDT
Comment on attachment 197152 [details] [diff] [review]
Use a more conservative heuristic

Bah!

r=mrbkap
Comment 5 Mike Shaver (:shaver -- probably not reading bugmail closely) 2005-09-23 05:49:17 PDT
Comment on attachment 197152 [details] [diff] [review]
Use a more conservative heuristic

sr=shaver, though I'll also ping the Thottbot guys to fix their script!
Comment 6 Brendan Eich [:brendan] 2005-09-23 11:22:28 PDT
Fixed on trunk and branch.

/be
Comment 7 Brendan Eich [:brendan] 2005-09-23 16:00:34 PDT
*** Bug 309806 has been marked as a duplicate of this bug. ***
Comment 8 Jesse Ruderman 2005-09-23 17:24:00 PDT
*** Bug 309778 has been marked as a duplicate of this bug. ***
Comment 9 Brendan Eich [:brendan] 2005-09-23 22:32:33 PDT
*** Bug 309802 has been marked as a duplicate of this bug. ***
Comment 10 Bob Clary [:bc:] 2005-10-11 01:35:48 PDT
test covered by js1_6/Regress/regress-309242.js

Note You need to log in before you can comment on or make changes to this bug.