Closed Bug 771639 Opened 12 years ago Closed 12 years ago

"Assertion failure: node" in ValidateCurrentNode

Categories

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

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: jruderman, Assigned: ayg)

References

Details

(Keywords: assertion, regression, testcase)

Attachments

(3 files)

Attached file testcase
Assertion failure: node, at content/base/src/nsRange.cpp:1457

This assertion is part of ValidateCurrentNode, a function added in bug 766426.
Attached file stack trace
Assignee: nobody → ayg
Attached patch PatchSplinter Review
This turns out not to have anything to do with fullscreen.  What CutContents does in this case is:

1) Create an iterator and call Last()

2) Save the current node in a local variable

3) Call Prev() on iterator so that if we delete the local variable, the iterator points to the next node we should delete

4) Delete the node

5) Call ValidateCurrentNode() on the iterator

The problem is that if any mutation occurs in step (4), and the node we just removed is the last one, the iterator will be done.  Then ValidateCurrentNode() will try to get the current node, which will be null.  Then it will assert.  In this case, we should just say it's valid.

Try: https://tbpl.mozilla.org/?tree=Try&rev=09c3dfd3d7ce
Attachment #640054 - Flags: review?(bugs)
Status: NEW → ASSIGNED
Attachment #640054 - Flags: review?(bugs) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/8129536fb25c
Flags: in-testsuite+
OS: Mac OS X → All
Hardware: x86_64 → All
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/8129536fb25c
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
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: