Closed Bug 483330 Opened 12 years ago Closed 12 years ago

Session restore flushes layout on save; affects page performance

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 3.6a1

People

(Reporter: bzbarsky, Assigned: Gavin)

References

Details

(Keywords: verified1.9.1)

Attachments

(1 file, 1 obsolete file)

When session restore saves data, it saves scroll positions.  It seems to use the scrollX and scrollY properties on content windows to do that.  Unfortunately, those don't just read back the scroll position: they flush layout and _then_ return the resulting scroll position.  For session restore that seems unnecessary: if the scroll position will change after reflow, we'll just get called again.  And the current setup means that if you take a long page and trigger an interruptible reflow and then scroll during it, then after 3 seconds you get a non-interruptible flush and your browser freezes up for a while until that's done.

We should probably just have an nsIDOMWindowUtils API for doing this without flushing.  Thoughts?
Depends on: 483634
Attached patch make use of new getter (obsolete) — Splinter Review
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #368159 - Flags: review?(zeniko)
OS: Mac OS X → All
Hardware: x86 → All
Attachment #368159 - Flags: review?(zeniko) → review+
Comment on attachment 368159 [details] [diff] [review]
make use of new getter

It'd be awfully nice to also get a test case here - e.g. as to whether duplicating a scrolled tab also restores the correct scroll position.

Thanks and r+=me with those added.
Attached patch patch+testSplinter Review
Attachment #368159 - Attachment is obsolete: true
Attachment #368695 - Flags: review?(zeniko)
Comment on attachment 368695 [details] [diff] [review]
patch+test

Thanks again, Gavin.
Attachment #368695 - Flags: review?(zeniko) → review+
Blocks: 484648
https://hg.mozilla.org/mozilla-central/rev/6b1294a05538
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.6a1
Attachment #368695 - Flags: approval1.9.1?
Comment on attachment 368695 [details] [diff] [review]
patch+test

We can take this on branch now that bug 483634's landed there.
Comment on attachment 368695 [details] [diff] [review]
patch+test

a191=beltzner
Attachment #368695 - Flags: approval1.9.1? → approval1.9.1+
verified FIXED on builds: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b5pre) Gecko/20090505 Shiretoko/3.5b5pre ID:20090505031155

and

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2a1pre) Gecko/20090505 Minefield/3.6a1pre ID:20090505031205
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.