Bug 19526

Summary: ASSERTION FAILED: m_numNodeListCaches
Product: WebKit Reporter: danceoffwithyourpantsoff <danceoffwithyourpantsoff>
Component: DOMAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, darin, mitz, sam, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
test case (will assert)
none
patch sam: review+

Description danceoffwithyourpantsoff 2008-06-12 15:54:23 PDT
var doc = document.implementation.createHTMLDocument('a');
Node's can cache nodelists in m_nodeLists.  They keep a counter on their document, via document()->addNodeListCache and document()->removeNodeListCache.  However, when a node is adopted between documents, nothing is done to keep this balance.  On adoption, we should be clearing m_nodeLists and calling document()->removeNodeListCache.


var b = document.createElement('b');
// Give it a node list cache on document
b.childNodes;

// Attach it to doc to update m_document
doc.adoptNode(b);
doc.body.appendChild(b);
doc.body.removeChild(b);

// GC here if you can, or reload the page to fire ~Node and cleanup m_nodeLists
Comment 1 Alexey Proskuryakov 2008-06-12 21:49:52 PDT
Created attachment 21670 [details]
test case (will assert)
Comment 2 Alexey Proskuryakov 2008-06-12 21:50:58 PDT
Confirmed with r34513.
Comment 3 mitz 2009-11-29 17:28:42 PST
Are there any symptoms in release builds?
Comment 4 mitz 2009-11-30 15:52:55 PST
<rdar://problem/7431572>
Comment 5 Darin Adler 2009-12-22 14:49:09 PST
I see no reason to clear m_nodeLists.
Comment 6 Darin Adler 2009-12-22 16:21:45 PST
Created attachment 45410 [details]
patch
Comment 7 WebKit Review Bot 2009-12-22 16:26:05 PST
style-queue ran check-webkit-style on attachment 45410 [details] without any errors.
Comment 8 Sam Weinig 2009-12-22 16:29:02 PST
Comment on attachment 45410 [details]
patch

> \ No newline at end of file

r=me
Comment 9 Darin Adler 2009-12-22 16:51:17 PST
http://trac.webkit.org/changeset/52511