Summary: | If Range::insertNode is passed an empty document fragment, it creates a broken DOM tree | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Berend-Jan Wever <skylined> | ||||||
Component: | DOM | Assignee: | Darin Adler <darin> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | ap, cdumez, darin, eric, rniwa | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Berend-Jan Wever
2011-07-22 00:41:28 PDT
What is a NULL node? I think I understand. The issue is not with ranges. The issue is that insertNode does the wrong thing when passed an empty document fragment. I think all that’s needed to fix this bug is code to return from Range::insertNode function and do no further work if newNode->firstChild() is zero inside the DOCUMENT_FRAGMENT_NODE section of the code. @Darin; yes, with "NULL node" I meant a NULL ptr where a ptr to a node is expected. You analysis sounds correct to me, but I don't know the code, so don't take my word for it. I think I’ll fix this myself, but if someone else wants to tackle it first, they are welcome to. Created attachment 104621 [details]
Patch
Committed r93481: <http://trac.webkit.org/changeset/93481> Mass moving XML DOM bugs to the "DOM" Component. |