in browser context event.rangeParent is XULElement not implementing Node

RESOLVED INVALID

Status

()

Core
DOM: Events
RESOLVED INVALID
2 years ago
9 months ago

People

(Reporter: Bridget Almas, Unassigned)

Tracking

(Blocks: 1 bug, {regression})

43 Branch
regression
Points:
---

Firefox Tracking Flags

(e10s+)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
Build ID: 20151015172656

Steps to reproduce:

in a Legacy Extension 

gBrowser.mCurrentBrowser.addEventListener('dblclick',
  function(e) { 
    var rp = e.rangeParent;
    var range = document.createRange();
    range.selectNode(rp);
  },
false);



Actual results:

If you execute this in Firefox 43, triggering by a double-click in an html page, this fails with 

Argument 1 of Range.selectNode does not implement interface Node.


Expected results:

in Firefox 41 it succeeds.

A test on instanceof the results of event.rangeParent reveals that in FF 43 it's an XULElement, while in FF 41 it's a Node.
Component: Untriaged → DOM: Events
Keywords: regression, regressionwindow-wanted
Product: Firefox → Core
Bridget, can you please attach a test extension that reproduces the issue so we can more easily track down the cause? Otherwise, if you're interested in tracking it down yourself, we have the mozregression tool which makes it pretty simple to do so - http://mozilla.github.io/mozregression/

Thanks!
Flags: needinfo?(balmas)
(Reporter)

Comment 2

a year ago
Oh, that's a cool tool. I ran the mozregression ui.

Last build without the error:

app_name: firefox
build_date: 2015-01-13
build_file: /tmp/tmpU2a9Ce/2015-01-13--mozilla-central--firefox-38.0a1.en-US.linux-x86_64.tar.bz2
build_type: nightly
build_url: https://archive.mozilla.org/pub/firefox/nightly/2015/01/2015-01-13-03-02-05-mozilla-central/firefox-38.0a1.en-US.linux-x86_64.tar.bz2
changeset: 3d846527576f
pushlog_url: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=3d846527576f&tochange=63006936ab99
repo_name: mozilla-central
repo_url: https://hg.mozilla.org/mozilla-central
task_id: None

First build with the error:
app_name: firefox
build_date: 2015-01-14
build_file: /tmp/tmpU2a9Ce/2015-01-14--mozilla-central--firefox-38.0a1.en-US.linux-x86_64.tar.bz2
build_type: nightly
build_url: https://archive.mozilla.org/pub/firefox/nightly/2015/01/2015-01-14-03-02-02-mozilla-central/firefox-38.0a1.en-US.linux-x86_64.tar.bz2
changeset: 63006936ab99
pushlog_url: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=bb8d6034f5f2&tochange=63006936ab99
repo_name: mozilla-central
repo_url: https://hg.mozilla.org/mozilla-central
task_id: None
Flags: needinfo?(balmas)
(Reporter)

Comment 3

a year ago
Here are the extensions I tested with (Alpheios reading tools):

https://addons.mozilla.org/firefox/downloads/latest/15085/platform:2/addon-15085-latest.xpi
https://addons.mozilla.org/firefox/downloads/latest/15086/addon-15086-latest.xpi


You need both installed.  Navigate to any page. Enable Alpheis by clicking Alpheios on the Alpheios toolbar and then Toggle Alpheios On.  Navigate to any page and double-click on a word. Good build produces a pop-up, bad build doesn't and you see the error "Range.selectNode does not implement interface Node." in the browser console.  (A page with ancient greek text is not necessary to test, but is useful if you want to see the real functionality of the extension :) ) You can find more info on using these extensions here: https://vimeo.com/145095436 and http://alpheios.net/content/enabling-alpheios)
Thanks, Bridget!

Looking at that regression range (https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=3d846527576f&tochange=63006936ab99), I'm suspicious of peterv's changes from bug 1096328.

But what doesn't make sense is that #c0 in this bug said it regressed between Fx41 and Fx43, but this is pointing at a change from the Fx38 timeframe. Unless part of thatAny thoughts, Peter?
Flags: needinfo?(peterv)
Keywords: regressionwindow-wanted
(In reply to Ryan VanderMeulen [:RyanVM] from comment #4)
> Unless part of thatAny thoughts, Peter?

Gah, hit Save too fast there. *Unless some of that work depended on something that was nightly-only for awhile or something*
(Reporter)

Comment 6

a year ago
Thanks for your attenion to this! Please let me know if there is anything more I can do to help with debugging. The bug definitely doesn't manifest in FF42. I started my regression testing with nightly builds from October 2015, went all the way back through July, each build demonstrating the problem. Then started at the other end of the year.
It'd be weird if this was caused by bug 1096328. Note that the regression range does include bug 1117934. Is the bug reproducible with e10s disabled?
Flags: needinfo?(peterv) → needinfo?(balmas)
Ah, that could be if Bridget has been testing on Dev Edition or Nightly builds where e10s is enabled by default. Bridget, does this reproduce for you if you run a Firefox 43 beta build currently available? Or you can try unchecking "Enable multi-process Firefox" under Options::General in the Preferences window.
(Reporter)

Comment 9

a year ago
Interesting.  With e10s disabled, the bug goes away (i.e. the extension responds to my dbleclick mouse event) but then Firefox crashes:

Add-ons: %7B7dd2b42f-3db8-4833-88c4-5a9e3788017b%7D:1.0beta2.4097.20110813.1-signed,%7B4816253c-3208-49d8-9557-0745a5508299%7D:1.0beta2.4290.20150827,%7B972ce4c6-7e08-4474-a285-3208198ce6fd%7D:44.0a2,adbhelper%40mozilla.org:0.8.4,fxdevtools-adapters%40mozilla.org:0.3.2
BuildID: 20151118004041
CrashTime: 1447862440
EMCheckCompatibility: true
FramePoisonBase: 7ffffffff0dea000
FramePoisonSize: 4096
InstallTime: 1447862410
MozCrashReason: MOZ_RELEASE_ASSERT(aInAndOutListener) (can not perform CORS checks without a listener)
Notes: OpenGL: Intel Open Source Technology Center -- Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2)  -- 3.0 Mesa 10.5.9 -- texture_from_pixmap

ProductID: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
ProductName: Firefox
ReleaseChannel: aurora
SafeMode: 0
SecondsSinceLastCrash: 15
StartupTime: 1447862427
TelemetryEnvironment: {"build":{"applicationId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","applicationName":"Firefox","architecture":"x86-64","buildId":"20151118004041","version":"44.0a2","vendor":"Mozilla","platformVersion":"44.0a2","xpcomAbi":"x86_64-gcc3","hotfixVersion":null},"partner":{"distributionId":null,"distributionVersion":null,"partnerId":null,"distributor":null,"distributorChannel":null,"partnerNames":[]},"system":{"memoryMB":11716,"virtualMaxMB":null,"cpu":{"count":4,"cores":2,"vendor":"GenuineIntel","family":6,"model":61,"stepping":4,"l2cacheKB":256,"l3cacheKB":4096,"speedMHz":3200,"extensions":["hasMMX","hasSSE","hasSSE2","hasSSE3","hasSSSE3","hasSSE4_1","hasSSE4_2"]},"os":{"name":"Linux","version":"3.19.0-33-generic","locale":"en-US"},"hdd":{"profile":{"model":null,"revision":null},"binary":{"model":null,"revision":null},"system":{"model":null,"revision":null}},"gfx":{"D2DEnabled":null,"DWriteEnabled":null,"adapters":[{"description":"Intel Open Source Technology Center -- Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2) ","vendorID":"Intel Open Source Technology Center","deviceID":"Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2) ","subsysID":null,"RAM":null,"driver":null,"driverVersion":"3.0 Mesa 10.5.9","driverDate":null,"GPUActive":true}],"monitors":[],"features":{"compositor":"none"}}},"settings":{"blocklistEnabled":true,"e10sEnabled":false,"telemetryEnabled":true,"isInOptoutSample":false,"locale":"en-US","update":{"channel":"aurora","enabled":true,"autoDownload":true},"userPrefs":{"browser.cache.disk.capacity":358400,"browser.newtabpage.enhanced":true,"devtools.chrome.enabled":true},"addonCompatibilityCheckEnabled":true,"isDefaultBrowser":false},"profile":{"creationDate":16725},"addons":{"activeAddons":{"{7dd2b42f-3db8-4833-88c4-5a9e3788017b}":{"blocklisted":false,"description":"Extension for reading and learning Latin. Requires the Alpheios Basic Libraries extension, available","name":"Alpheios Latin Tools","userDisabled":false,"appDisabled":false,"version":"1.0beta2.4097.20110813.1-signed","scope":1,"type":"extension","foreignInstall":false,"hasBinaryComponents":false,"installDay":16725,"updateDay":16725,"signedState":2},"{4816253c-3208-49d8-9557-0745a5508299}":{"blocklisted":false,"description":"Extension for reading and learning languages. The Alpheios Basic Libraries extension provides the ba","name":"Alpheios Basic Libraries","userDisabled":false,"appDisabled":false,"version":"1.0beta2.4290.20150827","scope":1,"type":"extension","foreignInstall":false,"hasBinaryComponents":false,"installDay":16725,"updateDay":16725,"signedState":2},"adbhelper@mozilla.org":{"blocklisted":false,"description":"An addon to ease connecting to Firefox OS devices.","name":"ADB Helper","userDisabled":false,"appDisabled":false,"version":"0.8.4","scope":1,"type":"extension","foreignInstall":false,"hasBinaryComponents":false,"installDay":16725,"updateDay":16725,"signedState":1},"fxdevtools-adapters@mozilla.org":{"blocklisted":false,"description":"Protocol Adapters for Firefox Developer Tools. User documentation is available on MDN: https://devel","name":"Valence","userDisabled":false,"appDisabled":false,"version":"0.3.2","scope":1,"type":"extension","foreignInstall":false,"hasBinaryComponents":false,"installDay":16725,"updateDay":16725,"signedState":1}},"theme":{"id":"{972ce4c6-7e08-4474-a285-3208198ce6fd}","blocklisted":false,"description":"The default theme.","name":"Default","userDisabled":false,"appDisabled":false,"version":"44.0a2","scope":4,"foreignInstall":false,"hasBinaryComponents":false,"installDay":16725,"updateDay":16757},"activePlugins":[{"name":"IcedTea-Web Plugin (using IcedTea-Web 1.5.2 (1.5.2-1ubuntu2))","version":"","description":"The <a href=\"http://icedtea.classpath.org/wiki/IcedTea-Web\">IcedTea-Web Plugin</a> executes Java app","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-java-vm","application/x-java-applet","application/x-java-applet;version=1.1","application/x-java-applet;version=1.1.1","application/x-java-applet;version=1.1.2","application/x-java-applet;version=1.1.3","application/x-java-applet;version=1.2","application/x-java-applet;version=1.2.1","application/x-java-applet;version=1.2.2","application/x-java-applet;version=1.3","application/x-java-applet;version=1.3.1","application/x-java-applet;version=1.4","application/x-java-applet;version=1.4.1","application/x-java-applet;version=1.4.2","application/x-java-applet;version=1.5","application/x-java-applet;version=1.6","application/x-java-applet;version=1.7","application/x-java-applet;jpi-version=1.7.0_50","application/x-java-bean","application/x-java-bean;version=1.1","application/x-java-bean;version=1.1.1","application/x-java-bean;version=1.1.2","application/x-java-bean;version=1.1.3","application/x-java-bean;version=1.2","application/x-java-bean;version=1.2.1","application/x-java-bean;version=1.2.2","application/x-java-bean;version=1.3","application/x-java-bean;version=1.3.1","application/x-java-bean;version=1.4","application/x-java-bean;version=1.4.1","application/x-java-bean;version=1.4.2","application/x-java-bean;version=1.5","application/x-java-bean;version=1.6","application/x-java-bean;version=1.7","application/x-java-bean;jpi-version=1.7.0_50","application/x-java-vm-npruntime"],"updateDay":16402},{"name":"Google Talk Plugin Video Renderer","version":"","description":"Version: 5.41.0.0","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/o1d"],"updateDay":16520},{"name":"Google Talk Plugin","version":"","description":"Version: 5.41.0.0","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/googletalk"],"updateDay":16520},{"name":"iTunes Application Detector","version":"","description":"This plug-in detects the presence of iTunes when opening iTunes Store URLs in a web page with Firefo","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/itunes-plugin"],"updateDay":16530},{"name":"bjnplugin","version":"2.115.99.8","description":"","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-bjnplugin,version=2.115.99.8","application/x-bjnpluginslave,version=2.115.99.8","application/x-bjnloguploader,version=2.115.99.8","application/x-bjnplugin","application/x-bjnpluginslave","application/x-bjnloguploader"],"updateDay":16736},{"name":"bjninstallplugin","version":"2.115.99.8","description":"","blocklisted":false,"disabled":false,"clicktoplay":true,"mimeTypes":["application/x-bjninstallplugin,version=2.115.99.8","application/x-bjninstallplugin"],"updateDay":16736},{"name":"Shockwave Flash","version":"11.2.202.548","description":"Shockwave Flash 11.2 r202","blocklisted":false,"disabled":false,"clicktoplay":false,"mimeTypes":["application/x-shockwave-flash","application/futuresplash"],"updateDay":16750}],"activeGMPlugins":{"gmp-gmpopenh264":{"version":"1.5.1","userDisabled":false,"applyBackgroundUpdates":1}},"activeExperiment":{},"persona":"firefox-devedition@mozilla.org"}}
Theme: classic/1.0
Throttleable: 1
URL: http://alpheios.net/
Vendor: Mozilla
Version: 44.0a2
useragent_locale: en-US

This report also contains technical information about the state of the application when it crashed.
Flags: needinfo?(balmas)
(Reporter)

Comment 10

a year ago
that was the with the developer build. trying with the beta build now...
Please provide the link to the crash report from about:crashes if you have it :)
tracking-e10s: --- → ?
With e10s enabled, rp in comment 0 would be a CPOW to something in the content process.  Trying to stick it in a range from the _chrome_ document, which is what comment 0 is doing, is just not going to work: there isn't an actual DOM node there at all, just something that plays one on TV (or rather in JS).  Any C++ code (like the Range code) looking at that object will see it's not a node.

I'm not really sure there's a way to make this setup work with e10s; the extensions just need to be updated.  I suspect doing this:

    var range = rp.ownerDocument.createRange();

will make things work at least insofar as being able to set the range correctly.  Not sure what the code does with the range after that.
(Reporter)

Comment 13

a year ago
Good news: in FF 43 Beta (which i guess has e10s disabled?) extension works, and no crash occurs.

In what release will e10s be enabled?
(Reporter)

Comment 14

a year ago
In the event it's still of interest, the link to the crash report from the developer build is here:

https://crash-stats.mozilla.com/report/index/bp-45c30230-494b-454e-a97a-b62782151118
Great, that pretty much confirms it :). At this point, no final decision has been made about when e10s will ship other than "when it's ready".

Thanks for the crash reporter link. I think we should spin off another bug for that.
(Reporter)

Comment 16

a year ago
ok, do you want me to do that? Or will you? 

Thanks all for your help with this!
Ryan filed bug 1225882 on the crash.
Blocks: 905436
tracking-e10s: ? → +
The add-on code will need to be changed in order to avoid these shims. Bridget, please use one of our feedback channels [1], in particular the forum, for help.

[1] https://developer.mozilla.org/en-US/Add-ons#Contact_us
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.