MyFaces Core
  1. MyFaces Core
  2. MYFACES-3298

h:outputText incorectly renders an extra <span>

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.0.9, 2.1.3
    • Component/s: None
    • Labels:
      None

      Description

      The h:outputText seems to incorectly render a <span> element, even though no id/style/styleClass attribute is specified (as specified in http://myfaces.apache.org/core21/myfaces-impl/tlddoc-facelets/h/outputText.html )

      Example:
      <h:outputText value="abc" escape="false" /> --renders--> <span>abc</span>

      In 2.1.1 it corectly rendered just abc.

      Reason for the regression seems to be the optimization introduced in MYFACES-3237. I didn't go much into the details of the optimization mechanism, but seems that in HtmlTextRendererBase:renderOutput the "span = true" gets incorectly set when any attribute is encountered (and not only one of id/style/styleClass).

        Issue Links

          Activity

          Hide
          Leonardo Uribe added a comment -

          I tested it and the reason is escape attribute adds a marker, so when the check for set the span is done, this field is also included in the calculation, and it should not. Checking this one I saw that h:messages adds an additional <span>, and that is not necessary. Thanks for the report.

          Show
          Leonardo Uribe added a comment - I tested it and the reason is escape attribute adds a marker, so when the check for set the span is done, this field is also included in the calculation, and it should not. Checking this one I saw that h:messages adds an additional <span>, and that is not necessary. Thanks for the report.

            People

            • Assignee:
              Leonardo Uribe
              Reporter:
              Jarek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development