Bug 11833 - ASSERTION FAILURE calling SelectionController::setBaseAndExtent
Summary: ASSERTION FAILURE calling SelectionController::setBaseAndExtent
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Critical
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2006-12-14 15:48 PST by Geoffrey Garen
Modified: 2007-01-29 17:33 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2006-12-14 15:48:15 PST
ASSERTION FAILED: !s.base().node() || s.base().node()->document() == m_frame->document()
(/Users/ggaren/Labyrinth/OpenSource/WebCore/editing/SelectionController.cpp:107 void WebCore::SelectionController::setSelection(const WebCore::Selection&, bool, bool, bool))
Program received signal:  "EXC_BAD_ACCESS".

Here's the reduction:

<iframe src="data:text/html, <div id='test' contenteditable='true'>hello world</div>"></iframe>
<script>
window.onload = function() {
    var div = frames[0].document.getElementById('test');
    getSelection().setBaseAndExtent(div, 0, div, 1);
}
</script>
Comment 1 Mark Rowe (bdash) 2007-01-28 16:15:41 PST
<rdar://problem/4960137>
Comment 2 Justin Garcia 2007-01-29 14:53:38 PST
You're setting the wrong frame's selection.  You want to:

frames[0].getSelection().setBaseAndExtent(...)

But we probably shouldn't ASSERT.  Maybe we should try to set the right frame's selection if the user does this.
Comment 3 Justin Garcia 2007-01-29 17:33:10 PST
r19239