RESOLVED FIXED 12471
XPathResult not invalidated for documents retrieved via XMLHttpRequest
https://bugs.webkit.org/show_bug.cgi?id=12471
Summary XPathResult not invalidated for documents retrieved via XMLHttpRequest
Alexey Proskuryakov
Reported 2007-01-30 01:11:58 PST
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
Attachments
work in progress (5.66 KB, patch)
2007-01-31 12:34 PST, Alexey Proskuryakov
no flags
proposed fix (13.53 KB, patch)
2009-06-01 00:57 PDT, Alexey Proskuryakov
darin: review+
Alexey Proskuryakov
Comment 1 2007-01-30 22:15:28 PST
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.
Alexey Proskuryakov
Comment 2 2007-01-31 12:34:46 PST
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()).
Alexey Proskuryakov
Comment 3 2009-06-01 00:57:18 PDT
Created attachment 30828 [details] proposed fix DOM tree version magically works in ToT.
Darin Adler
Comment 4 2009-06-01 01:20:25 PDT
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
Alexey Proskuryakov
Comment 5 2009-06-01 01:28:05 PDT
Committed r44317.
Note You need to log in before you can comment on or make changes to this bug.