Closed
Bug 249061
Opened 21 years ago
Closed 21 years ago
no repaint over settimeout
Categories
(Firefox :: General, defect, P1)
Tracking
()
RESOLVED
FIXED
People
(Reporter: wo, Assigned: roc)
References
()
Details
Attachments
(2 files)
|
620 bytes,
text/html
|
Details | |
|
1.13 KB,
patch
|
blizzard
:
review+
blizzard
:
superreview+
|
Details | Diff | Splinter Review |
Since Mozilla (just as IE) is practically frozen during execution of a
JavaScript block, it is common to split a large JS task into smaller pieces and
let each piece call the next one via setTimeout("nextPiece()", 0). This usually
has the effect that in between the pieces the browser responds to clicks and
keystrokes and repaints the document if the DOM has changed.
With the attached testcase however, this doesn't work any more in Firefox 0.9.1
(gtk2+xft on Debian unstable). It worked in Ff 0.8.
Instructions:
1. Open the testcase.
2. Enter "loop [100] times, painting [1000] numbers per loop, interval [0]" into
the form and hit "Go".
This calls the function
function loop(n, m, interval) {
if (!self.debugWin) self.debugWin = open("about:blank","debugWin");
for (var i=0; i<m; i++) debugWin.document.write("<pre>"+n+"."+m+"</pre>");
if (n--) setTimeout("loop("+n+","+m+","+interval+")", interval);
}
with n=100, m=1000, interval=0. The function opens a popup window (so unblock
popups!) and writes the numbers 20.0 20.1 ... 20.999 19.0 19.1 ... 19.999 18.0
etc. into the document, with 20 setTimeout breaks in between.
Expected result: At every call of setTimeout, the browser should be responsive
to user feedback.
Actual result: The browser is frozen until all numbers have been written.
When I repeat the test without reloading (by just hitting "Go" again) much lower
values suffice to produce the effect, e.g. 100 - 10 - 0. That's probably because
more computation is required to write to an already very long document. If
you're on a faster machine, you might have to enter higher values (into the
first to fields).
| Reporter | ||
Comment 1•21 years ago
|
||
Comment 2•21 years ago
|
||
Is this an issue on trunk? With a current trunk build of SeaMonkey, the browser
remains reasonably responsive while the data is being written out (I can scroll,
etc).
| Reporter | ||
Comment 3•21 years ago
|
||
Interesting. Yes, I don't see the problem with yesterday's SeaMonkey nightly.
But it's still there in yesterday's Firefox nightly (from the Firefox trunk).
The difference is more obvious the more has been written to the popup window. In
SeaMonkey, the responsiveness doesn't change noticeably when I click "Go"
several times, whereas in Firefox it gets worse and worse.
(There doesn't seem to be a relevant Component in the "Firefox" product
category, so I'm leaving Product = "Browser" and set Version = "Other Branch", ok?)
Version: Trunk → Other Branch
Comment 4•21 years ago
|
||
No, if this is a problem on firefox _trunk_, it's a firefox bug, and not a
SeaMonkey branch bug (which is what you labeled it as).
Assignee: general → firefox
Component: DOM → General
Product: Browser → Firefox
QA Contact: ian → firefox.general
Version: Other Branch → Trunk
Comment 5•21 years ago
|
||
I think this is pretty major. This effectively breaks a lot of DHTML stuff.
Current thinking is that this is a gtk2 vs gtk1 issue. I am testing gtk1 builds.
Flags: blocking-aviary1.0RC1?
Comment 6•21 years ago
|
||
(In reply to comment #5)
> I think this is pretty major. This effectively breaks a lot of DHTML stuff.
>
> Current thinking is that this is a gtk2 vs gtk1 issue. I am testing gtk1 builds.
bz, remember that gtk1 is no longer supported by Firefox. If this issue is gtk1
only, then we won't block for this.
Comment 7•21 years ago
|
||
This issue is either gtk2-only or Firefox-only. I am not seeing it in the
builds I actually use and care about (gtk1 SeaMonkey builds). Which should be
clear from the earlier comments in this bug.
Comment 8•21 years ago
|
||
From aebrahim's testing, looks like this is a gtk2 issue. It's very easy to
reproduce by running the test at
http://www.24fun.com/downloadcenter/benchjs/benchjs.html -- no repaints happen
during test 6 (see bug 249546 for description of problem).
| Assignee | ||
Comment 9•21 years ago
|
||
GTK2's nsAppShell gives PLEvents a higher priority than redraws and repaints;
PLEvents get G_PRIORITY_HIGH_IDLE, redraws are G_PRIORITY_HIGH_IDLE+20. That
directly leads to this problem. On Windows, painting is higher priority than
PLEvents because WM_PAINT is higher priority than WM_TIMER.
This patch changes PLEvents to G_PRIORITY_DEFAULT_IDLE. It fixes this bug. I'm
not sure what else should be checked or tested, though. Blizzard?
| Assignee | ||
Updated•21 years ago
|
Attachment #153576 -
Flags: superreview?(blizzard)
Attachment #153576 -
Flags: review?(blizzard)
Comment 10•21 years ago
|
||
I'm mildly concerned about taking this. Sadly, because we're dealing with
multiple event queues on different file descriptors (PLEvent vs. XEvents vs.
timers) it's easy to make one starve the other. Have you tried some heavy
networking pages? Is there a hit on page load times? Perceived times?
Comment 11•21 years ago
|
||
Just to make it clear what this bug is about... This bug causes DHTML animations
to pretty completely not work. The browser pegs the CPU, but never paints
anything, making the user think it's frozen.
This is a very important user perception issue, if nothing else.
| Assignee | ||
Comment 12•21 years ago
|
||
> (PLEvent vs. XEvents vs. timers)
XPCOM timers are just a thread that periodically posts PLevents to threads'
event loops. No issue there.
I believe GTK is dispatching X events, including generated resize and redraw
messages at higher priority than G_PRIORITY_DEFAULT_IDLE, according to
http://developer.gnome.org/doc/API/glib/glib-the-main-event-loop.html. I think
that's really what we want...
> Have you tried some heavy networking pages? Is there a hit on page load
> times? Perceived times?
There probably will be a hit on Tp since right now we're starving paints.
Perceived times will probably improve because there can be more incremental
painting. I don't know how to test this myself.
Comment 13•21 years ago
|
||
-> robert
Assignee: firefox → roc
Flags: blocking-aviary1.0RC1? → blocking-aviary1.0RC1+
Priority: -- → P1
Updated•21 years ago
|
Attachment #153576 -
Flags: superreview?(blizzard)
Attachment #153576 -
Flags: superreview+
Attachment #153576 -
Flags: review?(blizzard)
Attachment #153576 -
Flags: review+
| Assignee | ||
Comment 14•21 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 15•21 years ago
|
||
Tp on redwood went up by about 9%. Not surprising since we'll be painting
incrementally during page load now.
Updated•21 years ago
|
Keywords: fixed-aviary1.0
Comment 16•21 years ago
|
||
Reopening : this patch only landed on seamonkey trunk but never on aviary branch.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 17•21 years ago
|
||
(In reply to comment #16)
> Reopening : this patch only landed on seamonkey trunk but never on aviary branch.
Why would that matter given that all current development is off the trunk anyway?
Comment 18•21 years ago
|
||
Because some people (read packagers who maintains firefox 1.0 packages) might
depend on what the bug keyword is saying :
it says "fixed-avirary1.0" but it isn't.
But since aviary branch was merged back to trunk, this won't matter to anybody
but packagers.
Closing. Sorry for the noise.
Status: REOPENED → RESOLVED
Closed: 21 years ago → 21 years ago
Resolution: --- → FIXED
Updated•21 years ago
|
Keywords: fixed-aviary1.0
You need to log in
before you can comment on or make changes to this bug.
Description
•