svnlabs / google-caja

Automatically exported from code.google.com/p/google-caja
0 stars 1 forks source link

Browser lock up for large css files. #1941

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Caja causes browser lock up when loading any significantly large css file 
inside of a guest on Firefox 33.

Firefox 33 is currently in Beta, but due to be released this month.

Attached is a sample file that links to the minified css of the bootstrap 
project.

Relevant changes in Firefox 33 that may be causing this issue: 
https://blog.mozilla.org/javascript/2014/07/21/slimmer-and-faster-javascript-str
ings-in-firefox/

The lock-up is caused by CRLF to LF normalization at csslexer.js:229

Original issue reported on code.google.com by james.ke...@wishabi.com on 9 Oct 2014 at 7:50

Attachments:

GoogleCodeExporter commented 9 years ago
It is not in the CRLF normalization but rather the recursive regex of 
'ESCAPE_TAIL'.

Firefox 33+ defaults to Latin1 for their internal encoding, and their regex 
method must not account for that.

Forcing unicode seems to fix it.

Original comment by james.ke...@wishabi.com on 9 Oct 2014 at 9:36

Attachments:

GoogleCodeExporter commented 9 years ago
Is this an actual hang, or just being unreasonably slow? (Trying 
intermediate-sized files would help tell the difference.) If the former, this 
ought to be reported as a Firefox bug as well.

Original comment by kpreid@google.com on 9 Oct 2014 at 10:24

GoogleCodeExporter commented 9 years ago
I am not sure if it is an actual hang, I haven't attempted to run it all the 
way through; on multiple occasions I have had to kill -9 the process as it was 
not responding to anything else. I will definitely be reporting this to the 
Firefox team.

I can understand not wanting to accept the patch to cater to a platform 
specific bug, but Firefox 33 is due to be released Tuesday (Oct 14th) and it is 
doubtful that any bug reported now will be fixed in time.

Original comment by james.keane on 10 Oct 2014 at 2:30

GoogleCodeExporter commented 9 years ago
Opened ticket with Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1081175

Original comment by james.ke...@wishabi.com on 10 Oct 2014 at 3:57

GoogleCodeExporter commented 9 years ago
Firefox 33 has been released with the bug in. They have already included it to 
be released with Firefox 34, but until then this will affect css processing.

I am going to included this in my branch and remove it once Firefox 34 has been 
rolled out and Firefox 33 usage is near zero.

Original comment by james.ke...@wishabi.com on 15 Oct 2014 at 1:45

GoogleCodeExporter commented 9 years ago

Original comment by kpreid@google.com on 15 Oct 2014 at 5:26

GoogleCodeExporter commented 9 years ago
https://codereview.appspot.com/157080044/

Original comment by kpreid@google.com on 15 Oct 2014 at 5:42

GoogleCodeExporter commented 9 years ago
@r5702

Original comment by kpreid@google.com on 15 Oct 2014 at 6:28

GoogleCodeExporter commented 9 years ago
James, thanks!

Original comment by erights on 15 Oct 2014 at 6:30