XPath evaluate() fails if reusing an iterator result

RESOLVED FIXED in Firefox 67

Status

()

defect
P3
normal
RESOLVED FIXED
5 years ago
4 months ago

People

(Reporter: brille1, Assigned: peterv)

Tracking

26 Branch
mozilla67
Points:
---

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(2 attachments)

Reporter

Description

5 years ago
Running the XPath evaluate() function on the same XML document more than once yields an empty node list when run the second time.

It looks like the Firefox implementation of XPath seems to cache a previously acquired result if the search parameters haven't been changed. Firefox doesn't, however, seem to reset the iterator pointer before returning from the evaluate() function, so calling the evaluate() function with the same parameters twice yields an empty result at the second call.

This shouldn't happen. Calling evaluate() with the same parameters more than once should return the same results with any call if the document hasn't changed.
Reporter

Updated

5 years ago
Summary: XPath evaluate() can only be run once → XPath evaluate() fails if called twice
Reporter

Updated

5 years ago
Attachment #8376830 - Attachment description: XPathTest.zip → Test case containing HTML/JavaScript/XML files to reproduce the problem.
Component: General → DOM
Product: Firefox → Core
Component: DOM → XSLT
Reporter

Comment 1

6 months ago
This issue still exists.

Anyone who wants to fix this?
Flags: needinfo?(peterv)
Assignee

Updated

4 months ago
Assignee: nobody → peterv
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(peterv)
OS: Windows 7 → All
Priority: -- → P3
Hardware: x86_64 → All
Summary: XPath evaluate() fails if called twice → XPath evaluate() fails if reusing an iterator result

Comment 3

4 months ago
Pushed by pvanderbeken@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c906eec1366
XPath evaluate() fails if reusing an iterator result. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Reporter

Comment 5

4 months ago

Thanks!

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/15266 for changes under testing/web-platform/tests

Comment 7

4 months ago
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7348bd11befd
[wpt PR 15266] - [Gecko Bug 973341] XPath evaluate() fails if reusing an iterator result., a=testonly

Comment 8

4 months ago
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3cd20f04f2e8
[wpt PR 15266] - [Gecko Bug 973341] XPath evaluate() fails if reusing an iterator result., a=testonly
https://hg.mozilla.org/projects/oak/rev/3cd20f04f2e8fe498b74173fb3e2d467ecbcae54
Bug 973341 [wpt PR 15266] - [Gecko Bug 973341] XPath evaluate() fails if reusing an iterator result., a=testonly
You need to log in before you can comment on or make changes to this bug.