Closed
Bug 389016
Opened 17 years ago
Closed 17 years ago
our 1.1 insert code can't handle empty target nodesest
Categories
(Core Graveyard :: XForms, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: aaronr, Assigned: msterlin)
References
Details
(Keywords: fixed1.8.1.8)
Attachments
(4 files, 3 obsolete files)
Found by a user on the newsgroup and SteveS, our 1.1 insert doesn't correctly handle the case where the nodeset that we are inserting into is empty.
Testcase I'm attaching comes from John Boyer's blog.
Assignee | ||
Updated•17 years ago
|
Status: NEW → ASSIGNED
This testcase is similar to the first testcase but with attributes. Works on Orbeon, but not formsPlayer/Sidewinder. But I don't think that there is anything wrong with it.
fixed the 'delete' trigger in testcase 2
Attachment #273187 -
Attachment is obsolete: true
Assignee | ||
Comment 4•17 years ago
|
||
- No longer restricting insert of an element to another element. Now elements can be inserted to any non-attribute node. Fixes testcase 1, 2 and 3.
- If the insert location node is empty, the inserted node will become the first child of the location node. Fixes the first test of testcase 3.
- We were unable to delete an attribute node but now check if the node to be deleted is an attribute node. If so, gets the owner element and removes the attribute node. Fixes the delete in testcase 2.
Attachment #273209 -
Flags: review?(aaronr)
Comment on attachment 273209 [details] [diff] [review]
patch
>Index: nsXFormsInsertDeleteElement.cpp
>===================================================================
>@@ -652,52 +684,54 @@ nsXFormsInsertDeleteElement::InsertNode(
>+ // New node will be inserted either before or after targetNode.
>+ nsCOMPtr<nsIDOMNode> targetNode;
>+ targetNode = aTargetNode;
nit: assign targetNode to aTargetNode when you declare it on the previous line.
with that, r=me
Attachment #273209 -
Flags: review?(aaronr) → review+
Assignee | ||
Comment 6•17 years ago
|
||
Attachment #273209 -
Attachment is obsolete: true
Attachment #273437 -
Flags: review?(Olli.Pettay)
Updated•17 years ago
|
Attachment #273437 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 7•17 years ago
|
||
Delete attribute case was not incrementing the deleteIndex for the while loop so we loop more than necessary and get ns_ensure_state warnings when the second pass thru the loop tried to get the owner element for the attribute node that was deleted in the first iteration of the loop.
Attachment #273437 -
Attachment is obsolete: true
Attachment #273863 -
Flags: review+
Assignee | ||
Updated•17 years ago
|
Attachment #273863 -
Flags: review?(Olli.Pettay)
Updated•17 years ago
|
Attachment #273863 -
Flags: review?(Olli.Pettay) → review+
checked into trunk and 1.8 branch for msterlin
Comment 10•17 years ago
|
||
>+ enum Location {
>+ eLocation_After,
>+ eLocation_Before,
>+ eLocation_FirstChild,
>+ };
The trailing comma there is a compile error with gcc, for what it's worth. Please fix?
Reporter | ||
Comment 11•17 years ago
|
||
(In reply to comment #10)
> >+ enum Location {
> >+ eLocation_After,
> >+ eLocation_Before,
> >+ eLocation_FirstChild,
> >+ };
>
> The trailing comma there is a compile error with gcc, for what it's worth.
> Please fix?
>
Thanks for catching it. Will fix.
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•