Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12133 closed defect (fixed)

dojox/html/_base.js, snarfScripts: Hangs if there are empty HTML comments in the content

Reported by: Jared Jurkiewicz Owned by:
Priority: high Milestone: 1.6
Component: DojoX Layout Version: 1.5
Keywords: Cc: uhop Douglas Hays
Blocked By: Blocking:

Description

This is a weird one and came up at my place of work. A long document had <!-- --> in it, just an empty comment ... and dojox.layout.ContentPane? hung and the dreaded 'this script is taking too long' showed up.

The problem was tracked down to 'dojox/html/_base.js, snarfScripts, the function that looks for commented out script tags. For some reason that regexp hangs. I can produce this in a very simple testcase. Will be attaching it

Attachments (3)

testComment.html (513 bytes) - added by Jared Jurkiewicz 9 years ago.
Test file that loks a simple HTML file with an empty comment
test1.txt (278 bytes) - added by Jared Jurkiewicz 9 years ago.
Test simple test file.
snarfScripts.patch (2.6 KB) - added by Jared Jurkiewicz 9 years ago.
Patch + new testcase

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by Jared Jurkiewicz

Attachment: testComment.html added

Test file that loks a simple HTML file with an empty comment

Changed 9 years ago by Jared Jurkiewicz

Attachment: test1.txt added

Test simple test file.

comment:1 Changed 9 years ago by Douglas Hays

{5,}? should be *?

Changed 9 years ago by Jared Jurkiewicz

Attachment: snarfScripts.patch added

Patch + new testcase

comment:2 Changed 9 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [23480]) Tweak to comment regexp + a testcase with various HTML comments and scripts to ensure it is working. \!strict fixes #12133

comment:3 Changed 9 years ago by bill

Milestone: tbd1.6

bulk update: bugs fixed in past few months, presumably milestone is 1.6

Note: See TracTickets for help on using tickets.