XPathEvaluator cannot be created anymore from content document, Failure: "defaultView.XPathEvaluator is not a constructor"

VERIFIED FIXED

Status

()

Core
XPConnect
--
major
VERIFIED FIXED
8 years ago
8 years ago

People

(Reporter: whimboo, Unassigned)

Tracking

({regression})

Trunk
regression
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(blocking2.0 -)

Details

(Whiteboard: [mozmill])

Attachments

(1 attachment, 1 obsolete attachment)

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b8pre) Gecko/20101015 Firefox/4.0b8pre

With todays trunk build the following Mozmill test fails in line 68 when waiting the autocomplete entry on the Google page:

http://hg.mozilla.org/qa/mozmill-tests/file/default/firefox/testGeneral/testGoogleSuggestions.js#l68

The test was working fine with a build from 10101303. Because Mozmill was broken yesterday (bug 604363) we weren't able to run tests. But I suspect that this test failure could also be related to the compartment landing.

Test failure:
"Timeout exceeded for waitForElement XPath: /html/body/div[@id='gac_scont']/div/div/table/tbody/tr/td/table/tbody/tr/td[1]"

The regression range is:

http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=178f26e21cfc&tochange=19cb42fa4554
blocking2.0: --- → ?
The reason for this failure is that the complete XPath handling of Mozmill is broken now.

Easy steps to reproduce:
1. Install Mozmill (https://addons.mozilla.org/de/firefox/addon/9018)
2. Open Mozmill and select the inspector tab
3. Start the inspector and hover over the "Add to Firefox" button on AMO

You should see a XPath result in the Mozmill IDE but none is visible. It simply doesn't detect the element anymore.
Severity: normal → major
This bug affects all of those tests:
testFormManager/testClearFormHistory.js
testGeneral/testGoogleSuggestions.js
testSearch/testGetMoreSearchEngines.js
testPrivateBrowsing/testDisabledPermissions.js
restartTests/testDefaultBookmarks/

and any not yet updated tests which operates with the install button of add-ons on AMO.
OS: Mac OS X → All
Hardware: x86 → All
Summary: Timeout waiting for "/html/body/div[@id='gac_scont'" in testGoogleSuggestions.js → XPath handling in Mozmill broken since landing of compartments
The Mozmill extension was still working after the compartments landing. So I was able to narrow the range down to 10101303 - 10101403:

http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=178f26e21cfc&tochange=ad0a0be8be74
Here a short snippet which demonstrates the regression:

var testXPath = function() {
  var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
           getService(Components.interfaces.nsIWindowMediator);
  var window = wm.getMostRecentWindow("navigator:browser");

  // Using the windows's document the evaluator can be created
  var xpeChrome = new selectedTab.contentDocument.defaultView.XPathEvaluator();

  // Using a content document, creating the evaluator fails
  var xpeContent = new  window.gBrowser.selectedBrowser.
                        contentDocument.defaultView.XPathEvaluator();
}

Could that also be related to the evalInSandbox changes?
Keywords: regressionwindow-wanted
Summary: XPath handling in Mozmill broken since landing of compartments → XPathEvaluator cannot be created anymore from content document, Failure: "defaultView.XPathEvaluator is not a constructor"

Updated

8 years ago
Duplicate of this bug: 604759
Does this need to block beta 7? Not sure what non-working Mozmill implies in terms of our ability to release
Created attachment 484043 [details] [diff] [review]
Possible fix

I haven't tried the testcases here yet, but this probably will fix this bug.
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #484043 - Flags: review?(peterv)
Comment on attachment 484014 [details]
Testcase

Test case is not needed. See my comment 4 for a way to reproduce the problem.
Attachment #484014 - Attachment is obsolete: true
Flags: in-testsuite?
Blake, another testcase is up on bug 604365, but that lets the browser crash atm. So I can't verify atm if it directly makes this bug visible.
Attachment #484043 - Flags: review?(peterv) → review+

Updated

8 years ago
Assignee: mrbkap → nobody
Component: JavaScript Engine → XPConnect
QA Contact: general → xpconnect
http://hg.mozilla.org/mozilla-central/rev/d6ce2866a64a
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Looks good. Thanks for the fix!
Status: RESOLVED → VERIFIED

Updated

8 years ago
blocking2.0: ? → -
You need to log in before you can comment on or make changes to this bug.