Bug 29130 - HTMLSelectElementImpl.getOptions(), HTMLTableElementImpl.getRows(), ... do not return the right results after a cloneNode
Summary: HTMLSelectElementImpl.getOptions(), HTMLTableElementImpl.getRows(), ... do no...
Status: NEW
Alias: None
Product: Xerces-J
Classification: Unclassified
Component: HTMLDOM (show other bugs)
Version: CVS extract
Hardware: All All
: P3 major
Target Milestone: ---
Assignee: Xerces-J Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-20 21:14 UTC by Aaron Kardell
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
Reproducible Test Case Code and Patches to Fix the Problem (20.00 KB, application/octet-stream)
2004-05-20 21:16 UTC, Aaron Kardell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Kardell 2004-05-20 21:14:39 UTC
The following methods:

HTMLSelectElementImpl.getOptions()
HTMLTableElementImpl.getRows()
HTMLFormElementImpl.getElements()
HTMLMapElementImpl.getAreas()
HTMLTableElementImpl.getTBodies()
HTMLTableRowElementImpl.getCells()
HTMLTableSectionElementImpl.getRows()

appear to return the wrong cached results, if the following sequence of events
occurs (HTMLSelectElementImpl is used as an example):

1) You have a variable, origSelect, to an HTMLSelectElementImpl object
2) You call origSelect.getOptions()
3) You call origSelect.cloneNode(true) and assign it to the variable clonedSelect
4) Your call to clonedSelect.getOptions() inappropriately returns the same
result as a call to origSelect.getOptions().

I will be attaching patch files that I believe fix the problem by clearing the
cached items upon a clonedNode, and I will also include a file called
TestingSelectCloneNode.java.

This appears to not be platform, OS, or JDK specific.
Comment 1 Aaron Kardell 2004-05-20 21:16:28 UTC
Created attachment 11615 [details]
Reproducible Test Case Code and Patches to Fix the Problem
Comment 2 Aaron Kardell 2004-05-20 21:18:30 UTC
Just wanted to follow up with a few things.

The attachment is a .tar file.

I think my patch fixes the problem because it clears the cache upon a cloneNode
happening.

Also, thanks go to Neil Berget, also of Altona Ed, for helping to track down the
problem and provide a fix.
Comment 3 Aaron Kardell 2004-05-21 01:44:18 UTC
My apologies -- I didn't realize that Jira was in place for tracking issues... 
I have posted the same content to an existing bug -- XERCESJ-525 available at:
http://nagoya.apache.org/jira/browse/XERCESJ-525