Closed
Bug 375684
Opened 17 years ago
Closed 17 years ago
assertion when dragging the source is the document root node
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: enndeakin, Unassigned)
Details
Attachments
(2 files)
1.36 KB,
application/vnd.mozilla.xul+xml
|
Details | |
3.50 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
The assertion at http://lxr.mozilla.org/mozilla/source/layout/base/nsPresShell.cpp#5090 shouldn't be used as the range can have the start and end as the document root node, and the ancestor becomes the document. See the attached testcase. nsINode* ancestor = nsContentUtils::GetCommonAncestor(range->GetStartParent(), range->GetEndParent()); NS_ASSERTION(!ancestor || ancestor->IsNodeOfType(nsINode::eCONTENT), "common ancestor is not content"); roc, I guess in this case, we should just get the document root node and use that?
Why are we getting the common ancestor of the nodes' parents? Couldn't/shouldn't we just get the common ancestor of the nodes themselves?
Reporter | ||
Comment 2•17 years ago
|
||
If you're referring to GetStartParent/GetEndParent, they are just perhaps misnamed, they return the nodes themselves.
OK then, GetCommonAncestor should be returning the root node, right? The common ancestor of two references to the same node is that node.
Reporter | ||
Comment 4•17 years ago
|
||
This is because nsRange::SelectNode(node) gets the parent of node and then sets the end points based on that. So I think if the start or end point is the root node, we should just use the root frame instead.
Status: NEW → ASSIGNED
OK sure.
Reporter | ||
Comment 6•17 years ago
|
||
Attachment #260013 -
Flags: superreview?(roc)
Attachment #260013 -
Flags: review?(roc)
Attachment #260013 -
Flags: superreview?(roc)
Attachment #260013 -
Flags: superreview+
Attachment #260013 -
Flags: review?(roc)
Attachment #260013 -
Flags: review+
Reporter | ||
Updated•17 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•