void ScriptInterpreter::markDOMNodesForDocument(Document* doc) { NodePerDocMap::iterator dictIt = domNodesPerDocument().find(doc); if (dictIt != domNodesPerDocument().end()) { NodeMap* nodeDict = dictIt->second; NodeMap::iterator nodeEnd = nodeDict->end(); for (NodeMap::iterator nodeIt = nodeDict->begin(); nodeIt != nodeEnd; ++nodeIt) { DOMNode* node = nodeIt->second; // don't mark wrappers for nodes that are no longer in the // document - they should not be saved if the node is not // otherwise reachable from JS. if (node->impl()->inDocument() && !node->marked()) node->mark(); } } }