The following comment has been added to this issue:

     Author: Aaron Kardell
    Created: Thu, 20 May 2004 6:23 PM
       Body:
First off, I apologize -- I posted this in Bugzilla as well as bug #29130.  Then, I 
realized that JIRA now appears to be the primary bug tracking tool.

I believe this issue goes beyond simply the issue of 
HTMLTableRowElementImpl.getCells().  I believe a similar problem affects all of the 
following methods:

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

They all 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 cloned node, and I will also include a file called 
TestingSelectCloneNode.java which reproduces this behavior with a similar test case to 
that provided above.

This appears to not be platform, OS, or JDK specific.

Special thanks to Neil Berget for helping to track down this issue.
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/XERCESJ-525?page=comments#action_35657

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESJ-525

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESJ-525
    Summary: HTMLTableRowElement.cloneNode() incorrectly copies _cells
       Type: Bug

     Status: Open

    Project: Xerces2-J
 Components: 
             DOM
   Versions:
             2.2.0

   Assignee: Xerces-J Developers Mailing List
   Reporter: Brett Sutton

    Created: Sat, 23 Nov 2002 3:56 AM
    Updated: Thu, 20 May 2004 6:23 PM
Environment: Operating System: All
Platform: All

Description:
If you attempt to clone (deep) an existing row the _cells private member 
variable is also cloned. The problem is that (provided _cells has been 
initialised by a call to getCells()) _cells points to the original row. Any 
future calls to getCells() on the new row will return the cell information 
from the original row. 

Suggested fix:
During the call to cloneNode() _cells should be set to null. The next call to 
getCells() will then correctly initialise it.

Implement HTMLTableRowElement.cloneNode(boolean deep) as follows:

public Node HTMLTableRowElement.cloneNode(boolean deep)
{
   Node newNode = super.cloneNode(deep); 
   newNode._cells = null;
   return newNode;
}


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to