Closed Bug 1234713 Opened 4 years ago Closed 3 years ago

Picker fails with "TypeError: node.ownerDocument is null" then repeated NS_ERROR_XPC_BAD_CONVERT_JS errors

Categories

(DevTools :: Inspector, defect, P2)

Unspecified
Windows 7
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1305401

People

(Reporter: markh, Unassigned)

Details

(Whiteboard: [btpp-fix-later])

Attachments

(1 file)

STR:
* Open browser toolbox and click on the "pick" tool.
* Move the mouse slowly into the right-hand-side of window just below the window min/max/restore controls into the area taken up by the tabstrip - see attached screenshot.

Picker stops working and the console shows:

> JavaScript error: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters/simple-outline.js, line 49: TypeError: node.ownerDocument is null
> JavaScript error: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters/utils/markup.js, line 30: NS_ERROR_XPC_BAD_CONVERT_JS: Could not convert JavaScript argument arg 0 [inIDOMUtils.removePseudoClassLock]

with that last line repeating every time the mouse moves. You need to restart to get the picker working again. I made the following patch:

index 7421949..8f25665 100644
--- a/devtools/server/actors/highlighters/simple-outline.js
+++ b/devtools/server/actors/highlighters/simple-outline.js
@@ -44,6 +44,8 @@ SimpleOutlineHighlighter.prototype = {
     if (!this.currentNode || node !== this.currentNode) {
       this.hide();
       this.currentNode = node;
+      if (!node.ownerDocument)
+        dump("NODE is " + node + "\n" + Error().stack)
       installHelperSheet(node.ownerDocument.defaultView, SIMPLE_OUTLINE_SHEET);
       addPseudoClassLock(node, HIGHLIGHTED_PSEUDO_CLASS);
     }

and I get:

NODE is [object XULDocument]
SimpleOutlineHighlighter.prototype.show@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters/simple-outline.js:48:41
exports.HighlighterActor<.pick</this._onHovered@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters.js:282:9
EventListener.handleEvent*exports.HighlighterActor<._startPickerListeners@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters.js:373:5
exports.HighlighterActor<.pick<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/actors/highlighters.js:358:5
actorProto/</handler@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/protocol.js:1013:19
DSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/server/main.js:1643:15
DebuggerTransport.prototype._onJSONObjectReady/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/transport/transport.js:479:9
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/DevToolsUtils.js:87:14
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/DevToolsUtils.js:87:14

So the node is already a document of some sort.
OS: Unspecified → Windows 7
It appears that moving the mouse slowly enough anywhere into the right edge of the browser window causes the problem - it starts as soon as we move off the border into the window itself.
Triaging (filter on CLIMBING SHOES).
Priority: -- → P2
Whiteboard: [btpp-fix-later]
I'm not able to reproduce, could it be that it has been fixed by all the changes made to the highlighter?
(Tested on Window7)

It looks like we now call isNodeValid() which explicitely checks for node.ownerDocument being defined.

http://searchfox.org/mozilla-central/source/devtools/server/actors/highlighters/simple-outline.js#48
  show: function (node) {
    if (isNodeValid(node) && (!this.currentNode || node !== this.currentNode)) {

I imagine that's a duplicate of bug 1305401.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1305401
No longer blocks: top-inspector-bugs
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.