Closed
Bug 262964
Opened 21 years ago
Closed 21 years ago
nsRange::InsertNode fails because of nsGenericDOMDataNode::SplitText
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: atremon, Unassigned)
Details
Attachments
(2 files)
|
5.66 KB,
patch
|
Details | Diff | Splinter Review | |
|
667 bytes,
patch
|
bzbarsky
:
review-
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a4) Gecko/20040927
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a4) Gecko/20040927
SplitText calls CloneContent.
CloneContent implementation has been changed (see bug 27382)
Reproducible: Always
Steps to Reproduce:
In an app embedding Gecko:
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentRange.h"
#include "nsIDOMElement.h"
#include "nsIDOMRange.h"
#include "nsIDOMNode.h"
#include "nsIDOMText.h"
#include "nsISelection.h"
#include "nsIDOMWindow.h"
nsresult rv;
nsIDOMDocument* domDoc;
mWebNav->GetDocument(&domDoc);
//
nsCOMPtr<nsIDOMElement> domElement;
domDoc->CreateElement(NS_LITERAL_STRING("b"), getter_AddRefs(domElement));
nsCOMPtr<nsIDOMText> domText;
domDoc->CreateTextNode(NS_LITERAL_STRING("insert me"), getter_AddRefs(domText));
//
nsCOMPtr<nsIDOMWindow> domWindow;
mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
nsCOMPtr<nsISelection> selection;
domWindow->GetSelection(getter_AddRefs(selection));
//
nsCOMPtr<nsIDOMRange> domRange;
PRInt32 c;
selection->GetRangeCount(&c);
selection->GetRangeAt(0, getter_AddRefs(domRange));
//
domRange->InsertNode(domElement);
nsCOMPtr<nsIDOMNode> dummyNode;
domElement->AppendChild(domText, getter_AddRefs(dummyNode));
Actual Results:
InsertNode calls nsGenericDOMDataNode::SplitText that fails on
nsGenericDOMDataNode::CloneContent.
| Reporter | ||
Comment 1•21 years ago
|
||
| Reporter | ||
Comment 2•21 years ago
|
||
| Reporter | ||
Updated•21 years ago
|
Attachment #161141 -
Flags: review?(bzbarsky)
Comment 3•21 years ago
|
||
That patch has been on the trunk since September 16. See revision 3.90 of
nsGenericDOMDataNode.h.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 4•21 years ago
|
||
Comment on attachment 161141 [details] [diff] [review]
wrong file
For future reference, you would need to fix the whitespace so the lines line up
right too...
Attachment #161141 -
Flags: review?(bzbarsky) → review-
Updated•12 years ago
|
Component: DOM: Traversal-Range → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•