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

RESOLVED FIXED in mozilla13

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: Jesse Ruderman, Assigned: mats)

Tracking

(Blocks: 1 bug, {assertion, testcase})

Trunk
mozilla13
assertion, testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

5 years ago
Created attachment 596386 [details]
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]
...
(Assignee)

Comment 1

5 years ago
Created attachment 596405 [details]
stack
(Assignee)

Comment 2

5 years ago
Created attachment 596406 [details] [diff] [review]
fix

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)
(Assignee)

Comment 3

5 years ago
https://tbpl.mozilla.org/?tree=Try&rev=751dc0721e3f

Comment 4

5 years ago
Comment on attachment 596406 [details] [diff] [review]
fix

What if there is no current document?

Comment 5

5 years ago
Would adding a scriptblocker work?
(Assignee)

Comment 6

5 years ago
> 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.

Comment 8

5 years ago
Comment on attachment 596406 [details] [diff] [review]
fix

Ok
Attachment #596406 - Flags: review?(bugs) → review+
(Assignee)

Comment 9

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/8a820e4ee7f6
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 → ---
(Assignee)

Comment 11

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/5c8d7e3de1b8
Whiteboard: [inbound]
Target Milestone: --- → mozilla13
https://hg.mozilla.org/mozilla-central/rev/5c8d7e3de1b8
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Component: DOM: Traversal-Range → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.