Deleting a node within a XBL-bound section causes JS exception and assertion failure

RESOLVED DUPLICATE of bug 338284

Status

()

Core
Layout
RESOLVED DUPLICATE of bug 338284
11 years ago
11 years ago

People

(Reporter: dholbert, Unassigned)

Tracking

({qawanted})

Trunk
x86
Linux
qawanted
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 268417 [details]
testcase

Occurs both in Trunk and Branch.

Steps to reproduce:
1. Load test case
2. Open DOM inspector
3. In the DOM tree, navigate to the div with id "removeMe", under html/body/div#parent/div#removeMe
4. Select the "removeMe" div and press "delete" (or use the right-click context menu to delete it)

Expected behavior: Green-background removeMe div should disappear from page (I think).  At very least, no assertions/exceptions should fail.

Observed behavior: Page display remains unchanged, and in the console, these error messages appear:

************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "Node was not found"  code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)"  location: "chrome://inspector/content/viewers/dom/dom.js Line: 1032"]
************************************************************
JavaScript error: , line 0: uncaught exception: [Exception... "Node was not found"  code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)"  location: "chrome://inspector/content/viewers/dom/dom.js Line: 1032"]
###!!! ASSERTION: frame was not removed from primary frame map before destruction or was readded to map after being removed: 'Not Reached', file /scratch/work/builds/trunk.07-06-13.17-51/mozilla/layout/base/nsFrameManager.cpp, line 708
BTW: I'm using the DOM inspector for deletion 'cause I'm not sure how to do it automatically via javascript in this case.

The automated method that Jesse's fuzzer uses does not work here, presumably because the node being removed is at the top-level of XBL content.
(Jesse's method being the following, from Bug 382376:
  var v = document.getElementById("v");
  v.parentNode.removeChild(v);
)
I get this error when I do that sort of thing:
JavaScript error: file:///path/to/test3b.xhtml, line 9: v has no properties

If anyone knows how this can be done via javascript in this situation, that'd be handy for automating the test case.
So, it doesn't look like I always get the assertion failure from simply deleting the node.   (although I do still get the JS exception.)

I can more reliably cause the assertion failure by copying the "removeMe" div in the DOM inspector, and then right-clicking on another node (e.g. "body") and selecting "paste-> [any sort of paste]".

Interestingly, in that situation, the frame triggering the assertion failure is a nsMenuPopupFrame.  I'm pretty sure it's the "paste" sub-menu.  Consequently, it's important to perform the paste using the mouse (via right-click context menu on a node), rather than using ctrl-V.
The JS exception is what should be happening.  That node cannot be removed via the DOM APIs.

I wonder what's going on with the assertion, but we have existing bugs on that.
Keywords: qawanted
marking as duplicate -- as bz said, the JS exception is correct, and the assertion is covered by bug 338284.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 338284
You need to log in before you can comment on or make changes to this bug.