Open Bug 772668 Opened 8 years ago Updated 7 years ago
Node isn't in m Range, or something else weird happened" after failed justifyright
###!!! ASSERTION: aNode isn't in mRange, or something else weird happened: 'NS_SUCCEEDED(res) && !nodeBefore && !nodeAfter', file content/base/src/nsContentIterator.cpp, line 1437
The test case seems awfully obfuscated. If you're going to use DOM methods instead of just an HTML serialization, you can do stuff like document.documentElement.setAttributeNS(null, "contenteditable", "true"); allNodes = document.createElementNS("http://www.w3.org/1999/xhtml", "div"); allNodes.setAttributeNS(null, "contenteditable", "false"); allNodes = document.createTextNode("x"); (allNodes || document.documentElement).appendChild(allNodes); -> document.documentElement.contentEditable = true; var div = document.createElement("div"); div.contentEditable = false; div.appendChild(document.createTextNode("x")); What's the || business there even supposed to do? allNodes is certainly not null, so everything after it will just be ignored . . . Similarly, this window.getSelection().removeAllRanges(); r0 = document.createRange(); r0.setStart(allNodes, 1); r0.setEnd(allNodes, 1); window.getSelection().addRange(r0); could be just getSelection().collapse(allNodes, 1); This kind of change would make the tests a lot easier to understand . . .
Jesse's test cases are usually auto-generated using a fuzzer. :-)
Yeah, I usually make those kinds of transformations manually before filing bugs. This is roughly the form I use for automated reduction. (The "||" allows the children of a removed node to remain in the document, for example.)
The fix for bug 887631 didn't take care of this one, fwiw.
You need to log in before you can comment on or make changes to this bug.