tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship (JIRA)" <j...@apache.org>
Subject [jira] Commented: (TAP5-518) MarkupWriter.write() writes to deleted nodes
Date Wed, 04 Mar 2009 20:33:59 GMT

    [ https://issues.apache.org/jira/browse/TAP5-518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678904#action_12678904
] 

Howard M. Lewis Ship commented on TAP5-518:
-------------------------------------------

The DOM modifiying methods were intended to operate after the MarkupWriter, not in concert
with it. Still a bug, but pretty minor.

> 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
>
> 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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message