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)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: msterlin)

References

Details

(Keywords: fixed1.8.1.8)

Attachments

(4 files, 3 obsolete files)

1.92 KB, application/xhtml+xml
Details
2.88 KB, application/xhtml+xml
Details
2.25 KB, application/xhtml+xml
Details
10.12 KB, patch
aaronr
: review+
smaug
: review+
Details | Diff | Splinter Review
Attached file testcase
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.
Status: NEW → ASSIGNED
Attached file testcase2 (obsolete) —
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.
Attached file testcase3
testcase from John on NG.
Attached file testcase2
fixed the 'delete' trigger in testcase 2
Attachment #273187 - Attachment is obsolete: true
Attached patch patch (obsolete) — Splinter Review
- 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+
Attached patch patch2 (obsolete) — Splinter Review
Attachment #273209 - Attachment is obsolete: true
Attachment #273437 - Flags: review?(Olli.Pettay)
Attachment #273437 - Flags: review?(Olli.Pettay) → review+
Attached patch final patchSplinter Review
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+
Attachment #273863 - Flags: review?(Olli.Pettay)
Attachment #273863 - Flags: review?(Olli.Pettay) → review+
checked into trunk and 1.8 branch for msterlin
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: fixed1.8.1.7
Resolution: --- → FIXED
>+ 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?
(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.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: