[ 
https://issues.apache.org/jira/browse/TAP5-518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-518.
-------------------------------------
    Resolution: Won't Fix

> MarkupWriter.write() writes to deleted nodes
> --------------------------------------------
>
>                 Key: TAP5-518
>                 URL: https://issues.apache.org/jira/browse/TAP5-518
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.16
>         Environment: tested on Tapestry versions 5.0.18, 5.0.17 (could not 
> select in list for this issue)
> Windows Vista Service Pack 1, Eclipse 3.4.1 Build M20080911-1700, Run Jetty 
> Run Plugin 1.0.1
>            Reporter: Daniel Beck
>            Priority: Minor
>              Labels: bulk-close-candidate
>
> Description
> When removing a child text node from the current element, subsequent write()s 
> ware still written to the removed node.
> Reproduce:
> public void test(MarkupWriter writer) {
>   writer.element("a");
>   writer.write("foo");
>   writer.getElement().removeChildren();
>   writer.write("bar");
>   writer.end();
> }
> Expected Result:
> <a>bar</a>
> Actual Result:
> <a></a> (5.0.18)
> <a/> (5.0.17)
> Notes
> MarkupWriter.write() is documented as: "Writes the text as a child of the 
> current element" (5.0.17), suggesting that if there is no child text node, a 
> new one is created.
> MarkupWriterImpl (in 5.0.17) holds a reference to the text node, but does not 
> verify the node is still a child of the current node when write()ing to it.
> Workaround: Create a child <span> or other element which is basically ignored 
> when rendering, but modifying the document might not work for everyone.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to