Bug 57997 - Document leaks when navigating away from a scrolled page
Summary: Document leaks when navigating away from a scrolled page
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.6
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-04-06 16:18 PDT by Stephanie Lewis
Modified: 2011-04-06 19:04 PDT (History)
4 users (show)

See Also:


Attachments
testcase (425 bytes, text/html)
2011-04-06 16:18 PDT, Stephanie Lewis
no flags Details
patch (3.34 KB, patch)
2011-04-06 16:48 PDT, Stephanie Lewis
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephanie Lewis 2011-04-06 16:18:10 PDT
Created attachment 88541 [details]
testcase

<rdar://problem/9187856> REGRESSION(r75555): ~5-7 MB increase in memory between iBench runs

When navigating away from a page in a scrolled state the scrollbars are reset which fires a scroll event.  WIth the new EventQueue for scroll events the event is never dispatched before the page detaches and keeps the Document alive.  

Solution is to cancel the scroll event when detaching the page. 

To repro:
Load attached testcase
Scroll
navigate to about:blank
close the window.
Comment 1 Stephanie Lewis 2011-04-06 16:48:28 PDT
Created attachment 88542 [details]
patch
Comment 2 Darin Adler 2011-04-06 16:50:24 PDT
Comment on attachment 88542 [details]
patch

I don’t understand this patch. It adds two new functions, but nobody calls the Document function.
Comment 3 Stephanie Lewis 2011-04-06 17:13:00 PDT
the call to to cancelEnqueuedEvents is in Document::detach.  It would be more concise I suppose to just call the QueueEvent function from there and not add a function to Document.
Comment 4 Darin Adler 2011-04-06 17:52:55 PDT
Comment on attachment 88542 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=88542&action=review

> Source/WebCore/dom/Document.cpp:3553
> +void Document::cancelEnqueuedEvents()
> +{
> +    m_eventQueue->cancelEnqueuedEvents();
> +}

I suggest just doing this in Document::detach instead of adding a function for it.
Comment 5 Stephanie Lewis 2011-04-06 18:23:57 PDT
committed http://trac.webkit.org/changeset/83128
Comment 6 WebKit Review Bot 2011-04-06 19:04:18 PDT
http://trac.webkit.org/changeset/83128 might have broken SnowLeopard Intel Release (Tests)
The following tests are not passing:
fast/dom/52776.html
fast/text/complex-text-opacity.html
fast/text/international/bidi-AN-after-L.html
fast/text/international/bidi-AN-after-empty-run.html
fast/text/international/bidi-CS-after-AN.html
fast/text/international/bidi-mirror-he-ar.html
fast/text/international/bidi-neutral-run.html
platform/mac/fast/text/international/Geeza-Pro-vertical-metrics-adjustment.html