WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
44828
FrameView should make more calls to postLayoutTasks() using the timer
https://bugs.webkit.org/show_bug.cgi?id=44828
Summary
FrameView should make more calls to postLayoutTasks() using the timer
Beth Dakin
Reported
Saturday, August 28, 2010 8:47:54 PM UTC
Right now, FrameView calls FrameView::postLayoutTasks() either synchronously, or via the postLayoutTasksTimer. If we make more of these calls through the timer, then some scripts will be able to run without hanging WebKit or the UI AND without hitting the JavaScript recursion limit. This change only allows synchronous calls to postLayoutTasks() if we are not already in a synchronous call to postLayoutTasks(). Furthermore, it de-couples the notion of "the post layout timer should fire" from m_postLayoutTasksTimer.isActive(), instead using a boolean to track the need to use the timer.
Attachments
Patch
(8.71 KB, patch)
2010-08-28 12:52 PDT
,
Beth Dakin
hyatt
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Beth Dakin
Comment 1
Saturday, August 28, 2010 8:52:27 PM UTC
Created
attachment 65838
[details]
Patch
mitz
Comment 2
Saturday, August 28, 2010 9:08:49 PM UTC
Cool! Have you tested that the sidebar in Safari RSS doesn’t jiggle when you scroll? That’s a good test for making sure that at least sometimes you do perform post-layout tasks synchronously.
Beth Dakin
Comment 3
Saturday, August 28, 2010 9:10:37 PM UTC
I just tested, and it appears to be jiggle-free :-)
mitz
Comment 4
Saturday, August 28, 2010 9:10:58 PM UTC
The name m_shouldFirePostLayoutTimer should be improved. It is really about whether you have a pending need to perform post-layout tasks. The timer already knows if it should fire :-) you’re really using this for the case(s) where you stopped the timer before it had a chance to fire.
Beth Dakin
Comment 5
Saturday, August 28, 2010 9:16:31 PM UTC
(In reply to
comment #4
)
> The name m_shouldFirePostLayoutTimer should be improved. It is really about whether you have a pending need to perform post-layout tasks. The timer already knows if it should fire :-) you’re really using this for the case(s) where you stopped the timer before it had a chance to fire.
Yes, I agree. I wasn't happy with the name. Some ideas: m_needToPerformPostLayoutTasks m_hasPostLayoutTasksPending
Simon Fraser (smfr)
Comment 6
Saturday, August 28, 2010 11:13:34 PM UTC
Comment on
attachment 65838
[details]
Patch There's a lot of statefulness here that makes it very hard to follow. Can we pass state via parameters, rather than keeping it in member variables? Alternatively, maybe a single state enum would be easier to follow than two booleans.
Beth Dakin
Comment 7
Sunday, August 29, 2010 1:03:11 AM UTC
(In reply to
comment #6
)
> (From update of
attachment 65838
[details]
) > There's a lot of statefulness here that makes it very hard to follow. Can we pass state via parameters, rather than keeping it in member variables? Alternatively, maybe a single state enum would be easier to follow than two booleans.
I'm not sure either of those would work. A single state enum seems weird to me since I see the two variables as being very different. m_inSynchronousPostLayout represents whether the current callstack would trace back to a synchronous call to performPostLayoutTakss(). m_shouldFirePostLayoutTimer represents whether we have a pending need to call performPostLayoutTaks() on the timer. I think a single variable representing these two concepts would be confusing. In terms of passing parameters…it seems like that would be a mess for m_inSynchronousPostLayout. I think it would mean passing a parameter to performPostLayoutTasks(), and having performPostLayoutTasks() send that same parameter into m_frame->eventHandler()->sendResizeEvent(), and keep carrying it as a parameter until it got back to FrameView::layout(). It would be similarly sloppy for m_shouldFirePostLayoutTimer. Again, a member variable seems a lot cleaner to me.
Dave Hyatt
Comment 8
Wednesday, September 1, 2010 12:09:01 AM UTC
Comment on
attachment 65838
[details]
Patch r=me
Beth Dakin
Comment 9
Wednesday, September 1, 2010 12:22:49 AM UTC
Thanks Dave!
http://trac.webkit.org/changeset/66552
Beth Dakin
Comment 10
Wednesday, September 1, 2010 12:49:47 AM UTC
Oops! Forgot the name-change.
http://trac.webkit.org/changeset/66555
David Kilzer (:ddkilzer)
Comment 11
Friday, September 17, 2010 10:16:57 PM UTC
<
rdar://problem/8064938
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug