Created attachment 629576 [details]
original page demonstrating the slowdown
STR: open attached file, select Tools -> Web developer -> Page source (Cmd+U).
Actual results: the page source is empty for a few seconds, during which Firefox uses 100% cpu doing reflow.
Expected results: view source should display as fast as in Firefox 14.
Regression window points to bug 751841:
(built from http://hg.mozilla.org/integration/mozilla-inbound/rev/b613ac5ff64a)
(built from http://hg.mozilla.org/integration/mozilla-inbound/rev/e98f0fc3d02e)
According the the built-in profiler, with the patch we spend 4.5 seconds on my machine under PresShell::DoReflow, whereas before the patch it was 1 second.
I tried to simplify the page and I see the slowdown with
1) a long line with entity references (")
2) many lines, with or without entity references
Created attachment 629578 [details]
testcase 1: many lines
Created attachment 629579 [details]
testcase 2: single line, but many entity references
Created attachment 629592 [details] [diff] [review]
This possibly needs to be split into two bugs, something like a) performance is bad with lots of elements with unicode-bidi: isolate; b) view-source uses lots of elements with unicode-bidi: isolate.
This is a patch for b), i.e. it fixes the issue with view-source slowdown, but there could be similar slowdown in other cases.
Created attachment 629593 [details] [diff] [review]
I have *no* clue where that first hunk is coming from :(
Created attachment 629594 [details] [diff] [review]
I went ahead and landed the patch: http://hg.mozilla.org/mozilla-central/rev/42f8002ca13b
Thanks for the quick fix! The issue is now fixed for me.