mojarra icon indicating copy to clipboard operation
mojarra copied to clipboard

Namespaces on inline HTML tags causes the component tree to be malformed

Open Toberumono opened this issue 8 years ago • 4 comments
trafficstars

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

Toberumono avatar Sep 18 '17 18:09 Toberumono

Reproduced.

BalusC avatar Sep 22 '17 05:09 BalusC

I just realized that the pull request I made to fix this isn't listed here. It's #4282.

Toberumono avatar Sep 22 '17 14:09 Toberumono

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

edburns avatar Oct 29 '17 03:10 edburns

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?

dmschlot avatar Feb 05 '18 20:02 dmschlot