Closed
Bug 262964
Opened 20 years ago
Closed 20 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•20 years ago
|
||
Reporter | ||
Comment 2•20 years ago
|
||
Reporter | ||
Updated•20 years ago
|
Attachment #161141 -
Flags: review?(bzbarsky)
Comment 3•20 years ago
|
||
That patch has been on the trunk since September 16. See revision 3.90 of nsGenericDOMDataNode.h.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 4•20 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•11 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
•