XPathResult relies on DOM Mutation events for invalidation, but these don't work for documents retrieved via XMLHttpRequest (addEventListener() checks for document()->attached(), and bails out if it's not). This causes several layout test failures: dom/svg/level3/xpath/XPathResult_invalidIteratorState_ORDERED_NODE_ITERATOR_TYPE.svg dom/svg/level3/xpath/XPathResult_invalidIteratorState_UNORDERED_NODE_ITERATOR_TYPE.svg dom/svg/level3/xpath/XPathResult_invalidIteratorState_ANY_TYPE.svg dom/svg/level3/xpath/XPathResult_iterateNext_INVALID_STATE_ERR.svg
This check for document()->attached() was added in r8557 <http://trac.webkit.org/projects/webkit/changeset/8557> as a part of a fix to memory leaks on eBay.
Created attachment 12832 [details] work in progress It seems that DOM events don't work for createDocument() and XMLHttpRequest-based documents in Firefox and Opera, too. I've tried rewriting XPathResult to use domTreeVersion for invalidation - but that also doesn't work in such documents (the DOM version is mostly updated from attach()/detach()).
Created attachment 30828 [details] proposed fix DOM tree version magically works in ToT.
Comment on attachment 30828 [details] proposed fix > + * Copyright (C) 2006, 2009 Apple Computer, Inc. The preferred form is "<year> Apple Inc. All rights reserved." I sometimes worry that the single document-wide tree version number is too blunt a tool; glad it works better here than what we were doing before! r=me
Committed r44317.