Bug 75375

Summary: Cache and reuse the HTMLFormElement.elements collection.
Product: WebKit Reporter: Andreas Kling <kling>
Component: DOMAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: koivisto, tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
kling: review-
Patch
none
Patch none

Description Andreas Kling 2011-12-29 21:19:43 PST
To improve memory use and performance when .elements is used more than once.
Comment 1 Andreas Kling 2011-12-29 21:39:47 PST
Created attachment 120778 [details]
Patch
Comment 2 Andreas Kling 2011-12-29 22:37:14 PST
Comment on attachment 120778 [details]
Patch

Actually, we can do slightly better.
Comment 3 Andreas Kling 2011-12-29 22:48:22 PST
Created attachment 120782 [details]
Patch

Same patch + get rid of the per-form CollectionCache. We don't need that anymore since there's only one HTMLFormCollection per form.
Comment 4 Andreas Kling 2011-12-30 11:50:42 PST
Created attachment 120811 [details]
Patch
Comment 5 Anders Carlsson 2011-12-30 12:03:25 PST
Comment on attachment 120811 [details]
Patch

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

> Source/WebCore/html/HTMLCollection.cpp:58
> +    if (m_baseIsRetained)
> +        m_base->ref();

I think you need to deref m_base in the destructor.
Comment 6 Andreas Kling 2011-12-30 12:05:12 PST
(In reply to comment #5)
> (From update of attachment 120811 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=120811&action=review
> 
> > Source/WebCore/html/HTMLCollection.cpp:58
> > +    if (m_baseIsRetained)
> > +        m_base->ref();
> 
> I think you need to deref m_base in the destructor.

We already do! :)
Comment 7 Andreas Kling 2011-12-30 12:15:25 PST
Comment on attachment 120811 [details]
Patch

Clearing flags on attachment: 120811

Committed r103848: <http://trac.webkit.org/changeset/103848>
Comment 8 Andreas Kling 2011-12-30 12:15:45 PST
All reviewed patches have been landed.  Closing bug.