XPath evaluate() synchronization problem - returns no result on XML file if not stopped by breakpoint

RESOLVED INVALID

Status

()

Core
General
--
major
RESOLVED INVALID
8 years ago
4 years ago

People

(Reporter: Axel, Unassigned)

Tracking

Trunk
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6


This bug might be caused by some internal synchronization issue:

If evalute() is called on an XML document, it *never* returns any nodes - except: when a breakpoint is set to the evaluate() function call in Firebug (1.5.3).


* When program execution hits the breakpoint and the user hits [F8] to continue execution, evaluate() returns a valid result.

* As soon as the breakpoint is removed and program execution is performed without, no nodes are found.


I have created a small test case. Please find the files attached to this bug.

Reproducible: Always

Steps to Reproduce:

1.  Open "XPathTest.html"

2.  Open JavaScript console
    (It should display an uncaught exception.)

3.  Open Firebug, select "Script" tab

4.  Within the "Script" tab, choose the file
    "XPathTest.js" and search for line #8

5.  Set a breakpoint to line #8
    (which is the line containing the evaluate() call)

6.  Reload the page [F5]

7.  When the breakpoint is hit, press [F8] to continue
    execution

=>  The alert message box is displayed,
    showing the number of found nodes.


Actual Results:  

see above.

Expected Results:  

XPath should always return a valid result.
(Reporter)

Comment 1

8 years ago
Created attachment 436553 [details]
Test case containing HTML/JavaScript/XML files to reproduce the problem.
(Reporter)

Updated

8 years ago
Summary: XPath evaluate() synchronization problem - returns no result if not stopped by breakpoint → XPath evaluate() synchronization problem - returns no result on XML file if not stopped by breakpoint
(Reporter)

Comment 2

8 years ago
The attachment also contains a series of screenshot demonstrating the problem.
(Reporter)

Comment 3

8 years ago
Raised to major because there is no workaround.
Severity: normal → major
Reporter, are you still seeing this issue with Firefox 3.6.13 or later in safe mode? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles

You can also try to reproduce in Firefox 4 Beta 8 or later, there are many improvements in the new version, http://www.mozilla.com/en-US/firefox/all-beta.html
Whiteboard: [CLOSEME 2011-1-30]
(Reporter)

Comment 5

7 years ago
I would prefer if _you_ would try to not reproduce the problem in newer versions.

I'm working with my PC and I don't want to install different Beta versions myself.

Shouldn't that be your task?
No reply, INCOMPLETE. Please retest with Firefox 3.6.13 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INCOMPLETE
(Reporter)

Comment 7

7 years ago
Yepp, FF 3.6.13 still shows the same error.

Did you try to open the attachment enclosed with this issue?
Status: RESOLVED → UNCONFIRMED
Resolution: INCOMPLETE → ---
Axel, can you please retest with Firefox 4 in a fresh profile?
Whiteboard: [CLOSEME 2011-1-30]
Version: unspecified → 3.6 Branch
(Reporter)

Comment 9

7 years ago
Hi Tyler,

I just did using 4.0. The problem unfortunately still exists.
(Reporter)

Comment 10

7 years ago
This is the exception that has been thrown:

Fehler: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMXPathEvaluator.evaluate]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: file:///C:/Temp/xxx/XPathTest.js :: evaluate :: line 12"  data: no]

Updated

7 years ago
Version: 3.6 Branch → 4.0 Branch
(Reporter)

Comment 11

6 years ago
Are there any further findings yet?
(Reporter)

Comment 12

5 years ago
Problem still exists with today's FF version (17).

Comment 13

4 years ago
Issue still reproducible on:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0

(I used the DevTools Debugger instead of installing Firebug).
Status: UNCONFIRMED → NEW
Component: General → General
Ever confirmed: true
Product: Firefox → Core
Version: 4.0 Branch → Trunk
The testcase basically looks like this:

  xDoc=document.implementation.createDocument(null,null,null);
  xDoc.load("jQuery API.xml");
  alert(evaluate().length);

but load() does an _async_ load by default.  So this script is doing the evaluate() call before the XML has actually loaded.

If you breakpoing in evaluate(), then while you're waiting at the breakpoint the XML finishes loading.  So then when you continue the XML is there and evaluate() finds things.
Status: NEW → RESOLVED
Last Resolved: 7 years ago4 years ago
Resolution: --- → INVALID
(Reporter)

Comment 15

4 years ago
I see... Thank you for evaluating this issue.

So the solution would be to add an onload event handler to xDoc?
You need to log in before you can comment on or make changes to this bug.