mojarra
mojarra copied to clipboard
Namespaces on inline HTML tags causes the component tree to be malformed
If we have a fragment like
<h:body>
<c:if ...>
<p xmlns="http://www.w3.org/1999/xhtml">Some text</p>
</c:if>
<h:button ... />
</h:body>
(The tags and namespace do not matter - so long as an HTML tag with a namespace declaration exists on the page, this error will occur)
The expected tree should have a structure like:
h:body
+ c:if
- p
+ h:button
Instead it has a structure like:
h:body
+ c:if
- p
- h:button
Reproduced.
I just realized that the pull request I made to fix this isn't listed here. It's #4282.
Please see this important message regarding community contributions to Mojarra.
https://javaee.groups.io/g/jsf-spec/message/30
Also, please consider joining that group, as that group has taken the place of the old [email protected] mailing list.
Thanks,
Ed Burns
Great to see there is a pull request already to fix this. This is a large bug for us and causing me to run a forked version of JSF.
All my HTML is valid XML, and XML serializers do not always allow you to control where namespaces are added. Inline SVGs are common enough that I feel it is a pretty good example of why this should be fixed. (Searching Google you'll find half the examples out there have xmlns on the inline svg.)
@BalusC Are you able to accept his pull request? If not who should I message?