Closed Bug 726364 Opened 14 years ago Closed 14 years ago

"ASSERTION: unexpected disconnected nodes" with range, splitText, mutation event

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: jruderman, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: assertion, testcase)

Attachments

(3 files)

Attached file testcase
###!!! ASSERTION: unexpected disconnected nodes: 'aDisconnected', file content/base/src/nsContentUtils.cpp, line 1716 nsRange::SetEnd [content/base/src/nsRange.cpp:1004] nsRange::SetEnd [content/base/src/nsRange.cpp:987] nsIDOMRange_SetEnd [obj-firefox/js/xpconnect/src/dom_quickstubs.cpp:17981] js::CallJSNative [js/src/jscntxtinlines.h:311] ...
Attached file stack
Attached patch fixSplinter Review
I don't think we want to run script before we have inserted the new node. There's a similar case in nsINode::Normalize() nsTextNode::AppendTextForNormalize SetTextInternal RemoveChildAt where Normalize() use mozAutoDocUpdate to batch those events. This patch makes SplitData have the same setup.
Assignee: nobody → matspal
Attachment #596406 - Flags: review?(bugs)
Comment on attachment 596406 [details] [diff] [review] fix What if there is no current document?
Would adding a scriptblocker work?
> What if there is no current document? mozAutoDocUpdate deals with that: http://mxr.mozilla.org/mozilla-central/source/content/base/src/mozAutoDocUpdate.h#51 > Would adding a scriptblocker work? Well, we are modifying the DOM so wrapping the changes in BeginUpdate/EndUpdate seems prudent. I don't much about the nsIDocumentObserver protocol though...
OS: Mac OS X → All
Hardware: x86_64 → All
It's ... been changing. I do think doing the update here is the prudent thing.
Attachment #596406 - Flags: review?(bugs) → review+
Flags: in-testsuite+
Whiteboard: [inbound]
Target Milestone: --- → mozilla13
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/0c1fdf386ac1 since I wasn't sure which reftest failures and which crashtest assertion count failures went with which cset in the push.
Whiteboard: [inbound]
Target Milestone: mozilla13 → ---
Whiteboard: [inbound]
Target Milestone: --- → mozilla13
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Component: DOM: Traversal-Range → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: